/* Modern CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS Variables for Modern Color Scheme */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --primary-dark: #1d4ed8;
    --accent-color: #8b5cf6;
    --accent-light: #ede9fe;
    --secondary-color: #64748b;
    --background-color: #fafbfc;
    --background-alt: #f1f5f9;
    --background-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-color-dark: #cbd5e1;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;
    --danger-color: #ef4444;
    --danger-light: #fecaca;
    --danger-dark: #dc2626;
    --info-color: #06b6d4;
    --info-light: #cffafe;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    min-height: 100vh;
}

/* Modern Header */
.site-header {
    background: var(--background-card);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 95vw;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    line-height: 1.1;
    margin: 0;
}

.site-tagline {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    margin: 0;
    opacity: 0.9;
}

/* Main Content - Use more screen width */
.main-content {
    max-width: 100vw;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Simplified Top Section Layout */
.top-section {
    display: flex;
    gap: 2rem;
    margin: 3rem 0;
    align-items: stretch; /* make map equal height to filter panel */
    max-width: 100%;
}

/* Simplified layout - full width center content for auto ads */
.center-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Rail and ad-specific CSS removed - using auto ads only */

/* Limit map width on desktop and center */
@media (min-width: 1025px) {
  /* Desktop: larger map layout */
  .center-content {
    max-width: 2000px; /* increased to accommodate wider filter panel */
  }
  
  .top-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
  }
  
  /* Filter panel needs more width for side-by-side layout */
  .filter-panel { 
    flex: 0 0 750px;
    max-width: 750px;
  }
  
  /* Map panel much larger - takes remaining space with minimum size */
  .map-panel { 
    flex: 1;
    min-width: 800px; /* ensure map has substantial minimum width */
    max-width: none;
    aspect-ratio: 959 / 593; /* maintain map aspect ratio */
  }
  
  .map-panel .map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px; /* ensure decent height */
  }
  
  .map-panel .map-placeholder svg {
    width: 100%;
    height: auto;
    min-width: 800px; /* ensure SVG is substantial size */
  }

  /* Table section with reduced spacing */
  .table-section { 
    margin: 2rem 0 1rem 0;
  }
  .table-container { 
    padding: 2rem;
  }
}

