:root {
    --gold: #D4AF37;
    --white-glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
}

body {
    user-select: none;
    font-family: 'Inter', sans-serif;
    background: #121212;
    color: #333;
    min-height: 100vh;
    overflow-x: hidden;
}

.serif { font-family: 'Playfair Display', serif; }

.glass-card {
    background: var(--white-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

.bg-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
    background-size: cover; background-position: center;
    transition: all 1.2s ease-in-out;
    background-color: #1a1a1a;
}

.bg-tint {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.2) 100%);
    pointer-events: none;
}

/* Visual Themes based on conditions */
.bg-clear { background-image: url('https://images.unsplash.com/photo-1504608524841-42fe6f032b4b?auto=format&fit=crop&w=1920&q=80'); }
.bg-clouds { background-image: url('https://images.unsplash.com/photo-1483702721041-b23de737a886?auto=format&fit=crop&w=1920&q=80'); }
.bg-rain { background-image: url('https://images.unsplash.com/photo-1534274988757-a28bf1a57c17?auto=format&fit=crop&w=1920&q=80'); }
.bg-snow { background-image: url('https://images.unsplash.com/photo-1491002052546-bf38f186af56?auto=format&fit=crop&w=1920&q=80'); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: fadeIn 0.6s ease-out forwards; }

.forecast-scroll::-webkit-scrollbar { height: 4px; }
.forecast-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

/* Hourly Forecast */
#hourlyContainer {
    scrollbar-width: thin;
    scrollbar-color: var(--gold) transparent;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}
#hourlyContainer::-webkit-scrollbar { height: 6px; }
#hourlyContainer::-webkit-scrollbar-track { background: transparent; }
#hourlyContainer::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

/* Weekly Forecast */
#weeklyContainer .glass-card {
    transition: all 0.3s ease;
}
#weeklyContainer .glass-card:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 32px 0 rgba(212, 175, 55, 0.15);
}

/* ===== PWA STYLES ===== */

/* Splash screen animation for standalone mode */
.web-app-capable,
[style*="max-width: 100vw"] {
    animation: splash 0.5s ease-out;
}

@keyframes splash {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* Offline indicator */
@media (not offline) {
    body {
        --online-glow: 0 0 0 transparent;
    }
}

@media (offline) {
    body {
        --online-glow: 0 0 20px rgba(212, 175, 55, 0.5);
    }

    .offline-indicator {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 12px;
        border: 1px solid var(--gold);
        box-shadow: var(--online-glow);
        color: var(--gold);
        font-size: 12px;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.2em;
        position: fixed;
        bottom: 1rem;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1000;
        text-align: center;
    }

    .offline-indicator::before {
        content: "❮";
        font-size: 14px;
        animation: pulse 2s infinite;
    }

    @keyframes pulse {
        0%, 100% { transform: scale(1); }
        50% { transform: scale(1.2); }
    }
}

/* Loading shimmer for PWA */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading-shimmer {
    animation: shimmer 2s linear infinite;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(212, 175, 55, 0.1) 50%,
        transparent 100%);
    background-size: 200% 100%;
}

/* Standalone web app styles */
[standalone] body {
    margin: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
                env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Hiding scrollbar in PWA for cleaner look */
.hide-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}

/* PWA notification style */
.pwa-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid var(--gold);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    text-align: center;
    min-width: 280px;
    font-size: 14px;
    line-height: 1.5;
}

.pwa-notification::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: var(--gold);
    clip-path: polygon(100% 0, 0 50%, 100% 100%);
}

/* Loading spinner for PWA */
.pwa-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s linear infinite;
}

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

/* Update available notification */
.update-available {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(212, 175, 55, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: var(--gold);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-available:hover {
    background: rgba(212, 175, 55, 0.25);
}
