/* ==========================================================================
   PROGNOZ TELEGRAM MINI APP - MINIMALIST PREMIUM DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-base: #0B0F19;
    --bg-surface: rgba(15, 23, 42, 0.35);
    --bg-surface-hover: rgba(24, 34, 58, 0.48);
    --bg-surface-active: rgba(30, 44, 74, 0.58);
    --bg-card-inner: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.14);
    --border-focus: rgba(255, 255, 255, 0.32);
    --card-shadow: rgba(0, 0, 0, 0.35);

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #94A3B8;

    --accent-blue: #38BDF8;
    --accent-indigo: #6366F1;
    --accent-amber: #FBBF24;
    --accent-emerald: #34D399;
    --accent-rose: #FB7185;

    --glow-color-1: rgba(56, 189, 248, 0.22);
    --glow-color-2: rgba(99, 102, 241, 0.18);
    --glow-color-3: rgba(14, 165, 233, 0.15);
    --ambient-grad: none;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;

    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Telegram theme variables fallback and integration */
body.telegram-theme {
    background-color: var(--tg-theme-bg-color, var(--bg-base));
    color: var(--tg-theme-text-color, var(--text-primary));
}

/* Light theme support */
body.theme-light {
    --bg-base: #F1F5F9;
    --bg-surface: rgba(255, 255, 255, 0.52);
    --bg-surface-hover: rgba(255, 255, 255, 0.68);
    --bg-surface-active: rgba(255, 255, 255, 0.82);
    --bg-card-inner: rgba(255, 255, 255, 0.45);
    --border-subtle: rgba(255, 255, 255, 0.85);
    --border-focus: rgba(0, 0, 0, 0.14);

    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;

    --glow-color-1: rgba(56, 189, 248, 0.2);
    --glow-color-2: rgba(245, 158, 11, 0.15);
    --card-shadow: rgba(71, 85, 105, 0.20);
}

/* ==========================================================================
   SEASONAL COLOR SYSTEMS & PALETTES (Осень, Зима, Весна, Лето)
   ========================================================================== */

/* 1. AUTUMN (Осень) - Warm Amber, Copper, Golden Foliage */
body.season-autumn {
    --bg-base: #140D0A;
    --glow-color-1: rgba(234, 88, 12, 0.35);
    --glow-color-2: rgba(217, 119, 6, 0.28);
    --glow-color-3: rgba(180, 83, 9, 0.25);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(234, 88, 12, 0.25) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(180, 83, 9, 0.25) 0%, transparent 60%);
}

body.theme-light.season-autumn {
    --bg-base: #FBF6EE;
    --glow-color-1: rgba(249, 115, 22, 0.25);
    --glow-color-2: rgba(245, 158, 11, 0.26);
    --glow-color-3: rgba(217, 119, 6, 0.20);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(254, 215, 170, 0.55) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(253, 230, 138, 0.50) 0%, transparent 60%);
}

/* 2. WINTER (Зима) - Crisp Frost, Cool Cyan, Deep Indigo */
body.season-winter {
    --bg-base: #080D1A;
    --glow-color-1: rgba(56, 189, 248, 0.32);
    --glow-color-2: rgba(99, 102, 241, 0.28);
    --glow-color-3: rgba(14, 165, 233, 0.25);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.22) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(99, 102, 241, 0.22) 0%, transparent 60%);
}

body.theme-light.season-winter {
    --bg-base: #EFF6FC;
    --glow-color-1: rgba(56, 189, 248, 0.28);
    --glow-color-2: rgba(186, 230, 253, 0.45);
    --glow-color-3: rgba(165, 180, 252, 0.25);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(186, 230, 253, 0.55) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(199, 210, 254, 0.50) 0%, transparent 60%);
}

/* 3. SPRING (Весна) - Sakura Pink, Fresh Emerald, Dawn Violet */
body.season-spring {
    --bg-base: #0B130E;
    --glow-color-1: rgba(244, 114, 182, 0.30);
    --glow-color-2: rgba(52, 211, 153, 0.28);
    --glow-color-3: rgba(167, 139, 250, 0.22);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(244, 114, 182, 0.22) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(52, 211, 153, 0.22) 0%, transparent 60%);
}

