/**
 * The Social Club .Community — PWA & Notification Styling
 * Cyberpunk / Tactical Dark Aesthetic
 */

:root {
    --pwa-primary: #00d4ff;
    --pwa-primary-glow: rgba(0, 212, 255, 0.4);
    --pwa-accent: #9d4edd;
    --pwa-success: #00ff9d;
    --pwa-warning: #ffb703;
    --pwa-bg-glass: rgba(10, 14, 24, 0.92);
    --pwa-border-glass: rgba(0, 212, 255, 0.25);
}

/* ==========================================================================
   1. INSTALL BUTTON (HEADER & DESKTOP NAVBAR)
   ========================================================================== */
.btn-pwa-install {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15), rgba(157, 78, 221, 0.2));
    border: 1px solid var(--pwa-primary);
    border-radius: 999px;
    color: #ffffff;
    font-family: 'Space Grotesk', 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 0 16px var(--pwa-primary-glow);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    user-select: none;
    z-index: 10;
}

.btn-pwa-install:hover {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.3), rgba(157, 78, 221, 0.4));
    box-shadow: 0 0 24px rgba(0, 212, 255, 0.7);
    transform: translateY(-1px) scale(1.02);
    color: #00ffff;
}

.btn-pwa-install:active {
    transform: translateY(1px) scale(0.98);
}

.btn-pwa-install .pwa-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: inline-block;
    flex-shrink: 0;
    animation: pwaBounce 2.5s infinite ease-in-out;
}

@keyframes pwaBounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-1.5px); }
}

/* ==========================================================================
   2. NOTIFICATION BELL TOGGLE & BADGE
   ========================================================================== */
.btn-pwa-notif {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    flex: 0 0 38px !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: rgba(14, 18, 30, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    color: #e2e8f0 !important;
    cursor: pointer !important;
    position: relative !important;
    transition: all 0.25s ease !important;
    overflow: visible !important;
}

.btn-pwa-notif svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    display: block !important;
    margin: auto !important;
    flex-shrink: 0 !important;
}

.btn-pwa-notif:hover {
    border-color: var(--pwa-primary);
    color: var(--pwa-primary);
    box-shadow: 0 0 14px var(--pwa-primary-glow);
}

.btn-pwa-notif.active {
    border-color: var(--pwa-success);
    color: var(--pwa-success);
    box-shadow: 0 0 14px rgba(0, 255, 157, 0.35);
}

.btn-pwa-notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    background: #ff0055;
    border: 2px solid #06080e;
    border-radius: 50%;
    animation: pwaPulse 1.8s infinite;
}

@keyframes pwaPulse {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

/* ==========================================================================
   3. FLOATING APP INSTALL BANNER (SMART PROMPT)
   ========================================================================== */
.pwa-floating-banner {
    position: fixed;
    bottom: 84px;
    right: 20px;
    max-width: 380px;
    width: calc(100% - 40px);
    background: var(--pwa-bg-glass);
    border: 1px solid var(--pwa-border-glass);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 24px rgba(0, 212, 255, 0.2);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateY(120%);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-floating-banner.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-banner-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
    object-fit: cover;
    background: #06080e;
}

.pwa-banner-info {
    flex: 1;
}

.pwa-banner-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-banner-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    margin: 2px 0 0 0;
    line-height: 1.3;
}

.pwa-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.pwa-banner-btn-install {
    flex: 1;
    padding: 9px 16px;
    background: linear-gradient(135deg, #00d4ff, #0099ff);
    color: #050811;
    border: none;
    border-radius: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 212, 255, 0.4);
    transition: all 0.2s ease;
}

.pwa-banner-btn-install:hover {
    background: linear-gradient(135deg, #33ddff, #1aa3ff);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.6);
}

.pwa-banner-btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-banner-btn-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* ==========================================================================
   4. IN-APP EVENT UPDATE TOAST (REALTIME ALERT)
   ========================================================================== */
.pwa-event-toast {
    position: fixed;
    top: 24px;
    right: 24px;
    max-width: 400px;
    width: calc(100% - 48px);
    background: rgba(10, 14, 26, 0.95);
    border: 1px solid var(--pwa-primary);
    border-left: 4px solid var(--pwa-primary);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 20px var(--pwa-primary-glow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-event-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.pwa-event-toast.event-new {
    border-left-color: #00ff9d;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 157, 0.3);
}

.pwa-event-toast.event-changed {
    border-left-color: #ffb703;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 183, 3, 0.3);
}

.pwa-toast-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 2px;
}

.pwa-toast-body {
    flex: 1;
}

.pwa-toast-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
}

.pwa-toast-text {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin: 0 0 8px 0;
    line-height: 1.4;
    white-space: pre-line;
}

.pwa-toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-toast-btn-action {
    display: inline-block;
    padding: 5px 12px;
    background: var(--pwa-primary);
    color: #06080e;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: opacity 0.2s;
}

.pwa-toast-btn-action:hover {
    opacity: 0.88;
}

.pwa-toast-btn-dismiss {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 5px 8px;
}

.pwa-toast-btn-dismiss:hover {
    color: #ffffff;
}

/* ==========================================================================
   5. IOS SAFARI "ADD TO HOMESCREEN" MODAL
   ========================================================================== */
.pwa-ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.pwa-ios-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.pwa-ios-modal {
    background: #0d121f;
    border: 1px solid var(--pwa-primary);
    border-radius: 20px;
    max-width: 420px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px var(--pwa-primary-glow);
    text-align: center;
    position: relative;
    transform: scale(0.92);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-ios-modal-overlay.open .pwa-ios-modal {
    transform: scale(1);
}

.pwa-ios-icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin: 0 auto 16px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.35);
    display: block;
}

.pwa-ios-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
}

.pwa-ios-desc {
    font-size: 0.85rem;
    color: #94a3b8;
    margin: 0 0 20px;
    line-height: 1.4;
}

.pwa-ios-steps {
    text-align: left;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #e2e8f0;
}

.pwa-ios-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid var(--pwa-primary);
    color: var(--pwa-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}

.pwa-ios-btn-close {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #00d4ff, #0088ff);
    color: #06080e;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.35);
}

/* ==========================================================================
   6. RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
    .pwa-floating-banner {
        bottom: 78px;
        right: 12px;
        width: calc(100% - 24px);
    }
    .pwa-event-toast {
        top: 12px;
        right: 12px;
        width: calc(100% - 24px);
    }
}

/* Standalone PWA Mode: Completely suppress promo banners and install buttons */
@media all and (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui) {
    #pwaFloatingBanner,
    .pwa-floating-banner,
    #pwaIosModalOverlay,
    .pwa-ios-modal-overlay,
    #btnNavPwaInstall,
    .btn-pwa-install,
    #drawerPwaInstall {
        display: none !important;
    }
}
.pwa-standalone #pwaFloatingBanner,
.pwa-standalone .pwa-floating-banner,
.pwa-standalone #pwaIosModalOverlay,
.pwa-standalone .pwa-ios-modal-overlay,
.pwa-standalone #btnNavPwaInstall,
.pwa-standalone .btn-pwa-install,
.pwa-standalone #drawerPwaInstall {
    display: none !important;
}
