/* ==========================================
   PWA STYLES
   Estilos para botón de instalación y notificaciones
   ========================================== */

/* Botón de instalación flotante */
.pwa-install-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.pwa-install-button.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.pwa-install-button:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.pwa-install-button:active {
    transform: translateY(0) scale(0.98);
}

.pwa-install-button i {
    font-size: 20px;
}

/* Responsive móvil */
@media (max-width: 768px) {
    .pwa-install-button {
        bottom: 80px; /* Sobre navbar móvil */
        right: 15px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .pwa-install-button span {
        display: none; /* Solo ícono en móvil */
    }

    .pwa-install-button i {
        font-size: 24px;
        margin: 0;
    }
}

/* Notificación de actualización */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 400px;
    z-index: 10000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.pwa-update-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.pwa-update-content {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.pwa-update-content i {
    font-size: 32px;
    color: #667eea;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.pwa-update-content strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 16px;
}

.pwa-update-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.pwa-update-notification button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: transform 0.2s;
}

.pwa-update-notification button:hover {
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .pwa-update-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Estilos cuando la app está en modo standalone */
body.pwa-standalone {
    /* Ajustes para cuando la app está instalada */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* iOS status bar */
@supports (-webkit-touch-callout: none) {
    body.pwa-standalone {
        padding-top: constant(safe-area-inset-top);
        padding-bottom: constant(safe-area-inset-bottom);
    }
}

/* Splash screen (iOS) */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: fadeOut 0.5s ease-in-out 2s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.pwa-splash-logo {
    color: white;
    font-size: 48px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Banner de instalación personalizado (opcional) */
.pwa-install-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.pwa-install-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

.pwa-install-banner-content {
    flex: 1;
}

.pwa-install-banner-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 16px;
}

.pwa-install-banner-content p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.pwa-install-banner-actions {
    display: flex;
    gap: 10px;
}

.pwa-install-banner button {
    background: white;
    color: #667eea;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.pwa-install-banner button:hover {
    transform: scale(1.05);
}

.pwa-install-banner .btn-close {
    background: transparent;
    color: white;
    padding: 5px 10px;
}

/* Indicador de estado offline */
.pwa-offline-indicator {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #f44336;
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.pwa-offline-indicator.show {
    transform: translateY(0);
}

.pwa-offline-indicator.online {
    background: #4caf50;
}