body.theme-light.season-spring {
    --bg-base: #F8F5F7;
    --glow-color-1: rgba(244, 114, 182, 0.26);
    --glow-color-2: rgba(110, 231, 183, 0.30);
    --glow-color-3: rgba(196, 181, 253, 0.22);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(251, 207, 232, 0.55) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(167, 243, 208, 0.50) 0%, transparent 60%);
}

/* 4. SUMMER (Лето) - Radiant Sun Gold, Tropical Azure Sky */
body.season-summer {
    --bg-base: #06111C;
    --glow-color-1: rgba(251, 191, 36, 0.32);
    --glow-color-2: rgba(14, 165, 233, 0.28);
    --glow-color-3: rgba(16, 185, 129, 0.22);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(251, 191, 36, 0.22) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.24) 0%, transparent 60%);
}

body.theme-light.season-summer {
    --bg-base: #F2F8FC;
    --glow-color-1: rgba(252, 211, 77, 0.35);
    --glow-color-2: rgba(125, 211, 252, 0.38);
    --glow-color-3: rgba(110, 231, 183, 0.25);
    --ambient-grad: radial-gradient(circle at 15% 15%, rgba(254, 240, 138, 0.55) 0%, transparent 55%),
                    radial-gradient(circle at 85% 75%, rgba(186, 230, 253, 0.55) 0%, transparent 60%);
}

/* ==========================================================================
   WEATHER ADAPTIVE OVERLAYS
   ========================================================================== */

body.theme-rain {
    --glow-color-1: rgba(14, 165, 233, 0.35);
    --glow-color-2: rgba(71, 85, 105, 0.40);
}

body.theme-storm {
    --glow-color-1: rgba(147, 51, 234, 0.42);
    --glow-color-2: rgba(245, 158, 11, 0.28);
    --glow-color-3: rgba(59, 130, 246, 0.35);
}

body.theme-snow {
    --glow-color-1: rgba(224, 242, 254, 0.40);
    --glow-color-2: rgba(56, 189, 248, 0.30);
    --glow-color-3: rgba(199, 210, 254, 0.30);
}

body.theme-sunny {
    --glow-color-1: rgba(245, 158, 11, 0.35);
    --glow-color-2: rgba(56, 189, 248, 0.24);
}

body.theme-fair {
    --glow-color-1: rgba(56, 189, 248, 0.26);
    --glow-color-2: rgba(99, 102, 241, 0.20);
}

body.theme-cloudy {
    --glow-color-1: rgba(148, 163, 184, 0.25);
    --glow-color-2: rgba(71, 85, 105, 0.30);
}

body.theme-fog {
    --glow-color-1: rgba(148, 163, 184, 0.35);
    --glow-color-2: rgba(100, 116, 139, 0.30);
    --glow-color-3: rgba(203, 213, 225, 0.25);
}

body.theme-night {
    --glow-color-1: rgba(99, 102, 241, 0.30);
    --glow-color-2: rgba(49, 46, 129, 0.50);
    --glow-color-3: rgba(15, 23, 42, 0.55);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    transition: background-color 0.8s ease, color 0.3s ease;
}

/* ==========================================================================
   AMBIENT SCENIC BACKGROUND ARTWORK & WEATHER EFFECTS
   ========================================================================== */

.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    transition: background 0.8s ease;
}

/* Scenic Full-Screen Background Art Layer */
.ambient-image-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    transition: opacity 0.8s ease, background-image 0.8s ease;
    opacity: 0.88;
    filter: saturate(120%) contrast(105%);
}

/* Season scenic background artwork mapping */
body.season-autumn .ambient-image-layer {
    background-image: url('../images/backgrounds/autumn.jpg');
}

body.season-winter .ambient-image-layer {
    background-image: url('../images/backgrounds/winter.jpg');
}

body.season-spring .ambient-image-layer {
    background-image: url('../images/backgrounds/spring.jpg');
}

body.season-summer .ambient-image-layer {
    background-image: url('../images/backgrounds/summer.jpg');
}

/* Atmospheric weather and night tone adjustments over seasonal scenery */
body.theme-rain .ambient-image-layer {
    filter: saturate(85%) brightness(0.82) contrast(115%);
    opacity: 0.88;
}

body.theme-storm .ambient-image-layer {
    filter: saturate(75%) brightness(0.68) contrast(125%);
    opacity: 0.90;
}

body.theme-night .ambient-image-layer {
    filter: saturate(105%) brightness(0.70) contrast(115%);
    opacity: 0.88;
}

