:root {
    --primary-color: #4285F4;
    --primary-dark: #3367d6;
    --bg-gradient: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    --bg-color: #f8f9fa;
    --card-bg: rgba(255, 255, 255, 0.25); /* More transparent for glass effect */
    --card-backdrop: blur(16px);
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --accent-color: #ea4335;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --border-radius: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --primary-color: #8ab4f8;
    --primary-dark: #aecbfa;
    --bg-gradient: linear-gradient(135deg, #1f2023 0%, #303134 100%);
    --bg-color: #202124;
    --card-bg: rgba(30, 30, 30, 0.4);
    --text-primary: #e8eaed;
    --text-secondary: #9aa0a6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Google Sans', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    transition: background 0.5s ease, color 0.3s ease;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for sticky footer */
}

.mood-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg3d {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.mood-sunny {
    background: radial-gradient(circle at 80% 20%, rgba(255,218,121,0.6), transparent 40%);
}

.mood-cloudy {
    background:
      radial-gradient(ellipse at 20% 30%, rgba(255,255,255,0.7), transparent 40%),
      radial-gradient(ellipse at 40% 20%, rgba(255,255,255,0.6), transparent 40%),
      radial-gradient(ellipse at 70% 35%, rgba(255,255,255,0.7), transparent 40%);
    animation: clouds 20s linear infinite;
}

.mood-rain {
    background:
      repeating-linear-gradient(180deg, rgba(66,133,244,0.12) 0 2px, transparent 2px 8px);
    animation: rain 1.2s linear infinite;
}

.mood-snow {
    background:
      radial-gradient(circle, rgba(255,255,255,0.8) 2px, transparent 3px) 0 0/40px 40px,
      radial-gradient(circle, rgba(255,255,255,0.7) 2px, transparent 3px) 20px 20px/40px 40px;
    animation: snow 6s linear infinite;
}

.mood-storm {
    background: rgba(0,0,0,0.15);
    animation: storm 2.5s ease-in-out infinite;
}

.mood-fog {
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.5), transparent 60%);
    filter: blur(2px);
}

@keyframes clouds {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 200px 0, 300px 0, 400px 0; }
}

@keyframes rain {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

@keyframes snow {
    0% { background-position: 0 0, 20px 20px; }
    100% { background-position: 0 60px, 20px 80px; }
}

@keyframes storm {
    0%, 100% { filter: brightness(1); }
    45% { filter: brightness(0.9); }
    50% { filter: brightness(1.3); }
    55% { filter: brightness(0.95); }
}
.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header & Search */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 20px;
    padding-top: 10px;
    transition: all 0.5s ease-in-out;
}

/* Initial Hero State (Centered) */
body.initial-state header {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    gap: 30px;
}

body.initial-state .search-container {
    width: 100%;
    padding: 15px 30px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

body.initial-state #city-search {
    font-size: 1.3rem;
}

body.initial-state .header-actions {
    opacity: 0; /* Hide actions initially for cleaner look, or keep them if preferred */
    pointer-events: none;
}
/* End Initial State */

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.3s;
}

.donate-btn {
    background: #FFDD00;
    color: #000;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(255, 221, 0, 0.3);
    transition: var(--transition);
}

.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 221, 0, 0.4);
}

.donate-btn i {
    font-size: 1.1rem;
}

.pro-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(118, 75, 162, 0.3);
    transition: var(--transition);
}

.pro-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(118, 75, 162, 0.4);
}

#theme-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(5px);
}

#theme-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 30px;
    padding: 10px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,0.2);
    transition: var(--transition);
}

.search-container:focus-within {
    box-shadow: var(--shadow-md);
    background: rgba(255,255,255,0.95);
}

[data-theme="dark"] .search-container:focus-within {
    background: rgba(48,49,52,0.95);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 15px;
}

#city-search {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
}

#search-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

#search-btn:hover {
    background: var(--primary-dark);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-color);
    border-radius: 16px;
    margin-top: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(0,0,0,0.05);
}

/* NEW CARD UI STYLES */
.weather-card-container {
    max-width: 500px; /* Restrict width like the screenshot */
    margin: 20px auto;
    width: 100%;
}

.card-tabs {
    display: flex;
    gap: 5px;
    padding: 0 20px;
    margin-bottom: -5px; /* Overlap with card slightly */
    position: relative;
    z-index: 2;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: none;
    padding: 10px 25px;
    border-radius: 15px 15px 0 0;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--card-bg); /* Match card bg */
    backdrop-filter: var(--card-backdrop);
    color: var(--text-primary);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.2);
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 1;
    color: var(--text-primary);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-primary);
    opacity: 0.9;
    font-weight: 500;
}

