* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-200: #bae6fd;
    --primary-300: #7dd3fc;
    --primary-400: #38bdf8;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-800: #075985;
    --primary-900: #0c4a6e;
    
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    --accent-orange: #f59e0b;
    --accent-pink: #ec4899;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    color: var(--gray-700);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* Header styles moved to header.css */

/* Search dropdown styles moved to header.css */

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background-color 0.1s ease;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
    background: var(--primary-50);
}

.city-name {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.875rem;
}

.city-details {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.filter-btn {
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    color: var(--primary-700);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--primary-100);
    transform: translateY(-1px);
}

/* Main Layout */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-link {
    color: var(--primary-600);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.breadcrumb-current {
    color: var(--gray-700);
    font-weight: 500;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.page-description {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.7;
    max-width: 800px;
}

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-purple);
}

.stat-card:nth-child(2)::before { background: var(--accent-green); }
.stat-card:nth-child(3)::before { background: var(--accent-orange); }
.stat-card:nth-child(4)::before { background: var(--accent-pink); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.viz-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.viz-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.viz-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.viz-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.viz-actions {
    display: flex;
    gap: 0.5rem;
}

.viz-btn {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viz-btn:hover {
    background: var(--gray-50);
    color: var(--gray-700);
}

.viz-body {
    padding: 2rem;
    position: relative;
}

.viz-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.viz-image:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.viz-description {
    color: var(--gray-600);
    line-height: 1.6;
    text-align: center;
}

/* Temperature Threshold Figures */
.threshold-figures {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.threshold-figure {
    text-align: center;
}

.threshold-figure img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.threshold-figure img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-md);
}

.threshold-placeholder {
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    margin-bottom: 0.75rem;
}

.placeholder-text {
    color: var(--gray-500);
    font-style: italic;
    font-size: 0.9rem;
}

/* Responsive design for threshold figures */
@media (max-width: 768px) {
    .threshold-figures {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Seasonal Grid */
.seasonal-section {
    margin-top: 2rem;
}

.section-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    text-align: center;
}

.view-toggle {
    display: flex;
    background: var(--gray-100);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    background: white;
    color: var(--primary-600);
    box-shadow: var(--shadow-sm);
}

.seasonal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.seasonal-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.seasonal-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.seasonal-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: center;
    align-items: center;
}

.seasonal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    text-align: center;
}

.seasonal-body {
    padding: 1.5rem;
    position: relative;
}

.seasonal-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1rem;
}

.seasonal-image:hover {
    transform: scale(1.02);
}

.seasonal-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Daily Temperature Trends */
.daily-temp-section {
    margin-top: 2rem;
}

.daily-temp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.temp-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.temp-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.temp-header {
    background: linear-gradient(135deg, var(--accent-green) 0%, #059669 100%);
    color: white;
    padding: 1rem 1.5rem;
    text-align: center;
}

.temp-card:nth-child(2) .temp-header {
    background: linear-gradient(135deg, var(--accent-orange) 0%, #d97706 100%);
}

.temp-card:nth-child(3) .temp-header {
    background: linear-gradient(135deg, var(--accent-pink) 0%, #be185d 100%);
}

.temp-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.temp-body {
    padding: 1.5rem;
    position: relative;
}

.temp-description {
    color: var(--gray-600);
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Info Panel */
.info-panel {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    justify-content: center;
}

.info-title::before {
    content: "ℹ️";
}

.info-list {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #1e3a8a;
    font-size: 0.875rem;
}

.info-item::before {
    content: "•";
    color: #3b82f6;
    font-weight: bold;
    margin-top: 0.125rem;
}

/* Download Links */
.download-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
    opacity: 0;
}

.viz-body:hover .download-link,
.seasonal-body:hover .download-link,
.temp-body:hover .download-link {
    opacity: 1;
}

.download-link:hover {
    background: white;
    color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Image Overlay */
.image-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.image-overlay.active {
    display: flex;
}

.overlay-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 1rem;
    box-shadow: var(--shadow-xl);
    transition: transform 0.3s ease;
}

.overlay-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: opacity 0.2s ease;
    background: rgba(0, 0, 0, 0.5);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close:hover {
    opacity: 0.7;
}

/* At-a-Glance Compact Section */
.at-glance-compact-section {
    margin-bottom: 2rem;
}

.at-glance-compact-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    max-height: 350px;
    overflow: visible;
}

.at-glance-compact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.at-glance-compact-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
}

.at-glance-nav-links {
    display: flex;
    gap: 1rem;
}

.at-glance-nav-link {
    font-size: 0.8rem;
    color: var(--primary-600);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    line-height: 1;
}

.at-glance-nav-link:hover {
    background-color: var(--primary-50);
    color: var(--primary-700);
    text-decoration: none;
}

/* Enhanced Grid Layout for All Metrics */
.at-glance-unified-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

/* Enhanced Metric Cards with Better Visual Hierarchy */
.at-glance-metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1rem 0.8rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.at-glance-metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-200);
}