/* Filter Panel - Two column layout */
.filter-panel {
    flex: 0 0 400px;
    background: var(--background-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

/* Map Panel - Fixed dimensions */
.map-panel {
    /* Make the panel size itself based on the map aspect ratio */
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    aspect-ratio: 959 / 593; /* Match the SVG's intrinsic ratio */
    height: auto;
    background: var(--background-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Ad Space Panel */
.ad-panel {
    background: var(--background-alt);
    border-radius: var(--radius-xl);
    border: 2px dashed var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Legacy filter-section for backward compatibility */
.filter-section {
    background: var(--background-card);
    margin: 3rem 0;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.filter-container {
    padding: 2rem;
}

/* Enhanced Filter Controls */
.filter-controls {
    background: var(--primary-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
    border: 1px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.clear-button {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.clear-button:hover {
    background: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.results-count {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.1rem;
    background: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--primary-color);
}

/* Filter Options Grid - Two even columns */
.filter-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
    margin-bottom: 2rem;
}

.filter-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* New Layout for side-by-side controls */
.controls-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.filters-column,
.heatmap-column {
    background: var(--background-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
}

.filters-column {
    border-color: var(--primary-color);
}

.heatmap-column { border-color: var(--accent-color); }

/* Reduce extra whitespace in filter panel */
.filter-panel .filter-container { padding-bottom: 1rem; }
.filter-panel { padding-bottom: 0.5rem; }

/* Map instruction text above map */
.map-instruction { display: none; }

/* Horizontal heatmap controls below map */
.map-heatmap-controls { margin-top: 0.75rem; }
.map-heatmap-controls .section-title { margin: 0 0 .5rem 0; text-align: left; }
.heatmap-options--horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.heatmap-options--horizontal .heatmap-option {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
}
.heatmap-options--horizontal .radio-checkmark { margin-right: 0.5rem; }

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
}

.filters-column .section-title {
    color: var(--primary-dark);
}

.heatmap-column .section-title {
    color: var(--accent-color);
}

/* Removed cheesy icon */

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
}

.filter-group {
    background: var(--background-alt);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    transition: all 0.3s ease;
}

.filter-group:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.filter-group h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group .filter-checkbox {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

/* Keep only search icon */
.filter-group[data-type="search"] h3::before { content: "🔍"; }

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Modern Checkbox Styling */
.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--background-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    gap: 1rem;
}

.filter-checkbox:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    height: 20px;
    width: 20px;
    background: var(--background-card);
    border: 2px solid var(--border-color-dark);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-checkbox:hover .checkmark {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.filter-checkbox input:checked ~ .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.filter-checkbox input:checked {
    & ~ .filter-checkbox {
        background: var(--success-light);
        border-color: var(--success-color);
    }
}

.checkmark:after {
    content: "✓";
    color: var(--background-card);
    font-weight: 700;
    font-size: 14px;
    display: none;
}

.filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}



/* Modern Clear Button */
.clear-button {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.clear-button:active {
    transform: translateY(-1px);
}

/* Filter Controls Bottom Bar */
.filter-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--background-alt);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
}

.filter-controls .clear-button {
    background: var(--gradient-accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.filter-controls .clear-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.filter-controls .clear-button:active {
    transform: translateY(0);
}

.results-count {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--info-light);
    color: var(--info-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--info-color);
}



.heatmap-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.heatmap-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--background-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.heatmap-option:hover {
    border-color: var(--accent-color);
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.heatmap-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-checkmark {
    height: 20px;
    width: 20px;
    background: var(--background-card);
    border: 2px solid var(--border-color-dark);
    border-radius: 50%;
    margin-right: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heatmap-option:hover .radio-checkmark {
    border-color: var(--accent-color);
    background: var(--accent-light);
}

.heatmap-option input:checked ~ .radio-checkmark {
    background: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.1);
}

.heatmap-option input:checked ~ .radio-checkmark:after {
    content: "●";
    color: var(--background-card);
    font-size: 10px;
    font-weight: 700;
}

/* Color Legend Styles */
.color-legend {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.legend-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.legend-bar {
    margin-bottom: 0.75rem;
}

.legend-gradient {
    height: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* Modern State Page Styles */
.state-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.state-header {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.state-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}

.state-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.state-name {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.state-nickname {
    font-size: 1.5rem;
    opacity: 0.9;
    font-style: italic;
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.state-basic-info {
    display: flex;
    gap: 2rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.state-abbreviation {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 800;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
}

.back-button {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    font-size: 1rem;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Stats Overview Cards */
.stats-overview {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: var(--background-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.stat-card.highlight {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.stat-icon {
    font-size: 3rem;
    min-width: 3rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.8;
    margin-bottom: 0.25rem;
}

.stat-rank {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
}

/* Main Content Grid */
.main-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.metrics-column,
.map-column {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Info Sections */
.info-section {
    background: var(--background-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-icon {
    font-size: 1.8rem;
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--background-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* Cost of Living Highlight */
.cost-living-highlight {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--gradient-success);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    color: white;
}

.col-index {
    text-align: center;
}

.col-number {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
}

.col-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.col-comparison {
    flex: 1;
}

.comparison-text {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.rank-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Climate Visual */
.climate-visual {
    text-align: center;
}

.temp-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.temp-item {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    min-width: 120px;
}

.temp-item.winter {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

.temp-item.summer {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    color: #e65100;
}

.temp-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.temp-value {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.temp-label {
    font-size: 1rem;
    font-weight: 600;
}

.temp-divider {
    width: 2px;
    height: 60px;
    background: var(--border-color);
    border-radius: 1px;
}

.sunny-days {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--warning-light);
    border-radius: var(--radius);
    color: var(--warning-dark);
    font-weight: 600;
}

.sunny-icon {
    font-size: 1.5rem;
}

/* Rankings */
.ranking-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.rank-item.healthcare {
    background: var(--success-light);
    color: var(--success-dark);
}

.rank-item.safety {
    background: var(--info-light);
    color: var(--info-color);
}

.rank-icon {
    font-size: 2rem;
}

.rank-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.rank-label {
    font-size: 1rem;
    font-weight: 600;
}

/* County Map */
.county-map-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.county-map {
    flex: 1;
    background: var(--background-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.state-details-section {
    background: var(--background-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.detail-card {
    background: var(--background-alt);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.detail-card h3 {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

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

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

/* State Page Mobile Responsive */
@media (max-width: 768px) {
    .state-page-container {
        padding: 1rem;
    }
    
    .state-header {
        padding: 3rem 1.5rem;
    }
    
    .state-header-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }
    
    .state-name {
        font-size: 2.5rem;
    }
    
    .state-nickname {
        font-size: 1.2rem;
    }
    
    .state-basic-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .main-content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cost-living-highlight {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .temp-range {
        flex-direction: column;
        gap: 1rem;
    }
    
    .temp-divider {
        width: 60px;
        height: 2px;
    }
    
    .ranking-grid {
        grid-template-columns: 1fr;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
}

/* Removed stats icon */

/* Modern Table Section */
.table-section {
    background: var(--background-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    margin: 3rem 0; /* default for mobile */
    overflow: hidden;
}

.table-container {
    padding: 3rem; /* default for mobile */
}

/* Styled intro block at top of home page */
.intro-hero {
    max-width: 900px;
    margin: 2rem auto 0 auto;
    text-align: center;
}
.intro-hero h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.intro-hero p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0.35rem 0;
}

.table-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary-color);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    background: var(--background-card);
}

.table-wrapper::-webkit-scrollbar {
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--background-alt);
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Modern Data Table */
.states-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    background: var(--background-card);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.states-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 700;
    padding: 1.5rem 1rem;
    text-align: left;
    border: none;
    white-space: nowrap;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.states-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
}

.states-table th.sortable:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
    transform: translateY(-1px);
}

.states-table th.sorted-asc,
.states-table th.sorted-desc {
    background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
}

.sort-icon {
    margin-left: 0.5rem;
    font-size: 1rem;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.states-table th.sorted-asc .sort-icon,
.states-table th.sorted-desc .sort-icon {
    opacity: 1;
    color: white;
    font-weight: 900;
}

.states-table td {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    transition: all 0.3s ease;
}

.states-table tr:nth-child(even) {
    background: var(--background-alt);
}

.states-table tr:hover {
    background: var(--background-alt);
}

.states-table tr:last-child td {
    border-bottom: none;
}

/* Modern Sticky Column */
.sticky-col {
    position: sticky;
    left: 0;
    background: var(--background-card);
    z-index: 10;
    border-right: 3px solid var(--primary-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    min-width: 160px;
}

.states-table th.sticky-col {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.states-table tr:hover .sticky-col {
    background: var(--primary-light);
}

.states-table tr:nth-child(even) .sticky-col {
    background: var(--background-alt);
}

/* Modern State Name Styling */
.state-name {
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.state-abbreviation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    background: var(--gradient-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    min-width: 3rem;
    text-align: center;
    box-shadow: var(--shadow);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.state-full-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.2;
}

/* Modern Cell Type Styling */
.tax-cell.no-tax {
    color: var(--success-dark);
    font-weight: 700;
    position: relative;
}

.tax-cell.no-tax::before {
    content: "✅";
    margin-right: 0.5rem;
}

.tax-cell.has-tax {
    color: var(--text-primary);
    font-weight: 500;
}

.boolean-cell.positive {
    color: var(--success-dark);
    font-weight: 700;
    background: var(--success-light);
    padding: 0.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--success-color);
}

.boolean-cell.positive::before {
    content: "✅";
    margin-right: 0.5rem;
}

.boolean-cell.negative {
    color: var(--danger-dark);
    font-weight: 700;
    background: var(--danger-light);
    padding: 0.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--danger-color);
}

.boolean-cell.negative::before {
    content: "❌";
    margin-right: 0.5rem;
}

.index-cell.below-average {
    color: var(--success-dark);
    font-weight: 600;
}

.index-cell.above-average {
    color: var(--warning-dark);
    font-weight: 600;
}

.rank-cell {
    font-weight: 700;
    background: var(--accent-light);
    padding: 0.5rem;
    border-radius: var(--radius);
    text-align: center;
    border-left: 4px solid var(--accent-color);
}

.currency-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.percentage-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.states-table small {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 400;
    opacity: 0.8;
}

/* No results message */
.no-results,
.error-message {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    color: var(--danger-color);
}

/* Map Section */
.map-section {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
}

.map-container {
    padding: 2rem;
}

.map-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.map-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.map-placeholder {
    background: var(--background-alt);
    border: 2px dashed var(--border-color-dark);
    border-radius: 12px;
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container {
    padding: 1rem;
    height: 100%;
    width: 100%;
}

/* Map SVG Styling */
.map-placeholder svg {
    width: 100%;
    height: auto;
    max-width: 960px;
    background: white;
    border-radius: 8px;
}

.map-placeholder svg path {
    transition: fill 0.3s ease, stroke 0.3s ease, opacity 0.2s ease;
}

.map-placeholder svg path:hover {
    opacity: 0.8;
}

.map-placeholder-content {
    text-align: center;
    padding: 2rem;
}

.map-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.map-placeholder h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.map-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Modern Footer */
.site-footer {
    background: linear-gradient(135deg, var(--text-primary), #1e293b, #334155);
    color: white;
    margin-top: 6rem;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.footer-container {
    max-width: 95vw;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Removed house icon */

.footer-container p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
    line-height: 1.6;
}

.footer-container p:first-of-type {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-container p:last-of-type {
    opacity: 0.7;
    font-size: 1rem;
    margin-bottom: 0;
}

/* Removed mobile table complexity */

/* AG Grid Custom Styling */
.ag-theme-alpine {
    --ag-background-color: var(--background-card);
    --ag-foreground-color: var(--text-primary);
    --ag-border-color: var(--border-color);
    --ag-header-background-color: var(--primary-color);
    --ag-header-foreground-color: white;
    --ag-odd-row-background-color: var(--background-alt);
    --ag-row-hover-color: var(--primary-light);
    --ag-selected-row-background-color: var(--primary-light);
    font-family: inherit;
}

.ag-header-cell {
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem !important;
}

.ag-pinned-left-header {
    border-right: 3px solid var(--primary-dark) !important;
}

.ag-cell.ag-cell-pinned-left {
    border-right: 3px solid var(--primary-color) !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    background: var(--background-card) !important;
    font-weight: 600;
}

.ag-row-odd .ag-cell.ag-cell-pinned-left {
    background: var(--background-alt) !important;
}

.ag-row-hover .ag-cell.ag-cell-pinned-left {
    background: var(--primary-light) !important;
}

/* Hide any footer or duplicate header rows */
.ag-floating-bottom,
.ag-floating-bottom-container,
.ag-floating-bottom-full-width-container,
.ag-header-row:not(:first-child),
.ag-footer-container,
.ag-footer,
.ag-grid .ag-body-horizontal-scroll:after {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
}

/* State cell styling */
.state-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.state-abbreviation {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    background: var(--gradient-primary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    min-width: 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-xs);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.state-full-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.2;
}

/* Cell type styling for AG Grid */
.tax-cell.no-tax {
    color: var(--success-dark);
    font-weight: 700;
}

.tax-cell.no-tax::before {
    content: "✅";
    margin-right: 0.5rem;
}

.tax-cell.has-tax {
    color: var(--text-primary);
    font-weight: 500;
}

.boolean-cell.positive {
    color: var(--success-dark);
    font-weight: 700;
    background: var(--success-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success-color);
    display: inline-block;
    width: 100%;
}

.boolean-cell.positive::before {
    content: "✅";
    margin-right: 0.25rem;
}

.boolean-cell.negative {
    color: var(--danger-dark);
    font-weight: 700;
    background: var(--danger-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger-color);
    display: inline-block;
    width: 100%;
}

.boolean-cell.negative::before {
    content: "❌";
    margin-right: 0.25rem;
}

.index-cell.below-average {
    color: var(--success-dark);
    font-weight: 600;
}

.index-cell.above-average {
    color: var(--warning-dark);
    font-weight: 600;
}

.rank-cell {
    font-weight: 700;
    background: var(--accent-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border-left: 3px solid var(--accent-color);
    display: inline-block;
    width: 100%;
}

.currency-cell,
.percentage-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.ag-cell small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    font-weight: 400;
    opacity: 0.8;
}

/* New data cell types */
.climate-cell {
    line-height: 1.3;
}

.climate-cell div {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.disaster-cell {
    line-height: 1.3;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.disaster-cell.low-risk {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.disaster-cell.medium-risk {
    background: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--warning-dark);
}

.disaster-cell.high-risk {
    background: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.disaster-cell .risk-level {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.economy-cell {
    line-height: 1.3;
}

.economy-cell div {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.demographics-cell {
    line-height: 1.3;
}

.demographics-cell div {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.safety-cell {
    line-height: 1.3;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid;
}

.safety-cell.low-risk {
    background: var(--success-light);
    border-color: var(--success-color);
    color: var(--success-dark);
}

.safety-cell.medium-risk {
    background: var(--warning-light);
    border-color: var(--warning-color);
    color: var(--warning-dark);
}

.safety-cell.high-risk {
    background: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.safety-cell div {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

/* Individual data cell types */
.disaster-risk-cell {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.disaster-risk-cell.low-risk {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-color);
}

.disaster-risk-cell.medium-risk {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-color);
}

.disaster-risk-cell.high-risk {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger-color);
}

.temp-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.humidity-cell {
    font-weight: 600;
    color: var(--accent-color);
}

.sunny-days-cell {
    font-weight: 600;
    color: var(--warning-dark);
}

.crime-cell {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.crime-cell.low-risk {
    background: var(--success-light);
    color: var(--success-dark);
}

.crime-cell.medium-risk {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.crime-cell.high-risk {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.unemployment-cell {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.unemployment-cell.low-risk {
    background: var(--success-light);
    color: var(--success-dark);
}

.unemployment-cell.medium-risk {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.unemployment-cell.high-risk {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.income-cell {
    font-weight: 700;
    color: var(--primary-color);
}

.growth-cell {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.growth-cell.low-risk {
    background: var(--success-light);
    color: var(--success-dark);
}

.growth-cell.medium-risk {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.growth-cell.high-risk {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.senior-cell,
.population-cell,
.density-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.score-cell {
    font-weight: 700;
    background: var(--accent-light);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-align: center;
    border-left: 3px solid var(--accent-color);
    display: inline-block;
    width: 100%;
}

.grade-cell {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-align: center;
}

.doctors-cell {
    font-weight: 600;
    color: var(--accent-dark);
}

.detail-cell,
.description-cell {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.neutral {
    background: var(--background-alt);
    color: var(--text-primary);
    border-left: 3px solid var(--border-color);
}

/* Enhanced filter group styling for new safety filters */
.filter-group[data-type="safety"] {
    background: linear-gradient(135deg, var(--accent-light), var(--success-light));
    border-left: 4px solid var(--accent-color);
}

.filter-group[data-type="safety"] h3 {
    color: var(--accent-dark);
}

/* Mobile Layout: Fixed map at top, scrollable filters below */
@media (max-width: 768px) {
    .site-header {
        position: static; /* avoid covering the sticky map on mobile */
    }
    .top-section {
        flex-direction: column;
        gap: 1rem;
        margin: 1rem 0;
    }
    
    .map-panel {
        position: sticky;
        top: 1rem;
        height: 25vh;
        width: 100%;
        flex: none;
        z-index: 5;
        order: 1;
    }
    
    /* Keep heatmap controls just under the sticky map */
    .map-heatmap-controls {
        order: 2;
    }

    /* Filters come after heatmap controls */
    .filter-panel {
        flex: 1;
        order: 3;
    }
    
    .filter-options-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 0.5rem;
    }
    
    .controls-layout {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        gap: 1.5rem;
    }
    
    .filter-container {
        padding: 1rem;
    }
    
    .filter-group {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .filter-group h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .filter-checkbox {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Hide map subtitle on mobile to save space */
    .map-subtitle {
        display: none;
    }
    
    .map-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
    .center-content { max-width: 100%; padding: 0 0.5rem; }
}

/* Tablet Layout: Adjusted grid for smaller screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .top-section {
        grid-template-columns: 320px 1fr 200px; /* Smaller columns */
        gap: 1.5rem;
    }
    
    .filter-container {
        padding: 1.5rem;
    }
    
    .filter-group {
        padding: 1.25rem;
    }
    
    .ad-panel {
        min-height: 300px;
        padding: 1.5rem 0.75rem;
    }
}

/* Modern Responsive Design */
@media (max-width: 1200px) {
    .header-container {
        padding: 1.5rem;
    }
    
    .site-title {
        font-size: 3rem;
    }
    
    .filter-container,
    .table-container,
    .map-container {
        padding: 2rem;
    }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 0 0.5rem;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .site-title {
        font-size: 2.5rem;
    }
    
    .filter-container,
    .table-container,
    .map-container {
        padding: 1.5rem;
    }
    
    .states-table th,
    .states-table td {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 1rem;
    }
    
    .site-title {
        font-size: 2rem;
    }
    
    .site-tagline {
        font-size: 1rem;
    }
    
    .filter-container,
    .table-container,
    .map-container {
        padding: 1rem;
    }
    
    .filter-section,
    .table-section,
    .map-section {
        margin: 2rem 0;
        border-radius: var(--radius-lg);
    }
    
    .filter-group {
        padding: 1.5rem;
    }
    
    .filter-checkbox {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .states-table {
        font-size: 0.9rem;
    }
    
    .states-table th,
    .states-table td {
        padding: 1rem 0.5rem;
    }
    
    .state-name {
        min-width: 140px;
    }
    
    .state-abbreviation {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .state-full-name {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .main-content {
        padding: 0 0.25rem;
    }
    
    .filter-container,
    .table-container,
    .map-container {
        padding: 0.75rem;
    }
    
    .site-title {
        font-size: 1.75rem;
    }
    
    .filter-title {
        font-size: 1.5rem;
    }
    
    .filter-group h3 {
        font-size: 1rem;
    }
    
    .filter-checkbox {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .checkmark {
        height: 18px;
        width: 18px;
    }
    
    /* Better mobile table */
    .table-wrapper {
        overflow-x: auto;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
        background: var(--background-card);
    }
    
    .states-table {
        font-size: 0.8rem;
        min-width: 700px;
    }
    
    .states-table th,
    .states-table td {
        padding: 0.75rem 0.5rem;
        white-space: nowrap;
    }
    
    /* Better sticky column for mobile */
    .sticky-col {
        position: sticky;
        left: 0;
        background: var(--background-card);
        z-index: 5;
        border-right: 2px solid var(--primary-color);
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
        min-width: 100px;
    }
    
    .states-table th.sticky-col {
        background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
        color: white;
    }
    
    .states-table tr:hover .sticky-col {
        background: var(--background-alt);
    }
    
    .states-table tr:nth-child(even) .sticky-col {
        background: var(--background-alt);
    }
    
    .state-name {
        min-width: 120px;
    }
    
    .state-abbreviation {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
        min-width: 2.5rem;
    }
    
    .state-full-name {
        font-size: 0.8rem;
    }
    
    .boolean-cell.positive,
    .boolean-cell.negative,
    .rank-cell {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
    
    .states-table small {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .main-content {
        max-width: 100vw;
        padding: 0 0.5rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
    }
    
    .filter-section,
    .table-section,
    .map-section {
        margin: 1.5rem 0;
        border-radius: var(--radius-md);
    }
    
    .filter-container::before,
    .table-container::before {
        font-size: 1.25rem;
    }
    
    /* Extra small mobile table */
    .states-table {
        font-size: 0.75rem;
        min-width: 700px; /* Still wide enough to be useful */
    }
    
    .states-table th {
        font-size: 0.7rem;
        padding: 1rem 0.3rem;
    }
    
    .states-table td {
        padding: 0.6rem 0.3rem;
    }
    
    /* Extra emphasis on sticky column for tiny screens */
    .sticky-col {
        min-width: 100px !important;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
        border-right: 4px solid var(--primary-color);
    }
    
    .state-name {
        min-width: 100px;
    }
    
    .state-full-name {
        display: none; /* Hide full name on tiny screens */
    }
    
    .state-abbreviation {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
        min-width: 2rem;
        font-weight: 900;
    }
}

/* Map Section */
.map-section {
    margin: 3rem 0;
    padding: 0;
}

.map-container {
    background: var(--background-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    max-width: 1000px;
    margin: 0 auto;
}

.map-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.map-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    text-align: center;
}

.map-placeholder {
    width: 100%;
    height: 0;
    padding-bottom: 61.8%; /* 593/959 = 0.618 aspect ratio of the original SVG */
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--background-alt);
    overflow: hidden;
}

.map-placeholder svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.map-placeholder-content {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.map-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.map-placeholder-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.map-placeholder-content p {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.map-placeholder-content small {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Styling for the SVG map states */
.map-placeholder svg path {
    fill: #D0D0D0; /* Default state color: light grey */
    stroke: #FFFFFF; /* State border color: white */
    stroke-width: 1;
    transition: fill 0.3s ease, stroke 0.3s ease;
    cursor: pointer;
}

/* Styling for states that match the filters */
.map-placeholder svg path.filtered {
    fill: #ef4444; /* Filtered state color: red */
    stroke: #dc2626; /* Filtered state border color: darker red */
}

/* Hover effect for all states */
.map-placeholder svg path:hover {
    fill: #a8a29e; /* Hover color: neutral grey */
    stroke: #f5f5f5;
}

/* Make the map fill the panel without extra inner boxes */
.map-panel .map-container {
    max-width: none;
    margin: 0;
    padding: 0; /* remove inner padding to avoid extra box */
    height: 100%;
    width: 100%;
    border: 0;
    box-shadow: none;
    border-radius: inherit;
    position: relative;
}

.map-panel .map-placeholder {
    height: 100%;
    width: 100%;
    padding-bottom: 0; /* use the panel's aspect-ratio instead */
    position: static;
    border: 0; /* remove dashed border in the real map */
    background: transparent;
}

.map-panel .map-placeholder svg {
    position: static;
    width: 100%;
    height: 100%;
    display: block;
    background: transparent;
    border-radius: 0;
}

/* Removed - consolidated into main desktop media query above */

/* Manual ad slots removed - Google Auto Ads will handle ad placement */