body.theme-light .ambient-image-layer {
    opacity: 0.72;
    filter: saturate(120%) contrast(100%) brightness(1.02);
}

/* Darkening and Lighting Gradient Overlays for Readability */
.ambient-gradient-layer {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 12, 22, 0.18) 0%, rgba(8, 12, 22, 0.50) 100%);
    transition: background 0.8s ease;
    pointer-events: none;
}

body.theme-light .ambient-gradient-layer {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.38) 100%);
}

.ambient-lighting-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.45;
    background: var(--ambient-grad, none);
    transition: background 0.8s ease;
}

/* Dynamic Weather Special Effects */
.ambient-weather-fx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
}

/* Storm Lightning Flash Effect */
.fx-lightning {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    animation: stormSkyFlash 6s infinite ease-out;
}

@keyframes stormSkyFlash {
    0%, 91%, 95%, 100% { background: rgba(255, 255, 255, 0); }
    92% { background: rgba(220, 230, 255, 0.35); }
    93% { background: rgba(255, 255, 255, 0.68); }
    94% { background: rgba(180, 200, 255, 0.22); }
}

/* Sunbeam Lens Flare Glare Effect */
.fx-sunbeam {
    position: absolute;
    top: -100px;
    right: -50px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 220, 100, 0.38) 0%, rgba(255, 180, 50, 0.16) 45%, transparent 70%);
    filter: blur(28px);
    pointer-events: none;
    animation: sunbeamPulse 8s ease-in-out infinite alternate;
}

@keyframes sunbeamPulse {
    0% { transform: scale(0.9) rotate(0deg); opacity: 0.6; }
    100% { transform: scale(1.15) rotate(15deg); opacity: 0.95; }
}

/* Rain Cascading Streaks Layer */
.fx-rain-layer {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        105deg,
        transparent,
        transparent 15px,
        rgba(255, 255, 255, 0.08) 16px,
        transparent 17px
    );
    pointer-events: none;
    animation: rainSlide 0.6s linear infinite;
    opacity: 0.75;
}

@keyframes rainSlide {
    0% { transform: translateY(-50px) translateX(15px); }
    100% { transform: translateY(50px) translateX(-15px); }
}

/* Night Aurora Borealis Glow & Shooting Star */
.fx-night-aurora {
    position: absolute;
    top: 5%;
    left: -20%;
    right: -20%;
    height: 40%;
    background: linear-gradient(120deg, transparent 20%, rgba(52, 211, 153, 0.22) 50%, rgba(167, 139, 250, 0.20) 70%, transparent 90%);
    filter: blur(40px);
    pointer-events: none;
    animation: auroraWave 14s ease-in-out infinite alternate;
}

@keyframes auroraWave {
    0% { transform: translateY(0) skewX(-5deg); opacity: 0.45; }
    100% { transform: translateY(30px) skewX(8deg); opacity: 0.85; }
}

.fx-shooting-star {
    position: absolute;
    top: 15%;
    right: 20%;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95), transparent);
    transform: rotate(-35deg);
    animation: shootingStar 9s linear infinite;
    opacity: 0;
}

@keyframes shootingStar {
    0%, 80%, 100% { opacity: 0; transform: translate(0, 0) rotate(-35deg); }
    82% { opacity: 1; transform: translate(-180px, 120px) rotate(-35deg); }
    85% { opacity: 0; transform: translate(-300px, 200px) rotate(-35deg); }
}

/* Glowing Atmospheric Blobs */
.ambient-blob-1 {
    position: absolute;
    top: -10%;
    left: 10%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color-1) 0%, transparent 70%);
    filter: blur(85px);
    transition: background 0.8s ease;
    animation: floatBlob1 18s ease-in-out infinite alternate;
}

.ambient-blob-2 {
    position: absolute;
    top: 35%;
    right: -10%;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color-2) 0%, transparent 70%);
    filter: blur(90px);
    transition: background 0.8s ease;
    animation: floatBlob2 22s ease-in-out infinite alternate;
}

.ambient-blob-3 {
    position: absolute;
    bottom: -10%;
    left: 15%;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color-3, var(--glow-color-1)) 0%, transparent 70%);
    filter: blur(85px);
    transition: background 0.8s ease;
    animation: floatBlob3 20s ease-in-out infinite alternate;
}

@keyframes floatBlob1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 60px) scale(1.1); }
}