/* Icon at the top */
.metric-icon {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    line-height: 1;
    opacity: 0.8;
}

/* Main value - most prominent */
.metric-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Label directly below value */
.metric-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Category at the bottom - de-emphasized */
.metric-category {
    font-size: 0.7rem;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    line-height: 1;
    margin-top: auto;
}

/* Enhanced Card Type Styling with Subtle Backgrounds */
.at-glance-metric-card.seasonal {
    background: linear-gradient(135deg, #faf5ff 0%, #f8f4ff 100%);
    border: 1px solid #e9d5ff;
    border-left: 4px solid var(--accent-purple);
}

.at-glance-metric-card.seasonal:hover {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-color: #d8b4fe;
    border-left-color: var(--accent-purple);
}

.at-glance-metric-card.seasonal .metric-icon {
    color: var(--accent-purple);
    opacity: 1;
}

.at-glance-metric-card.temperature-extreme {
    background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 100%);
    border: 1px solid #fed7aa;
    border-left: 4px solid var(--accent-orange);
}

.at-glance-metric-card.temperature-extreme:hover {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fbbf24;
    border-left-color: var(--accent-orange);
}

.at-glance-metric-card.temperature-extreme .metric-icon {
    color: var(--accent-orange);
    opacity: 1;
}

.at-glance-metric-card.frost-date {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    border-left: 4px solid var(--accent-green);
}

.at-glance-metric-card.frost-date:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-color: #86efac;
    border-left-color: var(--accent-green);
}

.at-glance-metric-card.frost-date .metric-icon {
    color: var(--accent-green);
    opacity: 1;
}

/* Responsive Design for Enhanced Grid */
@media (max-width: 1024px) {
    .at-glance-unified-grid {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
        gap: 1rem;
        padding: 0.75rem 0;
    }
    
    .at-glance-metric-card {
        min-height: 95px;
        padding: 1rem 0.65rem;
    }
    
    .metric-icon {
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
    }
    
    .metric-value {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }
    
    .metric-label {
        font-size: 0.8rem;
        margin-bottom: 0.8rem;
    }
    
    .metric-category {
        font-size: 0.65rem;
    }
}

@media (max-width: 768px) {
    .at-glance-compact-container {
        padding: 1rem;
        max-height: none;
    }
    
    .at-glance-compact-header {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .at-glance-compact-title {
        font-size: 1rem;
    }
    
    .at-glance-unified-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 0.75rem;
        padding: 0.5rem 0;
    }
    
    .at-glance-metric-card {
        min-height: 90px;
        padding: 0.9rem 0.65rem;
    }
    
    .metric-icon {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .metric-value {
        font-size: 1.2rem;
        margin-bottom: 0.35rem;
    }
    
    .metric-label {
        font-size: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .metric-category {
        font-size: 0.6rem;
    }
}

/* Core Climate Trends Section - Side by Side Layout */
.core-trends-section {
    margin: 2rem 0;
    padding: 0;
}

.core-trends-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.core-trend-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
}

.core-trend-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.core-trend-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: center;
    align-items: center;
    margin: -1.5rem -1.5rem 0 -1.5rem;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.core-trend-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
    text-align: center;
    line-height: 1.3;
}

.core-trend-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    position: relative;
    padding: 2rem;
}

.core-trend-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.core-trend-image:hover {
    cursor: pointer;
    transform: scale(1.02);
}

.core-trend-description {
    text-align: center;
    color: var(--gray-600);
    line-height: 1.6;
    margin: 0.5rem 0;
}

