/* ===== CSS Variables ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --card-bg: rgba(255, 255, 255, 0.08);
    --card-border: rgba(255, 255, 255, 0.12);
    --card-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
    --accent-yellow: #ffeaa7;
    --accent-orange: #fdcb6e;
    --accent-blue: #74b9ff;
    --accent-cyan: #81ecec;
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.3);
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-spinner {
    position: relative;
    width: 100px;
    height: 100px;
}

.spinner-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #ffeaa7;
    animation-delay: 0s;
}

.spinner-ring:nth-child(2) {
    border-right-color: #74b9ff;
    animation-delay: 0.2s;
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
}

.spinner-ring:nth-child(3) {
    border-bottom-color: #81ecec;
    animation-delay: 0.4s;
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    color: #ffeaa7;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.loading-text {
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ===== Reset & Base ===== */
.daylyaz-weather-page *,
.daylyaz-weather-page *::before,
.daylyaz-weather-page *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body.daylyaz-weather-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 1s ease;
    margin: 0;
    padding: 0;
}

/* ===== Dynamic Weather Backgrounds ===== */

/* Default - Daytime/Clear (blue sky) */
body.daylyaz-weather-page {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #43e97b 100%);
}

/* Sunny/Day - same as default */
body.daylyaz-weather-page.weather-sunny {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #43e97b 100%);
}

/* Night/Clear */
body.daylyaz-weather-page.weather-night {
    background: linear-gradient(135deg, #0c1445 0%, #1a1a2e 30%, #16213e 60%, #0f3460 100%);
}
body.daylyaz-weather-page.weather-sunny .card-bg,
body.daylyaz-weather-page.weather-sunny .current-weather-card,
body.daylyaz-weather-page.weather-sunny .hourly-forecast,
body.daylyaz-weather-page.weather-sunny .weekly-forecast,
body.daylyaz-weather-page.weather-sunny .cities-sidebar {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(25px);
}

/* Sunny weather text contrast fix - darker text for bright background */
body.daylyaz-weather-page.weather-sunny .text-primary,
body.daylyaz-weather-page.weather-sunny h1,
body.daylyaz-weather-page.weather-sunny h3,
body.daylyaz-weather-page.weather-sunny .city-name,
body.daylyaz-weather-page.weather-sunny .section-title,
body.daylyaz-weather-page.weather-sunny .sidebar-title,
body.daylyaz-weather-page.weather-sunny .day-name,
body.daylyaz-weather-page.weather-sunny .hourly-temp,
body.daylyaz-weather-page.weather-sunny .detail-value,
body.daylyaz-weather-page.weather-sunny #currentTime {
    color: #1a1a2e;
}

body.daylyaz-weather-page.weather-sunny .text-secondary,
body.daylyaz-weather-page.weather-sunny .location-sub,
body.daylyaz-weather-page.weather-sunny .time-label,
body.daylyaz-weather-page.weather-sunny .detail-label,
body.daylyaz-weather-page.weather-sunny .day-date,
body.daylyaz-weather-page.weather-sunny .condition-text,
body.daylyaz-weather-page.weather-sunny #currentDate {
    color: rgba(26, 26, 46, 0.7);
}

body.daylyaz-weather-page.weather-sunny .text-muted,
body.daylyaz-weather-page.weather-sunny .temp-low,
body.daylyaz-weather-page.weather-sunny .hourly-wind,
body.daylyaz-weather-page.weather-sunny .weekly-wind {
    color: rgba(26, 26, 46, 0.7);
}

/* Sunny weather - add text shadows for better readability against bright sun */
body.daylyaz-weather-page.weather-sunny .city-name,
body.daylyaz-weather-page.weather-sunny .temp-value,
body.daylyaz-weather-page.weather-sunny .detail-value,
body.daylyaz-weather-page.weather-sunny .hourly-temp,
body.daylyaz-weather-page.weather-sunny .temp-high,
body.daylyaz-weather-page.weather-sunny .day-name,
body.daylyaz-weather-page.weather-sunny #currentTime {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