@keyframes floatBlob2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, -40px) scale(1.08); }
}

@keyframes floatBlob3 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(35px, -45px) scale(1.12); }
}

/* Ambient Seasonal & Weather Particles */
.ambient-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.ambient-particle {
    position: absolute;
    top: -40px;
    user-select: none;
    pointer-events: none;
    will-change: transform, opacity;
}

/* 1. Autumn Leaf Fall */
@keyframes leafFall {
    0% {
        transform: translate3d(0, -40px, 0) rotate(0deg) rotateY(0deg);
    }
    25% {
        transform: translate3d(35px, 25vh, 0) rotate(85deg) rotateY(180deg);
    }
    50% {
        transform: translate3d(-30px, 50vh, 0) rotate(190deg) rotateY(360deg);
    }
    75% {
        transform: translate3d(40px, 75vh, 0) rotate(290deg) rotateY(180deg);
    }
    100% {
        transform: translate3d(8px, 105vh, 0) rotate(360deg) rotateY(0deg);
    }
}
.ambient-particle.leaf-fall {
    animation-name: leafFall;
    animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);
    animation-iteration-count: infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* 2. Spring Blossom Petal Fall */
@keyframes petalFall {
    0% {
        transform: translate3d(0, -40px, 0) rotate(0deg);
    }
    30% {
        transform: translate3d(45px, 30vh, 0) rotate(60deg);
    }
    60% {
        transform: translate3d(20px, 65vh, 0) rotate(140deg);
    }
    100% {
        transform: translate3d(55px, 105vh, 0) rotate(220deg);
    }
}
.ambient-particle.petal-fall {
    animation-name: petalFall;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    filter: drop-shadow(0 2px 4px rgba(244, 114, 182, 0.3));
}

/* 3. Winter Snow Fall */
@keyframes snowFall {
    0% {
        transform: translate3d(0, -40px, 0);
    }
    50% {
        transform: translate3d(20px, 50vh, 0);
    }
    100% {
        transform: translate3d(-15px, 105vh, 0);
    }
}
.ambient-particle.snow-fall {
    animation-name: snowFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
}

/* 4. Rain Fall */
@keyframes rainFall {
    0% {
        transform: translate3d(0, -50px, 0);
        opacity: 0.1;
    }
    40% {
        opacity: 0.8;
    }
    100% {
        transform: translate3d(-25px, 105vh, 0);
        opacity: 0.2;
    }
}
.ambient-particle.rain-fall {
    animation-name: rainFall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    color: #38BDF8;
    font-weight: 700;
}

/* 5. Summer Shimmer */
@keyframes summerShimmer {
    0% {
        transform: translate3d(0, 0, 0) scale(0.8);
        opacity: 0.2;
    }
    50% {
        transform: translate3d(20px, -35px, 0) scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: translate3d(-15px, -70px, 0) scale(0.8);
        opacity: 0.2;
    }
}
.ambient-particle.summer-shimmer {
    animation-name: summerShimmer;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
}

/* App container */
.app-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom)) 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 10;
}

