/* File Path: css/components/pwa-banners.css */
/* FIXED: Modern PWA Install & Update Banners - Top Position with 90s Duration */

/* ========================================
   PWA Install Banner - TOP CENTER (FIXED)
   ======================================== */
.pwa-install-banner {
    position: fixed;
    top: 80px; /* Below navbar */
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    max-width: 480px;
    width: calc(100% - 40px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    color: white;
    padding: 20px;
    z-index: 1050;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.pwa-install-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>');
    background-size: 100px;
    opacity: 0.3;
    animation: float 20s infinite linear;
}

@keyframes float {
    0% { background-position: 0 0; }
    100% { background-position: 100px 100px; }
}

.pwa-install-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.pwa-banner-icon-large {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    backdrop-filter: blur(10px);
    animation: pulse-icon 2s infinite;
}

@keyframes pulse-icon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-text h6 {
    color: white;
    font-weight: 600;
    margin: 0;
    font-size: 16px;
}

.pwa-banner-text p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    line-height: 1.5;
}

.pwa-features {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.pwa-features .badge {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.pwa-banner-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.pwa-banner-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.pwa-banner-actions {
    position: relative;
    z-index: 2;
    display: flex;
    gap: 10px;
    align-items: center;
}

.pwa-banner-actions .btn-primary {
    background: white;
    color: #667eea;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.pwa-banner-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3);
    background: #f8f9fa;
}

.pwa-banner-actions .btn-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
}

.pwa-banner-actions .btn-link:hover {
    color: white;
    text-decoration: underline;
}

/* ========================================
   PWA Update Banner - Top Center
   ======================================== */
.pwa-update-banner {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    max-width: 500px;
    width: calc(100% - 40px);
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    z-index: 1060;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-update-banner.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-update-banner .pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    margin-bottom: 0;
}

.pwa-update-banner .pwa-banner-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.pwa-update-banner .pwa-banner-text {
    flex: 1;
}

.pwa-update-banner .pwa-banner-text strong {
    display: block;
    font-size: 15px;
    margin-bottom: 2px;
}

.pwa-update-banner .pwa-banner-text p {
    font-size: 13px;
    opacity: 0.95;
}

.pwa-update-banner .pwa-banner-actions {
    display: flex;
    gap: 8px;
}

.pwa-update-banner .btn-light {
    background: white;
    color: #2193b0;
    border: none;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s;
}

.pwa-update-banner .btn-light:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.pwa-update-banner .btn-link {
    color: white;
    font-size: 13px;
    text-decoration: none;
    padding: 6px 12px;
}

.pwa-update-banner .btn-link:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .pwa-install-banner {
        top: 10px;
        max-width: calc(100% - 20px);
    }

    .pwa-banner-content {
        flex-direction: column;
        gap: 12px;
    }

    .pwa-banner-icon-large {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .pwa-banner-actions {
        flex-direction: column;
        width: 100%;
    }

    .pwa-banner-actions .btn {
        width: 100%;
    }

    .pwa-update-banner {
        top: 10px;
        max-width: calc(100% - 20px);
    }

    .pwa-update-banner .pwa-banner-content {
        flex-wrap: wrap;
    }

    .pwa-update-banner .pwa-banner-actions {
        width: 100%;
        margin-top: 10px;
    }

    .pwa-update-banner .btn {
        flex: 1;
    }
}

/* ========================================
   Dark Mode Support
   ======================================== */
[data-theme="dark"] .pwa-banner-actions .btn-primary {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .pwa-features .badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: white !important;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .pwa-install-banner,
    .pwa-update-banner {
        display: none !important;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */
.pwa-banner-close:focus,
.pwa-banner-actions .btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-banner,
    .pwa-update-banner {
        transition: opacity 0.2s, transform 0.2s;
    }

    .pwa-banner-icon-large {
        animation: none;
    }

    .pwa-install-banner::before {
        animation: none;
    }
}