/* =====================================
    PWA STYLES - Estilos para Progressive Web App
    Notificaciones, banners de instalación, etc.
 ===================================== */

/* Banner de instalación PWA */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: #003087;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.install-banner.show {
    transform: translateY(0);
}

.install-banner .banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.install-banner .banner-text {
    flex: 1;
    text-align: left;
}

.install-banner .banner-text h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.install-banner .banner-text p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.install-banner .banner-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.install-banner .btn-install,
.install-banner .btn-dismiss {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.install-banner .btn-install {
    background: #003087;
    color: white;
}

.install-banner .btn-install:hover {
    background: #002266;
    transform: translateY(-1px);
}

.install-banner .btn-dismiss {
    background: rgba(255, 255, 255, 0.2);
    color: #003087;
    border: 2px solid #003087;
}

.install-banner .btn-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Notificación de actualización PWA */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    max-width: 350px;
    transform: translateX(100%);
    animation: slideInFromRight 0.5s ease forwards;
}

.pwa-update-notification .update-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pwa-update-notification p {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.pwa-update-notification .button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.pwa-update-notification .button.primary {
    background: white;
    color: #28a745;
}

.pwa-update-notification .button.primary:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.pwa-update-notification .button.secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.pwa-update-notification .button.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Notificaciones push locales */
.pwa-push-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 10002;
    max-width: 350px;
    transform: translateX(100%);
    animation: slideInFromRight 0.5s ease forwards;
    cursor: pointer;
}

.pwa-push-notification:hover {
    transform: translateX(0) scale(1.02);
}

.pwa-push-notification .notification-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.pwa-push-notification .notification-icon {
    font-size: 1.5rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.pwa-push-notification .notification-text {
    flex: 1;
}

.pwa-push-notification .notification-title {
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
}

.pwa-push-notification .notification-body {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.95;
    line-height: 1.4;
}

.pwa-push-notification .notification-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

.pwa-push-notification .notification-close:hover {
    opacity: 1;
}

/* Estado offline */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline-indicator.show {
    transform: translateY(0);
}

.offline-indicator .offline-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.offline-indicator i {
    font-size: 1rem;
}

/* Estado online */
.online-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 0.5rem 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 10000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    animation: slideDown 0.5s ease forwards;
}

.online-indicator .online-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.online-indicator i {
    font-size: 1rem;
}

/* Animaciones */
@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .install-banner .banner-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .install-banner .banner-text {
        text-align: center;
    }

    .install-banner .banner-actions {
        justify-content: center;
    }

    .pwa-update-notification,
    .pwa-push-notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .offline-indicator,
    .online-indicator {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
}

/* Loading states */
.pwa-loading {
    position: relative;
    overflow: hidden;
}

.pwa-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* PWA install button */
.pwa-install-btn {
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: #003087;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-install-btn i {
    font-size: 1.1rem;
}

/* Cache status indicator */
.cache-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cache-status.show {
    opacity: 1;
}

.cache-status .cache-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cache-status i {
    font-size: 0.9rem;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .install-banner {
        background: linear-gradient(135deg, #FFA000, #FF8F00);
    }

    .pwa-update-notification {
        background: linear-gradient(135deg, #20c997, #17a2b8);
    }

    .pwa-push-notification {
        background: linear-gradient(135deg, #0056b3, #004085);
    }
}