body.daylyaz-weather-page.weather-sunny .detail-label,
body.daylyaz-weather-page.weather-sunny .location-sub,
body.daylyaz-weather-page.weather-sunny .condition-text,
body.daylyaz-weather-page.weather-sunny .time-label,
body.daylyaz-weather-page.weather-sunny .day-date,
body.daylyaz-weather-page.weather-sunny #currentDate {
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* Sunny weather - stronger card backgrounds to contrast with sun glow */
body.daylyaz-weather-page.weather-sunny .detail-item {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.6);
}

body.daylyaz-weather-page.weather-sunny .hourly-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.35) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

body.daylyaz-weather-page.weather-sunny .weekly-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.35) 100%);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Sunny weather - override gradient text for better contrast */
body.daylyaz-weather-page.weather-sunny .location-info .city-name {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #1a1a2e;
    background-clip: unset;
    color: #1a1a2e;
}

body.daylyaz-weather-page.weather-sunny .temp-value {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #0f3460;
    background-clip: unset;
    color: #0f3460;
}

body.daylyaz-weather-page.weather-sunny .nav-tab {
    color: rgba(26, 26, 46, 0.7);
}

body.daylyaz-weather-page.weather-sunny .nav-tab.active,
body.daylyaz-weather-page.weather-sunny .nav-tab:hover {
    color: #1a1a2e;
}

body.daylyaz-weather-page.weather-sunny .header,
body.daylyaz-weather-page.weather-sunny .footer {
    background: rgba(255, 255, 255, 0.3);
}

body.daylyaz-weather-page.weather-sunny .footer {
    color: rgba(26, 26, 46, 0.6);
}

/* Sunny weather - weather badge (Aydın text) */
body.daylyaz-weather-page.weather-sunny .weather-badge {
    background: rgba(26, 26, 46, 0.15);
    border-color: rgba(26, 26, 46, 0.3);
    color: #1a1a2e;
}

/* Sunny weather - temp high in weekly cards */
body.daylyaz-weather-page.weather-sunny .temp-high {
    color: #0f3460;
}