/* Glassmorphism Card Primitives */
.card {
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(190%);
    -webkit-backdrop-filter: blur(20px) saturate(190%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px -10px var(--card-shadow), 0 0 0 1px rgba(255, 255, 255, 0.08);
    padding: 18px 20px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

body.theme-light .card {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 16px 40px -10px rgba(100, 116, 139, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.card:hover {
    border-color: var(--border-focus);
}

/* Top App Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0 2px 0;
    gap: 8px;
}

.location-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 8px 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-width: 0;
    flex: 1;
}

body.theme-light .location-chip {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 16px -4px rgba(100, 116, 139, 0.14);
}

.location-chip:active {
    transform: scale(0.97);
    background: var(--bg-surface-active);
}

.location-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.location-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.location-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-size: 15px;
    flex-shrink: 0;
}

body.theme-light .icon-button {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 16px -4px rgba(100, 116, 139, 0.14);
}

.icon-button:active {
    transform: scale(0.92);
    background: var(--bg-surface-active);
}

.icon-button.season-button {
    font-size: 16px;
}

.icon-button.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Day Selector Segmented Control */
.day-selector-container {
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0;
}

.day-selector-container::-webkit-scrollbar {
    display: none;
}

.day-selector {
    display: flex;
    background: var(--bg-surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px;
    gap: 4px;
    min-width: 100%;
}

body.theme-light .day-selector {
    background: rgba(255, 255, 255, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 18px -4px rgba(100, 116, 139, 0.12);
}

.day-tab {
    flex: 1;
    text-align: center;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    border: none;
    background: transparent;
}

.day-tab:hover {
    color: var(--text-primary);
}

.day-tab.active {
    background: var(--text-primary);
    color: var(--bg-base);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.theme-light .day-tab.active {
    background: #0F172A;
    color: #FFFFFF;
}

/* Hero Weather Card */
.hero-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 20px 20px 20px;
    gap: 14px;
}

.hero-top-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-badge {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-transform: capitalize;
}

.condition-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card-inner);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

body.theme-light .condition-pill {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.hero-visual {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0 0 0;
    position: relative;
}

.hero-visual .weather-icon-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}

.hero-temp-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.hero-temp {
    font-size: 68px;
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--text-primary);
}

.hero-feels-like {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
}

.hero-min-max-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card-inner);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    margin-top: 4px;
}

body.theme-light .hero-min-max-bar {
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.85);
}

.hero-min-max-bar span.accent {
    color: var(--accent-blue);
}

/* Quick Metrics Row in Hero */
.hero-quick-metrics {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 14px;
}

.quick-metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.quick-metric-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.quick-metric-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Hourly Forecast Timeline Carousel */
.hourly-nav-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hourly-nav-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-smooth);
    user-select: none;
}

.hourly-nav-btn:hover {
    background: var(--bg-surface-active);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.hourly-nav-btn:active {
    transform: scale(0.92);
}

.hourly-scroll-wrapper {
    position: relative;
    width: 100%;
}

.hourly-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 2px 8px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.hourly-scroll.grabbing {
    cursor: grabbing;
    user-select: none;
}

.hourly-scroll::-webkit-scrollbar {
    display: none;
}

.hourly-day-separator {
    flex: 0 0 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed var(--border-focus);
    user-select: none;
}

.hourly-day-separator.today {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.4);
}

.hourly-day-separator .sep-day {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hourly-day-separator.today .sep-day {
    color: var(--accent-blue);
}

.hourly-day-separator .sep-date {
    font-size: 10px;
    color: var(--text-muted);
}

.hour-card {
    flex: 0 0 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px 12px 4px;
    background: var(--bg-card-inner);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    user-select: none;
    position: relative;
}

body.theme-light .hour-card {
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.80);
}

.hour-card.current {
    background: rgba(56, 189, 248, 0.14);
    border-color: var(--accent-blue);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
}

.hour-card.target-day:not(.current) {
    border-color: rgba(255, 255, 255, 0.18);
}

.hour-day-sub {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
}

.hour-card.current .hour-day-sub {
    color: var(--accent-blue);
    font-weight: 700;
}

.hour-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
}

.hour-card.current .hour-time {
    color: #FFFFFF;
}

.hour-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hour-temp {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.hour-precip-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* Day Periods Breakdown (Night, Morning, Day, Evening) */
.periods-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.period-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 6px;
    background: var(--bg-card-inner);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    gap: 6px;
    transition: var(--transition-smooth);
}

body.theme-light .period-card {
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.80);
}

.period-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.period-icon {
    width: 30px;
    height: 30px;
}

.period-temp {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.period-wind {
    font-size: 10px;
    color: var(--text-secondary);
}

/* Detailed Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.metric-card {
    background: var(--bg-surface);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: var(--transition-smooth);
}

body.theme-light .metric-card {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.80);
    box-shadow: 0 4px 18px -4px rgba(100, 116, 139, 0.12);
}

.metric-card:hover {
    border-color: var(--border-focus);
}

.metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.metric-value-main {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.1;
}

.metric-value-unit {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.metric-subtext {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Compass Needle Widget */
.compass-widget {
    display: flex;
    align-items: center;
    gap: 12px;
}

.compass-dial {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.compass-needle {
    width: 20px;
    height: 20px;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Meter / Progress Bar */
.metric-meter {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.metric-meter-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-indigo));
    transition: width 0.6s ease;
}

/* Daylight Arc Visual */
.sun-cycle-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sun-times-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.sun-time-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sun-time-block.right {
    align-items: flex-end;
}

.sun-time-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

/* 7-Day Extended Forecast */
.forecast-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.forecast-row {
    display: grid;
    grid-template-columns: 85px 40px 1fr 90px;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-card-inner);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    gap: 8px;
    transition: var(--transition-smooth);
}