.core-trend-download {
    position: absolute;
    top: 1rem;
    right: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.core-trend-body:hover .core-trend-download {
    opacity: 1;
}

.core-trend-download a {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s ease;
}

.core-trend-download a:hover {
    background: white;
    color: var(--primary-600);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Responsive Design for Core Trends */
@media (max-width: 1024px) {
    .core-trends-grid {
        gap: 1.5rem;
    }
    
    .core-trend-card {
        padding: 1.25rem;
    }
    
    .core-trend-header {
        margin: -1.25rem -1.25rem 0 -1.25rem;
    }
    
    .core-trend-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .core-trends-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .core-trend-card {
        padding: 1rem;
    }
    
    .core-trend-header {
        margin: -1rem -1rem 0 -1rem;
    }
    
    .core-trend-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .at-glance-compact-container {
        padding: 0.75rem;
    }
    
    .core-trends-section {
        margin: 1.5rem 0;
    }
    
    .core-trends-grid {
        gap: 1rem;
    }
    
    .core-trend-card {
        padding: 0.875rem;
    }
    
    .core-trend-header {
        margin: -0.875rem -0.875rem 0 -0.875rem;
    }
    
    .core-trend-title {
        font-size: 0.9rem;
    }
    
    .core-trend-download a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .at-glance-compact-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .at-glance-compact-title {
        font-size: 0.95rem;
    }
    
    .at-glance-unified-grid {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    
    .at-glance-metric-card {
        min-height: 85px;
        padding: 0.8rem 0.5rem;
    }
    
    .metric-icon {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }
    
    .metric-value {
        font-size: 1.1rem;
        margin-bottom: 0.3rem;
    }
    
    .metric-label {
        font-size: 0.7rem;
        margin-bottom: 0.6rem;
    }
    
    .metric-category {
        font-size: 0.55rem;
    }
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.at-glance-sidebar {
    width: 100%;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: start;
}

/* Responsive adjustments for at-glance-sidebar when used as standalone section */
@media (max-width: 768px) {
    .at-glance-sidebar {
        padding: 1.5rem;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.at-glance-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    text-align: center;
    grid-column: 1 / -1; /* Span full width of grid */
}

.at-glance-card {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 0.75rem;
    text-align: center;
}

.at-glance-card:last-child {
    margin-bottom: 0;
}

.at-glance-card.amber {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 20%);
}

.at-glance-card.blue {
    background: linear-gradient(135deg, #e0f2fe 0%, #0ea5e9 20%);
}

.at-glance-card.green {
    background: linear-gradient(135deg, #f0fdf4 0%, #10b981 20%);
}

.at-glance-card.glance-temp {
    background: linear-gradient(135deg, #ffd8d8 0%, #ff8383 30%);
    border: 1px solid #ff7575;
}

.at-glance-card.glance-precip {
    background: linear-gradient(135deg, #afd2ff 0%, #80b9ff 30%);
    border: 1px solid #6db1ff;
}

/* Header Layout with Stats Cards */
.header-content-with-cards {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    margin: 1.5rem 0;
}

.header-text-content {
    flex: 1;
}

.header-text-content .page-title {
    margin: 0 0 0.5rem 0;
}

.header-text-content .page-subtitle {
    margin: 0 0 1rem 0;
}

.header-text-content .page-description {
    margin: 0;
}

.header-stats-cards {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    align-self: flex-start;
}

.header-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.25rem 1rem;
    text-align: center;
    min-width: 150px;
    height: 120px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.header-card.glance-temp {
    background: linear-gradient(135deg, #ffd8d8 0%, #ff8383 30%);
    border: 1px solid #ff7575;
}

.header-card.glance-precip {
    background: linear-gradient(135deg, #afd2ff 0%, #80b9ff 30%);
    border: 1px solid #6db1ff;
}

.header-card-label {
    font-size: 0.75rem;
    color: white;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.header-card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.header-card-subtitle {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Responsive header layout */
@media (max-width: 768px) {
    .header-content-with-cards {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .header-stats-cards {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .header-card {
        min-width: 120px;
    }
}

/* Collapsible Climate Summary */
.climate-trends-summary {
    margin: 1rem 0 0 0;
}

.climate-summary-short {
    margin-bottom: 0.5rem;
}

.climate-summary-full {
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.climate-summary-full p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.climate-summary-full p:last-child {
    margin-bottom: 0;
}

.climate-summary-full.collapsed {
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
}

.climate-summary-full.expanded {
    opacity: 1;
}

.climate-summary-toggle {
    background: none;
    border: none;
    color: var(--primary-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 2px;
}

.climate-summary-toggle:hover {
    color: var(--primary-700);
    text-decoration-color: currentColor;
}

.climate-summary-toggle:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.toggle-icon {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.climate-summary-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Sticky Table of Contents */
.toc-section {
    position: sticky;
    top: 64px; /* Position below header (header is ~64px: 32px padding + 32px content) */
    z-index: 40; /* Lower z-index than header (50) */
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    margin: 0 -2rem;
    padding: 0 2rem;
}

.toc-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    max-width: 1200px;
    margin: 0 auto;
}

.toc-label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    white-space: nowrap;
}

.toc-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.toc-link {
    color: var(--primary-600);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.toc-link:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

.toc-separator {
    color: var(--gray-400);
    font-size: 0.875rem;
}

/* Mobile TOC styles */
@media (max-width: 768px) {
    .toc-section {
        position: static; /* Remove sticky positioning on mobile */
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .toc-content {
        flex-direction: column; /* Stack label and links vertically */
        align-items: center; /* Center the content */
        gap: 0.75rem;
        padding: 1rem 0; /* Proper padding for touch targets */
    }
    
    .toc-label {
        font-size: 0.875rem; /* Normal readable size */
    }
    
    .toc-links {
        flex-direction: column; /* Stack links vertically */
        align-items: center; /* Center the links */
        gap: 0.5rem; /* Adequate spacing */
        width: 100%;
        overflow-x: visible; /* No horizontal scrolling needed */
        flex-wrap: wrap;
    }
    
    .toc-link {
        font-size: 0.875rem; /* Readable font size */
        padding: 0.75rem 1rem; /* Proper touch target size */
        min-height: 44px; /* Ensure minimum touch target size */
        display: flex;
        align-items: center;
        justify-content: center; /* Center text within link */
        width: 100%;
        background-color: var(--gray-50);
        border-radius: 0.375rem;
        border: 1px solid var(--gray-200);
        text-align: center;
    }
    
    .toc-link:hover {
        background-color: var(--gray-100);
    }
    
    .toc-separator {
        display: none; /* Hide separators in vertical layout */
    }
}

@media (max-width: 480px) {
    .toc-section {
        position: static; /* Remove sticky positioning on small mobile */
        padding: 0 0.75rem;
    }
    
    .toc-content {
        padding: 0.75rem 0; /* Adequate vertical padding */
        gap: 0.5rem;
    }
    
    .toc-label {
        font-size: 0.875rem; /* Show "Jump to:" label */
    }
    
    .toc-links {
        gap: 0.375rem; /* Tighter but adequate spacing */
    }
    
    .toc-link {
        font-size: 0.8rem; /* Smaller but readable text */
        padding: 0.625rem 0.875rem; /* Adequate touch target */
        min-height: 44px; /* Ensure minimum touch target size */
        display: flex;
        align-items: center;
        /* Remove text hiding - use full link names */
    }
    
    .toc-separator {
        display: none; /* Hide separators in vertical layout */
    }
}

/* Full Width Heatmap */
.full-width-heatmap {
    margin: 2rem 0;
}

.full-width-heatmap .viz-card {
    margin: 0;
}

/* Monthly Anomalies Section */
.monthly-anomalies-section {
    margin: 2rem 0;
}

.monthly-anomalies-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

.anomaly-box {
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
    text-align: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
    min-width: 0;
    overflow: hidden;
}

.anomaly-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.anomaly-month {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.anomaly-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}

.anomaly-percent {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.anomaly-percentile {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .monthly-anomalies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .anomaly-box {
        padding: 0.5rem 0.25rem;
    }
    
    .anomaly-value {
        font-size: 0.9rem;
    }
    
    .anomaly-percent {
        font-size: 0.8rem;
    }
    
    .anomaly-month {
        font-size: 0.65rem;
    }
    
    .anomaly-percentile {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .monthly-anomalies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.4rem;
    }
    
    .anomaly-box {
        padding: 0.4rem 0.2rem;
    }
    
    .anomaly-value {
        font-size: 0.8rem;
    }
    
    .anomaly-percent {
        font-size: 0.7rem;
    }
    
    .anomaly-month {
        font-size: 0.6rem;
    }
    
    .anomaly-percentile {
        font-size: 0.65rem;
    }
}

/* Seasonal Warming Grid in Sidebar */
.seasonal-warming-section {
    margin-top: 0;
}

.seasonal-warming-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}

.seasonal-warming-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.seasonal-warming-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.75rem;
    text-align: center;
    transition: all 0.2s ease;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.seasonal-warming-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.seasonal-icon {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.seasonal-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.seasonal-label {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 500;
}

.at-glance-label {
    font-size: 0.875rem;
    color: white;
    margin-bottom: 0.5rem;
}

.at-glance-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.25rem;
}

.at-glance-subtitle {
    font-size: 0.75rem;
    color: white;
}

.at-glance-section {
    margin-bottom: 1.5rem;
}

.at-glance-section:last-child {
    margin-bottom: 0;
}

.at-glance-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 1.5rem 0;
    border-bottom: 2px solid var(--primary-100);
    padding-bottom: 0.5rem;
    text-align: center;
}

.at-glance-section-link {
    color: var(--gray-900);
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    display: block;
    margin: -0.25rem auto;
    width: fit-content;
}

.at-glance-section-link:hover {
    color: var(--gray-900);
    text-decoration: none;
    background-color: var(--gray-50);
    transform: translateY(-1px);
}

/* Temperature Thresholds Summary */
.temp-thresholds-summary {
    margin-top: 1rem;
}

.threshold-stat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.threshold-stat:last-child {
    margin-bottom: 0;
}

.threshold-stat:hover {
    background: var(--gray-100);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.threshold-icon {
    font-size: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.threshold-icon.hot {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border: 2px solid #f59e0b;
}

.threshold-icon.cold {
    background: linear-gradient(135deg, #dbeafe 0%, #60a5fa 100%);
    border: 2px solid #3b82f6;
}

.threshold-content {
    flex: 1;
    min-width: 0;
}

.threshold-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.threshold-value {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-600);
    line-height: 1.3;
}

.threshold-no-data {
    padding: 1rem;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
}

.main-viz-content {
    flex: 1;
}

/* Footer styles consolidated - see main footer section below */

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }
    
    /* Header responsive styles moved to header.css */
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .seasonal-grid,
    .daily-temp-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    /* Header responsive styles moved to header.css */
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .viz-body,
    .seasonal-body,
    .temp-body,
    .core-trend-body {
        padding: 1rem;
    }
}

/* State Landing Page Styles */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page title and subtitle styles consolidated - see main section above */

.stats-bar {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-600);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.city-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.city-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-500);
}

.city-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.city-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.city-details {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.4;
}

.city-population {
    font-weight: 500;
    color: var(--gray-700);
}

/* State page responsive design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .cities-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== INDEX PAGE STYLES ===== */

/* Main Content - Index Page */
body:has(.hero-section) .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    text-align: center;
}

.hero-section {
    max-width: 800px;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Search Section */
.search-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 100%;
    margin-bottom: 3rem;
}

.search-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
}

.search-input-container {
    flex: 1;
    position: relative;
}

/* Main search input (index page) - larger and more prominent */
.search-section .search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.search-section .search-input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.search-section .search-input::placeholder {
    color: var(--gray-400);
}

/* Main search dropdown - different from header search */
.search-section .search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-xl);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.search-section .search-dropdown.show {
    display: block;
}

.search-section .dropdown-item {
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
}

.search-section .dropdown-item:last-child {
    border-bottom: none;
}

.search-section .dropdown-item:hover,
.search-section .dropdown-item.highlighted {
    background: var(--primary-50);
}

.search-section .city-name {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.search-section .city-details {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.search-btn {
    background: var(--primary-600);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    background: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.search-btn::after {
    content: "🔍";
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    width: 100%;
}

.feature-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-purple);
}

.feature-card:nth-child(2)::before { background: var(--accent-green); }
.feature-card:nth-child(3)::before { background: var(--accent-orange); }
.feature-card:nth-child(4)::before { background: var(--accent-pink); }

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 2rem;
    text-align: center;
    color: var(--gray-500);
    margin-top: auto;
}

/* ===== CLIMATE MAP PAGE STYLES ===== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.subtitle {
    text-align: center;
    color: #4a5568;
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.control-select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    background: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

/* Modern Styled Dropdown */
.styled-select-wrapper {
    position: relative;
    display: inline-block;
    min-width: 160px;
}

.styled-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    background-image: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.styled-select:hover {
    border-color: var(--primary-300);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.styled-select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 
        0 0 0 3px rgba(14, 165, 233, 0.1),
        0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.styled-select:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--gray-500);
    transition: all 0.2s ease;
}

.styled-select:hover + .select-arrow {
    color: var(--primary-500);
}

.styled-select:focus + .select-arrow {
    color: var(--primary-600);
    transform: translateY(-50%) rotate(180deg);
}

/* Option styling (limited support across browsers) */
.styled-select option {
    background: white;
    color: var(--gray-700);
    padding: 0.5rem;
    font-weight: 500;
}

.styled-select option:checked {
    background: var(--primary-50);
    color: var(--primary-700);
}

.styled-select option:hover {
    background: var(--primary-50);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .styled-select-wrapper {
        min-width: 140px;
    }
    
    .styled-select {
        font-size: 0.8rem;
        padding: 0.625rem 2rem 0.625rem 0.875rem;
    }
    
    .select-arrow {
        right: 0.75rem;
    }
}

.legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding: 16px;
    background-color: #f7fafc;
    border-radius: 8px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-label {
    font-size: 0.85rem;
    color: #4a5568;
    font-weight: 500;
}

.info-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 16px;
    background-color: #edf2f7;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 16px;
}

.stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

.stat-label {
    font-size: 0.9rem;
    color: #4a5568;
}

.zoom-info {
    font-size: 0.9rem;
    color: #4a5568;
    font-style: italic;
}

/* Custom circle marker styles */
.temperature-circle {
    border: 2px solid #fff;
    border-radius: 50%;
    text-align: center;
    font-weight: 600;
    font-size: 11px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Climate map specific styling to match index.php */
.clim-map-page {
    background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
    min-height: 100vh;
}

.clim-map-page .container h1 {
    text-align: center;
    color: var(--gray-900);
    margin-bottom: 8px;
    font-size: 2.5rem;
    font-weight: 700;
}

/* Responsive Design Updates */
@media (max-width: 768px) {
    /* Header responsive styles moved to header.css */
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input-container {
        width: 100%;
    }
    
    .search-btn {
        width: 100%;
        justify-content: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Main search dropdown responsive */
    .search-section .search-dropdown {
        max-height: 250px;
    }
    
    .search-section .dropdown-item {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .search-section {
        padding: 1.5rem;
    }
    
    /* Smaller mobile adjustments for main search */
    .search-section .dropdown-item {
        padding: 0.625rem;
    }
    
    .search-section .city-name {
        font-size: 0.9rem;
    }
    
    .search-section .city-details {
        font-size: 0.8rem;
    }
}

/* Anomaly Maps Section */
.anomaly-maps-section {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 100%;
    margin-bottom: 3rem;
}

.anomaly-maps-section .section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.anomaly-maps-section .section-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.anomaly-controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-label {
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.toggle-group {
    display: flex;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    overflow: hidden;
}

.toggle-btn {
    background: white;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid var(--gray-300);
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn:hover {
    background: var(--gray-50);
}

.toggle-btn.active {
    background: var(--primary-500);
    color: white;
}

.toggle-btn.active:hover {
    background: var(--primary-600);
}


/* Add this CSS to ensure button groups are completely independent */

/* Type buttons (Anomaly/Z-Score) specific styling */
.anomaly-controls .control-group:first-child .toggle-btn.active,
.anomaly-controls .control-group:first-child .toggle-btn.type-active {
    background: var(--primary-500) !important;
    color: white !important;
}

.anomaly-controls .control-group:first-child .toggle-btn.active:hover,
.anomaly-controls .control-group:first-child .toggle-btn.type-active:hover {
    background: var(--primary-600) !important;
}

/* Period buttons (7/14/30 Day) specific styling */
.anomaly-controls .control-group:last-child .toggle-btn.active,
.anomaly-controls .control-group:last-child .toggle-btn.period-active {
    background: var(--primary-500) !important;
    color: white !important;
}

.anomaly-controls .control-group:last-child .toggle-btn.active:hover,
.anomaly-controls .control-group:last-child .toggle-btn.period-active:hover {
    background: var(--primary-600) !important;
}

/* Ensure non-active buttons in each group stay normal */
.anomaly-controls .control-group:first-child .toggle-btn:not(.active):not(.type-active) {
    background: white !important;
    color: var(--gray-700) !important;
}

.anomaly-controls .control-group:last-child .toggle-btn:not(.active):not(.period-active) {
    background: white !important;
    color: var(--gray-700) !important;
}

/* Prevent any global CSS from affecting our specific button groups */
.anomaly-controls .toggle-btn {
    transition: all 0.2s ease !important;
}

.anomaly-map-container {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.anomaly-map {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

.anomaly-legend {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 1rem;
}

.anomaly-legend p {
    margin: 0.25rem 0;
}

.anomaly-legend strong {
    color: var(--gray-800);
}

/* Monthly Anomalies Section */
.monthly-anomalies-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.monthly-anomalies-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 0.75rem;
    border: 1px solid var(--gray-200);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.monthly-anomaly-box {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    border: 2px solid var(--gray-300);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
    min-height: 4rem;
    min-width: 4rem;
}

.monthly-anomaly-box:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: var(--shadow-md);
}

.monthly-anomaly-box .month-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.monthly-anomaly-box .anomaly-value {
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.monthly-anomaly-box.no-data {
    background: var(--gray-100);
    color: var(--gray-400);
    border-color: var(--gray-200);
}

.monthly-anomaly-box.current-month {
    position: relative;
    opacity: 0.9;
}

.monthly-anomaly-box.current-month::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.monthly-anomalies-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
    border: 1px solid var(--gray-200);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid var(--gray-300);
}

.legend-color.cold {
    background: #3b82f6;
}

.legend-color.neutral {
    background: white;
}

.legend-color.warm {
    background: #ef4444;
}

/* Precipitation legend colors - brown → white → green scheme */
.legend-color.dry {
    background: #8B4513; /* Brown for dry conditions */
}

.legend-color.neutral-precip {
    background: #ffffff; /* White for neutral precipitation */
    border-color: var(--gray-400);
}

.legend-color.wet {
    background: #228B22; /* Green for wet conditions */
}

/* Additional styles for the new monthly anomalies structure */
.anomaly-row {
    margin: 1.5rem 0;
}

/* Anomaly subsection styles for merged temperature/precipitation display */
.anomaly-subsection {
    margin-bottom: 1.5rem;
}

.anomaly-subsection:last-child {
    margin-bottom: 0;
}

.anomaly-subsection-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.viz-description.compact {
    margin-top: 0.75rem;
    margin-bottom: 0;
    font-size: 0.9rem;
}

/* Conflicting Table of Contents Styles removed - using sticky TOC above */

.anomaly-row-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}

.monthly-anomalies-legends {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.legend-section {
    text-align: center;
}

.legend-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .monthly-anomalies-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .monthly-anomalies-legends {
        gap: 1rem !important;
        margin-top: 1rem !important;
        padding: 0.5rem !important;
    }
    
    .legend-section {
        margin-bottom: 0.5rem !important;
    }
    
    .legend-title {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .monthly-anomalies-legend {
        gap: 0.75rem !important;
        margin-top: 0.5rem !important;
        justify-content: center !important;
    }
    
    .legend-item {
        gap: 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    .legend-color {
        width: 1.5rem !important;
        height: 1.5rem !important;
        border-radius: 0.25rem !important;
        flex-shrink: 0 !important;
    }
    
    .anomaly-row-title {
        font-size: 1rem;
    }
    
    .anomaly-subsection-title {
        font-size: 1rem;
    }
    
    .viz-description.compact {
        font-size: 0.85rem;
    }
    
    /* Conflicting mobile TOC styles removed - using sticky TOC above */
}

.anomaly-stats {
    margin: 1rem 0;
    padding: 1rem;
    background-color: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.anomaly-stats .stat-display {
    text-align: center;
    font-size: 1.1rem;
    color: var(--gray-700);
}

.anomaly-stats #spatialMeanValue {
    font-weight: 600;
    color: var(--primary-600);
    margin: 0 0.5rem;
}

.anomaly-stats #spatialMeanPeriod {
    font-size: 0.9rem;
    color: var(--gray-500);
    font-style: italic;
}





/* States Overview Page Styles */
.state-card {
    position: relative;
    overflow: hidden;
}

.state-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-400) 0%, var(--primary-600) 100%);
}

.state-card:hover::before {
    background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-700) 100%);
}

.sorting-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    max-width: 600px;
    margin: 0 auto;
}

.sorting-controls label {
    color: var(--gray-700);
    font-size: 0.875rem;
}

.styled-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s ease;
    background-image: 
        linear-gradient(45deg, transparent 50%, var(--gray-500) 50%),
        linear-gradient(135deg, var(--gray-500) 50%, transparent 50%);
    background-position: 
        calc(100% - 12px) calc(1em + 2px),
        calc(100% - 8px) calc(1em + 2px);
    background-size: 
        4px 4px,
        4px 4px;
    background-repeat: no-repeat;
}

.styled-select:hover {
    border-color: var(--primary-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.styled-select:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.state-warming-main .warming-value {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.seasonal-breakdown .season-item {
    transition: all 0.2s ease;
}

.seasonal-breakdown .season-item:hover {
    background: var(--gray-100) !important;
    transform: scale(1.05);
}

/* Responsive design for states overview */
@media (max-width: 768px) {
    .sorting-controls {
        flex-direction: column;
        text-align: center;
    }
    
    .styled-select {
        width: 100%;
        max-width: 300px;
    }
    
    .features-grid {
        grid-template-columns: 1fr !important;
        max-width: 100% !important;
    }
    
    .state-warming-main .warming-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .seasonal-breakdown {
        grid-template-columns: 1fr !important;
        gap: 0.25rem;
    }
    
    .season-item {
        justify-content: center;
    }
}

/* Responsive adjustments for anomaly maps */
@media (max-width: 768px) {
    .anomaly-maps-section {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .anomaly-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .control-label {
        font-size: 0.875rem;
    }
    
    .toggle-group {
        justify-content: center;
    }
    
    .toggle-btn {
        flex: 1;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .anomaly-maps-section {
        padding: 1rem;
    }
    
    .anomaly-maps-section .section-title {
        font-size: 1.5rem;
    }
    
    .anomaly-map-container {
        padding: 0.5rem;
    }
    
    .anomaly-legend {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* FAQ Section */
.faq-section {
    margin: 3rem 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.faq-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.faq-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
    text-align: center;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.faq-item:hover {
    border-color: var(--blue-300);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.faq-item[open] {
    border-color: var(--blue-400);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.faq-question {
    padding: 1rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-900);
    list-style: none;
    position: relative;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background: var(--blue-50);
}

.faq-item[open] .faq-question {
    background: var(--blue-100);
    border-bottom-color: var(--blue-200);
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--blue-600);
    transition: transform 0.2s ease;
}

.faq-item[open] .faq-question::after {
    content: '−';
    transform: translateY(-50%) rotate(0deg);
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-answer {
    padding: 1.25rem;
    background: white;
    color: var(--gray-700);
    line-height: 1.6;
}

.faq-answer p {
    margin: 0;
}

/* Mobile FAQ Styles */
@media (max-width: 768px) {
    .faq-section {
        margin: 2rem 0;
    }
    
    .faq-container {
        padding: 1.5rem;
        border-radius: 0.75rem;
    }
    
    .faq-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .faq-question {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    .faq-question::after {
        right: 1rem;
        font-size: 1.125rem;
    }
    
    .faq-answer {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .faq-container {
        padding: 1rem;
        border-radius: 0.5rem;
    }
    
    .faq-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .faq-question {
        padding: 0.75rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .faq-answer {
        padding: 0.875rem;
        font-size: 0.85rem;
    }
    
    /* Enhanced mobile legend styling for very small screens */
    .monthly-anomalies-legends {
        gap: 0.75rem !important;
        margin-top: 0.75rem !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0.25rem !important;
    }
    
    .legend-section {
        margin-bottom: 0.25rem !important;
        width: auto !important;
        min-width: fit-content !important;
    }
    
    .legend-title {
        font-size: 0.8rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .monthly-anomalies-legend {
        gap: 0.5rem !important;
        margin-top: 0.25rem !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    
    .legend-item {
        gap: 0.375rem !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }
    
    .legend-color {
        width: 1.75rem !important;
        height: 1.75rem !important;
        border-radius: 0.375rem !important;
        border-width: 2px !important;
        flex-shrink: 0 !important;
    }
}