.sub-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.main-weather-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.big-temp {
    font-size: 5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    background: linear-gradient(180deg, var(--text-primary) 0%, rgba(var(--text-primary), 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    /* Fallback */
    color: var(--text-primary);
}

.big-temp .unit {
    font-size: 2.5rem;
    vertical-align: top;
    margin-left: 5px;
}

.temp-badge {
    display: inline-block;
    background: #8ab4f8; /* Cool blue */
    color: #000;
    padding: 6px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: capitalize;
}

.icon-column {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.weather-icon-lg {
    width: 80px;
    height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.weather-details-text p {
    margin: 3px 0;
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* AQI Mini Card Styling */
.aqi-mini-card {
    background: linear-gradient(135deg, #7F00FF 0%, #E100FF 100%); /* Default Purple/Red gradient */
    border-radius: 24px;
    padding: 20px;
    color: white;
    box-shadow: 0 10px 20px rgba(127, 0, 255, 0.3);
    margin-top: 20px;
    position: relative;
    overflow: hidden;
}

/* Specific AQI Gradients */
.aqi-bg-good { background: linear-gradient(135deg, #00b09b, #96c93d); box-shadow: 0 10px 20px rgba(0, 176, 155, 0.3); }
.aqi-bg-moderate { background: linear-gradient(135deg, #f2994a, #f2c94c); box-shadow: 0 10px 20px rgba(242, 153, 74, 0.3); }
.aqi-bg-unhealthy { background: linear-gradient(135deg, #FF416C, #FF4B2B); box-shadow: 0 10px 20px rgba(255, 65, 108, 0.3); }
.aqi-bg-hazardous { background: linear-gradient(135deg, #654ea3, #eaafc8); box-shadow: 0 10px 20px rgba(101, 78, 163, 0.3); }

.aqi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.aqi-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
}

.aqi-main-val {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.aqi-main-val .unit {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.8;
}

.aqi-pollutants p {
    text-align: right;
    font-size: 0.85rem;
    margin: 2px 0;
    opacity: 0.9;
}

.aqi-status-text {
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 10px;
    margin-top: 10px;
}

.card-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 20px;
    opacity: 0.8;
}

/* AI Section & Others - Keep consistent but pushed down */
.ai-section {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,0.1);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.ai-header h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-header h2::before {
    content: '\f0e0';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.ai-speak-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-speak-btn:hover {
    background: var(--primary-color);
    color: white;
}

.ai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.ai-card {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    transition: var(--transition);
}

[data-theme="dark"] .ai-card {
    background: rgba(0,0,0,0.2);
}

.ai-card:hover {
    transform: translateY(-2px);
    background: rgba(255,255,255,0.8);
}

.ai-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    padding-top: 3px;
}

.ai-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-card span {
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.4;
    display: block;
}

/* Weather Details Grid (Old grid below) */
.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.detail-card {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    padding: 15px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.1);
}

.detail-card i {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.detail-card span:first-of-type {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.detail-card span:last-child {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Ad Banners */
.ad-banner {
    margin: 20px 0;
    text-align: center;
    min-height: 100px;
    background: rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.sticky-footer-ad {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0,0,0,0.06);
    z-index: 999;
}

/* Map Section */
.map-section {
    height: 350px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
}

/* Hourly Forecast */
.hourly-forecast {
    margin-top: 30px;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.1);
}

.hourly-forecast h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hourly-scroll {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 10px;
    scrollbar-width: thin;
}

.hourly-card {
    min-width: 70px;
    text-align: center;
    padding: 10px;
    border-radius: 15px;
    background: rgba(255,255,255,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

[data-theme="dark"] .hourly-card {
    background: rgba(0,0,0,0.2);
}

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

.hourly-temp {
    font-weight: 600;
}

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

/* Daily Forecast */
.daily-forecast {
    margin-top: 20px;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.1);
}

.daily-forecast h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.daily-grid {
    display: grid;
    gap: 15px;
}

.daily-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.daily-day {
    font-weight: 500;
}

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

.daily-rain {
    font-size: 0.8rem;
    color: #4285F4;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 50px;
}

.daily-temp-range {
    font-weight: 600;
    text-align: right;
    width: 80px;
}

.daily-temp-low {
    color: var(--text-secondary);
    margin-left: 5px;
    font-weight: 400;
}

/* Responsive */
@media (max-width: 768px) {
    .header-actions span {
        display: none;
    }
    
    .weather-hero {
        flex-direction: column;
        text-align: center;
    }
    
    .big-temp {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .glass-card {
        padding: 20px;
    }

    .main-weather-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .icon-column {
        width: 100%;
        align-items: flex-start;
        flex-direction: row;
        gap: 15px;
        text-align: left;
    }

    .weather-icon-lg {
        width: 60px;
        height: 60px;
    }

    .weather-details-text p {
        font-size: 0.9rem;
    }

    .aqi-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .aqi-pollutants p {
        text-align: left;
    }
    
    .card-tabs {
        padding: 0 10px;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

.hidden {
    display: none !important;
}
 
.popular-cities {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}
.popular-cities a {
    display: inline-block;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 8px 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.popular-cities a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.faq-list details {
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 10px;
}
.faq-list summary {
    cursor: pointer;
    font-weight: 600;
}
.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.country-grid a {
    display: inline-block;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.country-grid a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.seo-copy p {
    margin: 8px 0;
    color: var(--text-secondary);
}
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.state-grid a {
    display: inline-block;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.state-grid a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
.city-grid, .province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.city-grid a, .province-grid a {
    display: inline-block;
    background: var(--card-bg);
    backdrop-filter: var(--card-backdrop);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--border-radius);
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.city-grid a:hover, .province-grid a:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}