body.theme-light .forecast-row {
    background: rgba(255, 255, 255, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.80);
}

.forecast-day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.forecast-date-small {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
}

.forecast-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.forecast-desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.forecast-temp-range {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.temp-min-text {
    color: var(--text-muted);
    font-weight: 400;
}

.temp-max-text {
    color: var(--text-primary);
}


/* Search Modal / Overlay */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.search-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.search-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--bg-base);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.search-modal.open .search-sheet {
    transform: translateY(0);
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-focus);
    border-radius: var(--radius-full);
    padding: 10px 16px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-close-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}

.search-chips-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 4px;
}

.search-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-chip:active, .search-chip:hover {
    background: var(--bg-surface-active);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 40vh;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-result-item:hover, .search-result-item:active {
    background: var(--bg-surface-hover);
    border-color: var(--accent-blue);
}

.search-result-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-result-region {
    font-size: 12px;
    color: var(--text-muted);
}

/* Toast notification */
.toast-notice {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-focus);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-notice.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Skeleton Loading State */
.skeleton {
    animation: skeletonPulse 1.6s ease-in-out infinite;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
}

@keyframes skeletonPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Micro-animations for SVGs */
.icon-clear-day .sun-rays {
    transform-origin: 32px 32px;
    animation: spinRays 36s linear infinite;
}

.icon-clear-day .sun-glow {
    transform-origin: 32px 32px;
    animation: pulseGlow 4s ease-in-out infinite alternate;
}

@keyframes spinRays {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0% { transform: scale(0.92); opacity: 0.15; }
    100% { transform: scale(1.08); opacity: 0.35; }
}

.icon-clear-night .star-1 { animation: twinkle 3s ease-in-out infinite 0.2s; }
.icon-clear-night .star-2 { animation: twinkle 2.5s ease-in-out infinite 0.8s; }
.icon-clear-night .star-3 { animation: twinkle 3.2s ease-in-out infinite 1.4s; }
.icon-clear-night .star-4 { animation: twinkle 2.8s ease-in-out infinite 0.5s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.cloud-front, .cloud-main, .cloud-rain-body, .cloud-snow-body, .cloud-heavy-body {
    animation: cloudSway 6s ease-in-out infinite alternate;
}

@keyframes cloudSway {
    0% { transform: translateX(0); }
    100% { transform: translateX(2px); }
}

.rain-drops .drop-1 { animation: rainDrop 1.2s linear infinite 0.0s; }
.rain-drops .drop-2 { animation: rainDrop 1.2s linear infinite 0.4s; }
.rain-drops .drop-3 { animation: rainDrop 1.2s linear infinite 0.8s; }

.rain-drops-heavy .drop-1 { animation: rainDrop 0.8s linear infinite 0.0s; }
.rain-drops-heavy .drop-2 { animation: rainDrop 0.8s linear infinite 0.2s; }
.rain-drops-heavy .drop-3 { animation: rainDrop 0.8s linear infinite 0.4s; }
.rain-drops-heavy .drop-4 { animation: rainDrop 0.8s linear infinite 0.1s; }
.rain-drops-heavy .drop-5 { animation: rainDrop 0.8s linear infinite 0.3s; }

@keyframes rainDrop {
    0% { transform: translateY(-4px); opacity: 0; }
    30% { opacity: 1; }
    100% { transform: translateY(8px); opacity: 0; }
}

.snow-flakes .flake-1 { animation: snowDrift 2.2s ease-in-out infinite 0s alternate; }
.snow-flakes .flake-2 { animation: snowDrift 2.5s ease-in-out infinite 0.6s alternate; }
.snow-flakes .flake-3 { animation: snowDrift 2.0s ease-in-out infinite 1.2s alternate; }

@keyframes snowDrift {
    0% { transform: translateY(0) translateX(-1px); opacity: 0.6; }
    100% { transform: translateY(4px) translateX(2px); opacity: 1; }
}

.lightning-bolt {
    animation: lightningFlash 4s ease-in-out infinite;
}

@keyframes lightningFlash {
    0%, 92%, 100% { opacity: 0; }
    93%, 95% { opacity: 1; }
    94% { opacity: 0.2; }
}