/* Cloudy - Day */
body.daylyaz-weather-page.weather-cloudy {
    background: linear-gradient(135deg, #485563 0%, #29323c 50%, #1e242a 100%);
}

/* Cloudy at Night - Dark background with clouds */
body.daylyaz-weather-page.weather-night.weather-cloudy {
    background: linear-gradient(135deg, #0a0a1a 0%, #121225 30%, #1a1a30 60%, #0d1a2d 100%);
}

/* Show clouds at night when cloudy */
body.daylyaz-weather-page.weather-night.weather-cloudy .clouds {
    opacity: 0.6;
}

body.daylyaz-weather-page.weather-night.weather-cloudy .moon {
    opacity: 0.4;
    filter: blur(2px);
}

/* Rainy */
body.daylyaz-weather-page.weather-rainy {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e3c72 100%);
}

/* Rainy at Night */
body.daylyaz-weather-page.weather-rainy.is-night {
    background: linear-gradient(135deg, #0a1628 0%, #152238 50%, #0a1628 100%);
}

/* Snowy */
body.daylyaz-weather-page.weather-snowy {
    background: linear-gradient(135deg, #a8c0d8 0%, #7a9cc6 50%, #5a7aa8 100%);
}

/* Snowy weather - card backgrounds for better contrast */
body.daylyaz-weather-page.weather-snowy .card-bg,
body.daylyaz-weather-page.weather-snowy .current-weather-card,
body.daylyaz-weather-page.weather-snowy .hourly-forecast,
body.daylyaz-weather-page.weather-snowy .weekly-forecast,
body.daylyaz-weather-page.weather-snowy .cities-sidebar {
    background: rgba(26, 26, 46, 0.25);
    backdrop-filter: blur(25px);
}

/* Snowy weather - primary text */
body.daylyaz-weather-page.weather-snowy .text-primary,
body.daylyaz-weather-page.weather-snowy h1,
body.daylyaz-weather-page.weather-snowy h3,
body.daylyaz-weather-page.weather-snowy .city-name,
body.daylyaz-weather-page.weather-snowy .section-title,
body.daylyaz-weather-page.weather-snowy .sidebar-title,
body.daylyaz-weather-page.weather-snowy .day-name,
body.daylyaz-weather-page.weather-snowy .hourly-temp,
body.daylyaz-weather-page.weather-snowy .detail-value,
body.daylyaz-weather-page.weather-snowy #currentTime {
    color: #ffffff;
}

/* Snowy weather - secondary text */
body.daylyaz-weather-page.weather-snowy .text-secondary,
body.daylyaz-weather-page.weather-snowy .location-sub,
body.daylyaz-weather-page.weather-snowy .time-label,
body.daylyaz-weather-page.weather-snowy .detail-label,
body.daylyaz-weather-page.weather-snowy .day-date,
body.daylyaz-weather-page.weather-snowy .condition-text,
body.daylyaz-weather-page.weather-snowy #currentDate {
    color: rgba(255, 255, 255, 0.8);
}

/* Snowy weather - muted text */
body.daylyaz-weather-page.weather-snowy .text-muted,
body.daylyaz-weather-page.weather-snowy .temp-low,
body.daylyaz-weather-page.weather-snowy .hourly-wind,
body.daylyaz-weather-page.weather-snowy .weekly-wind {
    color: rgba(255, 255, 255, 0.7);
}

/* Snowy weather - override gradient text */
body.daylyaz-weather-page.weather-snowy .location-info .city-name {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #ffffff;
    background-clip: unset;
    color: #ffffff;
}

body.daylyaz-weather-page.weather-snowy .temp-value {
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: #ffffff;
    background-clip: unset;
    color: #ffffff;
}

/* Snowy weather - weather badge */
body.daylyaz-weather-page.weather-snowy .weather-badge {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

/* Snowy weather - temp high */
body.daylyaz-weather-page.weather-snowy .temp-high {
    color: #ffeaa7;
}

/* Snowy weather - card items */
body.daylyaz-weather-page.weather-snowy .detail-item {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

body.daylyaz-weather-page.weather-snowy .hourly-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

body.daylyaz-weather-page.weather-snowy .weekly-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Snowy weather - navigation */
body.daylyaz-weather-page.weather-snowy .nav-tab {
    color: rgba(255, 255, 255, 0.7);
}

body.daylyaz-weather-page.weather-snowy .nav-tab.active,
body.daylyaz-weather-page.weather-snowy .nav-tab:hover {
    color: #ffffff;
}

/* Snowy weather - header and footer */
body.daylyaz-weather-page.weather-snowy .header,
body.daylyaz-weather-page.weather-snowy .footer {
    background: rgba(26, 26, 46, 0.2);
}

body.daylyaz-weather-page.weather-snowy .footer {
    color: rgba(255, 255, 255, 0.7);
}

/* Snowy weather - city items */
body.daylyaz-weather-page.weather-snowy .city-item .city-name {
    color: #ffffff;
}

body.daylyaz-weather-page.weather-snowy .city-item .temp {
    color: #ffeaa7;
}

/* Stormy */
body.daylyaz-weather-page.weather-stormy {
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

/* Lightning effect for storms */
body.daylyaz-weather-page.weather-stormy::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    animation: lightning 4s infinite;
}

@keyframes lightning {
    0%, 89%, 91%, 93%, 100% {
        background: transparent;
    }
    90%, 92% {
        background: rgba(255, 255, 255, 0.15);
    }
}

/* ===== Weather App Container ===== */
.weather-app {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* ===== Animated Background ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

/* Stars - hidden by default, visible at night */
.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 180px 50px, rgba(255,255,255,0.35), transparent),
        radial-gradient(2px 2px at 60px 150px, rgba(255,255,255,0.25), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: twinkle 4s ease-in-out infinite;
    transition: opacity 0.5s ease;
    opacity: 0;
}

/* Show stars at night */
body.daylyaz-weather-page.weather-night .stars,
body.daylyaz-weather-page.is-night .stars {
    opacity: 0.8;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Moon - hidden by default, visible at night */
.moon {
    position: absolute;
    top: 8%;
    right: 12%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 35% 35%, #fff9c4, #ffeaa7 40%, #fdcb6e);
    border-radius: 50%;
    box-shadow:
        0 0 60px rgba(253, 203, 110, 0.5),
        0 0 100px rgba(253, 203, 110, 0.3),
        inset -8px -8px 15px rgba(255,255,255,0.2);
    animation: float 6s ease-in-out infinite;
    transition: opacity 0.5s ease, transform 0.5s ease;
    opacity: 0;
}

/* Show moon at night */
body.daylyaz-weather-page.weather-night .moon,
body.daylyaz-weather-page.is-night .moon {
    opacity: 1;
}

.moon::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 18%;
    width: 20%;
    height: 20%;
    background: rgba(253, 203, 110, 0.4);
    border-radius: 50%;
    filter: blur(2px);
}

.moon::after {
    content: '';
    position: absolute;
    top: 55%;
    left: 55%;
    width: 12%;
    height: 12%;
    background: rgba(253, 203, 110, 0.3);
    border-radius: 50%;
    filter: blur(1px);
}

body.daylyaz-weather-page.weather-sunny .moon {
    opacity: 0;
    transform: translateY(-50px);
}

/* Sun - visible during day by default */
.sun {
    position: absolute;
    top: 8%;
    right: 12%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle at 50% 50%, #fff9c4, #ffeaa7 30%, #fdcb6e 60%, #f39c12 100%);
    border-radius: 50%;
    box-shadow:
        0 0 50px rgba(253, 203, 110, 0.5),
        0 0 80px rgba(243, 156, 18, 0.3),
        0 0 120px rgba(243, 156, 18, 0.15);
    animation: pulse-sun 3s ease-in-out infinite;
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* Show sun during sunny weather */
body.daylyaz-weather-page.weather-sunny .sun {
    opacity: 1;
}

/* Hide sun at night and during bad weather */
body.daylyaz-weather-page.weather-night .sun,
body.daylyaz-weather-page.is-night .sun,
body.daylyaz-weather-page.weather-cloudy .sun,
body.daylyaz-weather-page.weather-rainy .sun,
body.daylyaz-weather-page.weather-snowy .sun,
body.daylyaz-weather-page.weather-stormy .sun {
    opacity: 0;
}

@keyframes pulse-sun {
    0%, 100% { transform: scale(1); box-shadow: 0 0 50px rgba(253, 203, 110, 0.5), 0 0 80px rgba(243, 156, 18, 0.3); }
    50% { transform: scale(1.03); box-shadow: 0 0 60px rgba(253, 203, 110, 0.55), 0 0 90px rgba(243, 156, 18, 0.35); }
}

/* Clouds - visible when cloudy */
.clouds {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.daylyaz-weather-page.weather-cloudy .clouds,
body.daylyaz-weather-page.weather-rainy .clouds {
    opacity: 1;
}

.cloud {
    position: absolute;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, rgba(200,200,200,0.2) 100%);
    border-radius: 100px;
    filter: blur(3px);
}

.cloud-1 {
    width: 200px;
    height: 60px;
    top: 10%;
    left: 10%;
    animation: cloud-move 25s linear infinite;
}

.cloud-2 {
    width: 150px;
    height: 45px;
    top: 20%;
    left: 60%;
    animation: cloud-move 30s linear infinite reverse;
}

.cloud-3 {
    width: 180px;
    height: 55px;
    top: 5%;
    left: 30%;
    animation: cloud-move 35s linear infinite;
}

@keyframes cloud-move {
    0% { transform: translateX(-100px); }
    100% { transform: translateX(calc(100vw + 100px)); }
}

/* Rain drops - visible when rainy */
.rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
    pointer-events: none;
}

body.daylyaz-weather-page.weather-rainy .rain {
    opacity: 1;
}

.raindrop {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, transparent, rgba(116, 185, 255, 0.6));
    border-radius: 0 0 2px 2px;
    animation: rain-fall 0.7s linear infinite;
}

.raindrop:nth-child(odd) {
    width: 1px;
    height: 12px;
    background: linear-gradient(to bottom, transparent, rgba(116, 185, 255, 0.4));
}

.raindrop:nth-child(3n) {
    width: 3px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, rgba(116, 185, 255, 0.5));
}

@keyframes rain-fall {
    0% {
        transform: translateY(-20px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh);
        opacity: 0;
    }
}

/* Snow - visible when snowy */
.snow {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

.snow::before,
.snow::after {
    content: '';
    position: absolute;
    top: -100px;
    width: 100%;
    height: calc(100% + 100px);
    background-image:
        radial-gradient(4px 4px at 100px 50px, #fff, transparent),
        radial-gradient(3px 3px at 200px 150px, #fff, transparent),
        radial-gradient(4px 4px at 300px 250px, #fff, transparent),
        radial-gradient(3px 3px at 400px 100px, #fff, transparent),
        radial-gradient(5px 5px at 500px 300px, #fff, transparent),
        radial-gradient(3px 3px at 50px 200px, #fff, transparent),
        radial-gradient(4px 4px at 150px 350px, #fff, transparent),
        radial-gradient(3px 3px at 250px 50px, #fff, transparent),
        radial-gradient(4px 4px at 350px 180px, #fff, transparent),
        radial-gradient(3px 3px at 450px 280px, #fff, transparent);
    background-size: 500px 400px;
    animation: snowfall 8s linear infinite;
}

.snow::after {
    background-image:
        radial-gradient(3px 3px at 75px 100px, rgba(255,255,255,0.8), transparent),
        radial-gradient(4px 4px at 175px 200px, rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 275px 80px, rgba(255,255,255,0.8), transparent),
        radial-gradient(4px 4px at 375px 320px, rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 475px 180px, rgba(255,255,255,0.8), transparent),
        radial-gradient(4px 4px at 25px 280px, rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 125px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(4px 4px at 225px 130px, rgba(255,255,255,0.8), transparent);
    background-size: 500px 400px;
    animation: snowfall 12s linear infinite;
    animation-delay: -4s;
}

@keyframes snowfall {
    0% { transform: translateY(0); }
    100% { transform: translateY(400px); }
}

body.daylyaz-weather-page.weather-snowy .snow {
    opacity: 1;
}

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

/* ===== Header ===== */
.header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.logo a:hover {
    opacity: 0.85;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-yellow);
}

.logo-subtitle {
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 5px;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: var(--radius-md);
}

.nav-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.current-time {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.current-time #currentTime {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.current-time #currentDate {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== Main Content ===== */
.main-content {
    position: relative;
    z-index: 5;
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
    padding: 25px 40px 30px;
    max-width: 1800px;
    margin: 0 auto;
    align-items: start;
}

/* Weekly forecast spans full width on desktop */
.main-content .weekly-forecast-section {
    grid-column: 1 / -1;
}

/* ===== Cities Sidebar ===== */
.cities-sidebar {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: fit-content;
    max-height: 550px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cities-sidebar::-webkit-scrollbar {
    width: 6px;
}

.cities-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.cities-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.cities-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.city-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--card-border);
    transform: translateX(5px);
}

.city-item.active {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
}

.city-item .city-name {
    font-weight: 500;
    color: var(--text-primary);
}

.city-item .city-temp {
    display: flex;
    align-items: center;
    gap: 8px;
}

.city-item .weather-mini-icon {
    width: 24px;
    height: 24px;
}

.city-item .temp {
    font-weight: 600;
    color: var(--accent-yellow);
}

/* ===== Weather Main Section ===== */
.weather-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0; /* Allow shrinking in flex */
    overflow: hidden;
}

/* ===== Current Weather Card ===== */
.current-weather-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.location-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.location-info .city-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 3px;
    background: linear-gradient(135deg, #fff, #a8a8a8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.location-info .location-sub {
    color: var(--text-secondary);
    font-size: 1rem;
}

.weather-badge {
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.2), rgba(129, 236, 236, 0.2));
    border: 1px solid rgba(116, 185, 255, 0.3);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-cyan);
}

.weather-display {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    align-items: center;
}

.weather-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.weather-icon {
    width: 120px;
    height: 120px;
    animation: float 4s ease-in-out infinite;
}

.weather-icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 10px 30px rgba(253, 203, 110, 0.3));
}

.temp-main {
    display: flex;
    align-items: flex-start;
}

.temp-value {
    font-size: 4.5rem;
    font-weight: 200;
    line-height: 1;
    background: linear-gradient(180deg, var(--accent-yellow), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.temp-unit {
    font-size: 2rem;
    font-weight: 300;
    color: var(--accent-yellow);
    margin-top: 8px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.detail-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(116, 185, 255, 0.15);
    border-radius: 10px;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.detail-icon svg {
    width: 18px;
    height: 18px;
}

.sunrise-icon {
    background: rgba(253, 203, 110, 0.15);
    color: var(--accent-orange);
}

.sunset-icon {
    background: rgba(255, 118, 117, 0.15);
    color: #ff7675;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Hourly Forecast ===== */
.hourly-forecast {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 20px 25px;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.hourly-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.hourly-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.hourly-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), transparent);
    opacity: 0;
    transition: var(--transition);
}

.hourly-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.04) 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.hourly-card:hover::before {
    opacity: 1;
}

.hourly-card .time-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: capitalize;
}

.hourly-card .hourly-icon {
    width: 45px;
    height: 45px;
    margin: 0 auto 12px;
    filter: drop-shadow(0 4px 8px rgba(253, 203, 110, 0.2));
}

.hourly-card .hourly-icon svg {
    width: 100%;
    height: 100%;
}

.hourly-card .hourly-temp {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
}

.hourly-card .hourly-wind {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===== Weekly Forecast Section ===== */
.weekly-forecast-section {
    position: relative;
    z-index: 5;
    min-width: 0; /* Important for flex children to allow shrinking */
}

.weekly-forecast {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 25px 30px 20px;
    overflow: visible;
}

.weekly-cards {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 5px 15px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.weekly-cards::-webkit-scrollbar {
    height: 8px;
}

.weekly-cards::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.weekly-cards::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.weekly-cards::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.weekly-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 25px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    text-align: center;
}

.weekly-card:hover {
    transform: translateY(-5px);
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 215, 0, 0.3);
}

.weekly-card .day-info {
    text-align: center;
}

.weekly-card .day-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.weekly-card .day-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.weekly-card .weekly-icon {
    width: 70px;
    height: 70px;
}

.weekly-card .weekly-icon svg {
    width: 100%;
    height: 100%;
}

.weekly-card .condition-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-height: 36px;
    display: flex;
    align-items: center;
}

.weekly-card .weekly-temps {
    display: flex;
    gap: 12px;
    align-items: center;
}

.weekly-card .temp-high {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-yellow);
}

.weekly-card .temp-low {
    font-size: 1.1rem;
    color: var(--text-muted);
}

.weekly-card .weekly-wind {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.weekly-card .weekly-wind::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374b9ff' stroke-width='2'%3E%3Cpath d='M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2'/%3E%3C/svg%3E");
    background-size: contain;
}

/* ===== Bottom Content ===== */
.bottom-content {
    position: relative;
    z-index: 5;
    padding: 30px 40px;
    max-width: 1800px;
    margin: 0 auto;
}

.bottom-content-inner {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.bottom-content-inner h2,
.bottom-content-inner h3,
.bottom-content-inner h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
    margin-top: 20px;
}

.bottom-content-inner h2:first-child,
.bottom-content-inner h3:first-child,
.bottom-content-inner h4:first-child {
    margin-top: 0;
}

.bottom-content-inner p {
    margin-bottom: 15px;
}

.bottom-content-inner a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.bottom-content-inner a:hover {
    text-decoration: underline;
}

.bottom-content-inner ul,
.bottom-content-inner ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.bottom-content-inner li {
    margin-bottom: 8px;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 25px 40px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.footer a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* ===== Loading State ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--card-border);
    border-top-color: var(--accent-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.current-weather-card,
.hourly-forecast,
.weekly-forecast,
.cities-sidebar {
    animation: fadeIn 0.6s ease-out forwards;
}

.hourly-forecast {
    animation-delay: 0.1s;
}

.weekly-forecast {
    animation-delay: 0.2s;
}

/* ===== Responsive Design ===== */
@media (max-width: 1400px) {
    .weather-display {
        grid-template-columns: 250px 1fr;
        gap: 25px;
    }

    .weather-icon {
        width: 110px;
        height: 110px;
    }

    .temp-value {
        font-size: 4rem;
    }

    .weekly-card {
        flex: 0 0 160px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 240px 1fr;
        gap: 20px;
        padding: 20px;
    }

}

@media (max-width: 992px) {
    .header {
        flex-wrap: wrap;
        gap: 15px;
        padding: 15px 20px;
    }

    .main-content {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Reorder: Weather first, Weekly second, Cities last */
    .weather-main {
        order: 1;
        width: 100%;
    }

    .weekly-forecast-section {
        order: 2;
        width: 100%;
    }

    .cities-sidebar {
        order: 3;
        max-height: none;
        width: 100%;
    }

    .cities-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
        max-height: 300px;
        overflow-y: auto;
    }

    .weather-display {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .weather-details {
        grid-template-columns: repeat(3, 1fr);
    }

    .weekly-card {
        flex: 0 0 150px;
    }

}

@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .nav-tabs {
        order: 1;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    .current-time {
        order: 0;
    }

    .current-weather-card {
        padding: 20px;
    }

    .location-header {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
    }

    .location-info .city-name {
        font-size: 1.4rem;
    }

    .temp-value {
        font-size: 3.5rem;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .weekly-card {
        flex: 0 0 140px;
        padding: 18px 12px;
    }

    .weekly-forecast {
        padding: 20px;
    }

    /* Cities at bottom - change title */
    .sidebar-title {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 10px 12px;
        gap: 8px;
    }

    .logo {
        font-size: 1.1rem;
        gap: 6px;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }

    .logo-subtitle {
        display: none;
    }

    .nav-tabs {
        padding: 4px;
        gap: 4px;
    }

    .nav-tab {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .current-time #currentTime {
        font-size: 1.2rem;
    }

    .current-time #currentDate {
        font-size: 0.75rem;
    }

    .main-content {
        padding: 12px;
        gap: 15px;
    }

    .current-weather-card {
        padding: 15px;
    }

    .location-info .city-name {
        font-size: 1.2rem;
    }

    .weather-badge {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .weather-display {
        gap: 15px;
    }

    .weather-icon {
        width: 80px;
        height: 80px;
    }

    .temp-value {
        font-size: 3rem;
    }

    .temp-unit {
        font-size: 1.5rem;
    }

    .weather-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .detail-item {
        padding: 10px 8px;
        gap: 8px;
    }

    .detail-icon {
        width: 32px;
        height: 32px;
    }

    .detail-icon svg {
        width: 16px;
        height: 16px;
    }

    .detail-label {
        font-size: 0.7rem;
    }

    .detail-value {
        font-size: 0.85rem;
    }

    .hourly-forecast {
        padding: 15px;
    }

    .section-title {
        font-size: 0.8rem;
    }

    .hourly-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .hourly-card {
        padding: 12px 8px;
    }

    .hourly-card .time-label {
        font-size: 0.7rem;
    }

    .hourly-card .hourly-icon {
        width: 32px;
        height: 32px;
    }

    .hourly-card .hourly-temp {
        font-size: 1.1rem;
    }

    .moon, .sun {
        width: 50px;
        height: 50px;
        top: 5%;
        right: 8%;
    }

    /* Weekly forecast */
    .weekly-forecast {
        padding: 15px;
    }

    .weekly-card {
        flex: 0 0 110px;
        padding: 12px 8px;
        gap: 10px;
    }

    .weekly-card .day-name {
        font-size: 0.85rem;
    }

    .weekly-card .day-date {
        font-size: 0.7rem;
    }

    .weekly-card .weekly-icon {
        width: 45px;
        height: 45px;
    }

    .weekly-card .condition-text {
        font-size: 0.75rem;
        min-height: 28px;
    }

    .weekly-card .temp-high {
        font-size: 1.2rem;
    }

    .weekly-card .temp-low {
        font-size: 0.9rem;
    }

    .weekly-card .weekly-wind {
        font-size: 0.75rem;
    }

    /* Cities at bottom */
    .cities-sidebar {
        padding: 15px;
        max-height: none;
    }

    .cities-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: 250px;
    }

    .city-item {
        padding: 8px 10px;
    }

    .city-item .city-name {
        font-size: 0.85rem;
    }

    .city-item .temp {
        font-size: 0.85rem;
    }

    .city-item .weather-mini-icon {
        width: 20px;
        height: 20px;
    }

    .footer {
        padding: 15px;
        font-size: 0.75rem;
    }
}
