:root {
    --bg-dark: #07101f;
    --bg-gradient: linear-gradient(135deg, #07101f 0%, #0d1b2a 100%);
    --glass-bg: rgba(13, 27, 42, 0.6);
    --glass-border: rgba(99, 166, 255, 0.15);
    --text-primary: #ddeeff;
    --text-secondary: #7899c0;
    --accent-blue: #38bdf8;
    --accent-indigo: #818cf8;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    line-height: 1.6;
    transition: background 0.8s ease;
}

/* Dynamic Themes */
body.theme-clear-day { background: linear-gradient(135deg, #2980b9 0%, #6dd5fa 100%); }
body.theme-clear-night { background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
body.theme-cloudy-day { background: linear-gradient(135deg, #757F9A 0%, #D7DDE8 100%); color: #1a202c; }
body.theme-cloudy-night { background: linear-gradient(135deg, #141e30 0%, #243b55 100%); }
body.theme-rain { background: linear-gradient(135deg, #373b44 0%, #4286f4 100%); }
body.theme-snow { background: linear-gradient(135deg, #8e9eab 0%, #eef2f3 100%); color: #1a202c; }

/* Adjust text colors for light themes */
body.theme-cloudy-day .weather-desc, 
body.theme-snow .weather-desc { color: #2b6cb0; }
body.theme-cloudy-day #current-date, 
body.theme-snow #current-date { color: #4a5568; }
body.theme-cloudy-day .detail-card .val, 
body.theme-snow .detail-card .val { color: #1a202c; }
body.theme-cloudy-day .detail-card .lbl, 
body.theme-snow .detail-card .lbl { color: #4a5568; }
body.theme-cloudy-day #current-temp,
body.theme-snow #current-temp { background: linear-gradient(180deg, #1a202c, #4a5568); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
body.theme-cloudy-day #city-name, body.theme-snow #city-name { color: #1a202c; text-shadow: none; }
body.theme-cloudy-day h2, body.theme-snow h2 { background: linear-gradient(90deg, #1a202c, #4a5568); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    background: rgba(7, 16, 31, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 24px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent-blue);
    font-weight: 600;
}

.lang-toggle {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 4px;
    margin-left: 12px;
}

.lang-divider {
    width: 1px;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

.lang-btn {
    background: transparent;
    border: none;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-main);
}

.lang-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
}

body.theme-snow .lang-toggle,
body.theme-cloudy-day .lang-toggle {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-snow .lang-divider,
body.theme-cloudy-day .lang-divider {
    background: rgba(255, 255, 255, 0.4);
}

body.theme-snow .lang-btn,
body.theme-cloudy-day .lang-btn {
    color: #4a5568;
}

body.theme-snow .lang-btn.active,
body.theme-cloudy-day .lang-btn.active {
    background: #4a5568;
    color: #fff;
}

.search-container {
    position: relative;
    width: 400px;
}

#search-input {
    width: 100%;
    padding: 12px 20px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: rgba(13, 27, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.search-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.2s;
    font-size: 14px;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-blue);
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

.nav-links a.btn-app {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    color: #fff;
    padding: 8px 20px;
    border-radius: 99px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.nav-links a.btn-app:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.6);
}

/* Main Layout */
main {
    padding-top: 100px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-bottom: 60px;
}

section {
    padding: 20px;
}

section h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    margin-bottom: 24px;
    background: linear-gradient(90deg, #fff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Weather Section */
.weather-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.current-weather {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    width: 100%;
}

#city-name {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

#current-date {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 30px;
}

.temp-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

#current-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

#current-temp {
    font-family: var(--font-heading);
    font-size: 110px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(180deg, #fff, rgba(255,255,255,0.7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.weather-desc {
    font-size: 20px;
    font-weight: 500;
    color: var(--accent-blue);
    margin-top: 10px;
    margin-bottom: 40px;
}

.weather-details {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    width: 100%;
}

.detail-card {
    flex: 1;
    min-width: 100px;
    max-width: 160px;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.3s, background 0.3s;
}

.detail-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15);
}

.detail-card .lbl {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-card .val {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

/* Forecasts */
.forecast-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
    max-width: 1200px;
}

.forecast-box {
    background: rgba(13, 27, 42, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 32px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

body.theme-cloudy-day .forecast-box,
body.theme-snow .forecast-box {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255,255,255,0.6);
    color: #1a202c;
}
body.theme-cloudy-day .forecast-box h3,
body.theme-snow .forecast-box h3 {
    color: #4a5568;
}

.forecast-box h3 {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.chart-header h3 {
    margin-bottom: 0;
}

.chart-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 99px;
    padding: 4px;
}

body.theme-cloudy-day .chart-tabs,
body.theme-snow .chart-tabs {
    background: rgba(0, 0, 0, 0.05);
}

.chart-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--font-main);
}

.chart-tab.active {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 4px 10px rgba(56, 189, 248, 0.3);
}

body.theme-cloudy-day .chart-tab,
body.theme-snow .chart-tab {
    color: #4a5568;
}

body.theme-cloudy-day .chart-tab.active,
body.theme-snow .chart-tab.active {
    background: #4a5568;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.chart-metrics {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    justify-content: center;
}

.metric-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 13px;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.metric-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.metric-btn.active {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    color: #fff;
    font-weight: 600;
}

body.theme-cloudy-day .metric-btn,
body.theme-snow .metric-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: #4a5568;
}

body.theme-cloudy-day .metric-btn.active,
body.theme-snow .metric-btn.active {
    background: rgba(0, 0, 0, 0.1);
    border-color: #4a5568;
    color: #1a202c;
}

/* Hourly Carousel */
.hourly-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.hourly-list::-webkit-scrollbar {
    display: none; /* Chrome */
}

.hourly-item {
    min-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 12px;
    border-radius: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: all 0.3s;
}

.hourly-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}

.h-time { font-size: 14px; color: var(--text-secondary); }
.h-icon { width: 40px; height: 40px; }
.h-temp { font-weight: 600; font-size: 18px; }

/* Daily List */
.daily-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.daily-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    transition: background 0.2s;
}

.daily-item:hover {
    background: rgba(255,255,255,0.05);
}

.d-day { flex: 1; font-weight: 500; }
.d-icon-wrap { flex: 1; display: flex; align-items: center; gap: 8px; }
.d-icon { width: 32px; height: 32px; }
.d-chance { font-size: 12px; color: var(--accent-blue); }
.d-temps { flex: 1; text-align: right; display: flex; justify-content: flex-end; gap: 16px; }
.d-min { color: var(--text-secondary); }
.d-max { font-weight: 600; }

/* AQI Section */
.aqi-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 40px;
    display: flex;
    gap: 40px;
    align-items: center;
}

.aqi-main {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1;
}

.aqi-ring {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 8px solid var(--success);
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.2);
}

#aqi-value {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
}

.aqi-lbl {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.aqi-status h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--success);
}

.aqi-status p {
    color: var(--text-secondary);
    font-size: 15px;
}

.aqi-grid {
    flex: 1.5;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.aqi-item {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aqi-item .pollutant {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.aqi-item .amount {
    font-size: 18px;
    font-weight: 700;
}

/* Radar */
.radar-container {
    width: 100%;
    height: 600px;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    background: #000;
}

.radar-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* App Promo */
.app-promo-section {
    background: linear-gradient(135deg, rgba(56,189,248,0.1), rgba(129,140,248,0.1));
    border: 1px solid rgba(129,140,248,0.2);
    border-radius: 40px;
    padding: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    margin-top: 40px;
    position: relative;
    overflow: hidden;
}

.promo-content {
    flex: 1;
    z-index: 2;
}

.promo-content h2 {
    font-size: 42px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #fff;
    background: none;
    -webkit-text-fill-color: #fff;
}

.promo-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.features {
    list-style: none;
    margin-bottom: 40px;
}

.features li {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-btns {
    display: flex;
    gap: 16px;
}

.store-btn {
    padding: 14px 28px;
    border-radius: 99px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.store-btn.google-play {
    background: #fff;
    color: #000;
    box-shadow: 0 8px 25px rgba(255,255,255,0.2);
}

.store-btn.app-store {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
}

.store-btn:hover {
    transform: translateY(-3px);
}

.store-btn.google-play:hover {
    box-shadow: 0 12px 30px rgba(255,255,255,0.3);
}

.store-btn.app-store:hover {
    background: rgba(255,255,255,0.1);
}

.promo-image {
    flex: 1;
    display: flex;
    justify-content: center;
    z-index: 2;
}

.promo-image img {
    max-width: 320px;
    filter: drop-shadow(0 30px 60px rgba(0,0,0,0.6));
    animation: float 6s ease-in-out infinite;
}

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

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--glass-border);
    margin-top: 40px;
}

/* Responsive */
@media (max-width: 992px) {
    .forecast-container {
        grid-template-columns: 1fr;
    }
    .weather-section {
        grid-template-columns: 1fr;
    }
    .aqi-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .app-promo-section {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    .promo-content h2 {
        font-size: 32px;
    }
    .download-btns {
        justify-content: center;
    }
    .promo-image img {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 20px;
    }
    .nav-links {
        display: none;
    }
    .search-container {
        width: 200px;
    }
    .current-weather {
        padding: 24px;
    }
    #current-temp {
        font-size: 64px;
    }
    .aqi-main {
        flex-direction: column;
        text-align: center;
    }
    .radar-container {
        height: 400px;
    }
}

@media (max-width: 600px) {
    .app-promo-section { padding: 30px 15px !important; }
    .promo-content h2 { font-size: 24px !important; }
    .promo-content p { font-size: 15px !important; }
    .store-btn { padding: 10px 20px !important; font-size: 14px !important; }
    .lang-toggle { flex-wrap: wrap; justify-content: center; margin-left: 0; margin-top: 10px; }
    .header { flex-wrap: wrap; justify-content: center; height: auto; padding: 10px; }
}
