/* VoteValue Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Ensure all interactive elements and content containers have rounded corners */
input:not([type="checkbox"]):not([type="radio"]), 
button, textarea, select, 
.card, .panel, .box, 
section, div[class*="card"], div[class*="panel"], div[class*="box"],
.banner, .modal, .dialog, .badge, .chip, .tag {
    border-radius: var(--border-radius, 12px);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

:root {
    /* Enhanced Color Palette */
    --primary-color: #c1121f;
    --primary-dark: #780000;
    --primary-light: #669bbc;
    --secondary-color: #003049;
    --accent-gold: #f59e0b;
    --success-color: #059669;
    --warning-color: #d97706;
    --error-color: #c1121f;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --surface-elevated: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #003049;
    --text-muted: #669bbc;
    
    /* Enhanced Shadows */
    --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 10px 10px -5px rgb(0 0 0 / 0.04);
    --shadow-hover: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Enhanced Border Radius */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    /* Enhanced Typography - Poppins everywhere */
    --font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-heading: 'Poppins', 'Inter', sans-serif;
    --font-weight-regular: 600;
    --font-weight-medium: 700;
    --font-weight-semibold: 800;
    --font-weight-bold: 900;
    
    /* Typography Scale */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 2rem;        /* 32px */
    --font-size-4xl: 2.5rem;      /* 40px */
    --font-size-5xl: 3rem;        /* 48px */
    --font-size-6xl: 3.5rem;       /* 56px */
    
    /* Line Height */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Enhanced Spacing Scale */
    --space-xs: 0.25rem;   /* 4px */
    --space-sm: 0.5rem;    /* 8px */
    --space-md: 1rem;      /* 16px */
    --space-lg: 1.5rem;    /* 24px */
    --space-xl: 2rem;      /* 32px */
    --space-2xl: 3rem;     /* 48px */
    --space-3xl: 4rem;     /* 64px */
    
    /* Enhanced Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Colorful Gradients */
    --gradient-primary: linear-gradient(135deg, #003049 0%, #669bbc 50%, #c1121f 100%);
    --gradient-secondary: linear-gradient(135deg, #c1121f 0%, #f59e0b 50%, #780000 100%);
    --gradient-hero: linear-gradient(135deg, #003049 0%, #669bbc 30%, #c1121f 60%, #f59e0b 100%);
    --gradient-surface: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #fef3c7 100%);
    --gradient-card: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --gradient-accent: linear-gradient(135deg, #669bbc 0%, #c1121f 50%, #f59e0b 100%);
    --gradient-vibrant: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f59e0b 75%, #c1121f 100%);

    /* Partisan colors */
    --color-dem: #2563eb;
    --color-dem-dark: #1d4ed8;
    --color-dem-bg: #dbeafe;
    --color-dem-text: #1e40af;
    --color-rep: #dc2626;
    --color-rep-bg: #fee2e2;
    --color-rep-text: #991b1b;
    --color-competitive: #8b5cf6;
    --color-competitive-bg: #f3e8ff;
    --color-competitive-text: #6b21a8;

    /* Demo/highlight banner colors */
    --color-demo-bg: #d1fae5;
    --color-demo-border: #059669;
    --color-demo-text: #065f46;

    /* Aliases for map.css / modify.css variable naming convention */
    --color-primary: var(--primary-color);
    --color-primary-dark: var(--primary-dark);
    --color-primary-light: var(--primary-light);
    --color-secondary: var(--secondary-color);
    --color-accent: var(--accent-gold);
    --color-success: var(--success-color);
    --color-warning: var(--warning-color);
    --color-error: var(--error-color);
    --color-border: var(--border-color);
    --color-bg: var(--background-color);
    --color-surface: var(--surface-color);
    --color-text: var(--text-primary);
    --color-text-muted: var(--text-muted);
    --radius-sm: 6px;
    --radius-md: var(--border-radius);
    --radius-lg: var(--border-radius-lg);
    --radius-xl: var(--border-radius-xl);
    --radius-full: 999px;

    /* State Code Lookup */
    --alabama: "AL";
    --alaska: "AK";
    --arizona: "AZ";
    --arkansas: "AR";
    --california: "CA";
    --colorado: "CO";
    --connecticut: "CT";
    --delaware: "DE";
    --florida: "FL";
    --georgia: "GA";
    --hawaii: "HI";
    --idaho: "ID";
    --illinois: "IL";
    --indiana: "IN";
    --iowa: "IA";
    --kansas: "KS";
    --kentucky: "KY";
    --louisiana: "LA";
    --maine: "ME";
    --maryland: "MD";
    --massachusetts: "MA";
    --michigan: "MI";
    --minnesota: "MN";
    --mississippi: "MS";
    --missouri: "MO";
    --montana: "MT";
    --nebraska: "NE";
    --nevada: "NV";
    --new-hampshire: "NH";
    --new-jersey: "NJ";
    --new-mexico: "NM";
    --new-york: "NY";
    --north-carolina: "NC";
    --north-dakota: "ND";
    --ohio: "OH";
    --oklahoma: "OK";
    --oregon: "OR";
    --pennsylvania: "PA";
    --rhode-island: "RI";
    --south-carolina: "SC";
    --south-dakota: "SD";
    --tennessee: "TN";
    --texas: "TX";
    --utah: "UT";
    --vermont: "VT";
    --virginia: "VA";
    --washington: "WA";
    --west-virginia: "WV";
    --wisconsin: "WI";
    --wyoming: "WY";
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header - Colorful Gradient */
.header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.9) 100%);
    border-bottom: 2px solid transparent;
    border-image: var(--gradient-primary) 1;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-normal);
}

.header:hover {
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.12);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
    padding: 1.25rem 0;
}

.logo {
    font-size: var(--font-size-2xl);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all var(--transition-normal);
    transform: scale(1);
    display: inline-block;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(193, 18, 31, 0.3));
}

.nav {
    display: flex;
    gap: 1.75rem;
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.nav-identity {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-left: 1.5rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.nav-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    background: rgba(102, 155, 188, 0.12);
    border: 1px solid rgba(102, 155, 188, 0.25);
    color: var(--text-primary);
    text-decoration: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: 999px;
}

.nav-user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    object-fit: cover;
}

.nav-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
}

.nav-user-name {
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-action-link {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    padding: 0.35rem 0.15rem;
    white-space: nowrap;
}

.nav-action-link.active,
.nav-action-link:hover {
    color: var(--primary-color);
}

.profile-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
    display: grid;
    gap: 1.5rem;
}

.profile-panel {
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
}

.profile-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.profile-logout-link {
    display: inline-block;
    margin-top: 0.6rem;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
}

.profile-logout-link:hover {
    color: var(--primary-color);
}

.profile-hero-avatar {
    width: 5rem;
    height: 5rem;
    border-radius: 999px;
    object-fit: cover;
}

.profile-hero-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: #fff;
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
}

.profile-banner {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
}

.profile-banner.success {
    background: rgba(5, 150, 105, 0.12);
    color: #065f46;
}

.profile-banner.error {
    background: rgba(193, 18, 31, 0.1);
    color: #991b1b;
}

.profile-banner.info {
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.profile-form,
.profile-upload-form {
    display: grid;
    gap: 0.75rem;
}

.profile-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.profile-optional {
    color: var(--text-muted);
    font-weight: var(--font-weight-regular);
}

.profile-input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border-color);
    background: #fff;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
}

.profile-textarea {
    min-height: 8rem;
    resize: vertical;
}

.profile-checkbox {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.profile-private-note,
.profile-upload p,
.public-profile-bio,
.profile-empty {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.profile-affiliation-chip {
    display: inline-block;
    margin: 0.2rem 0 0.35rem;
    padding: 0.2rem 0.65rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full, 999px);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
}

.profile-meta-line {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0.1rem 0;
}

.profile-join-date {
    font-size: var(--font-size-xs);
    color: var(--text-muted, #aaa);
}

.profile-submit,
.profile-secondary-btn {
    justify-self: start;
    padding: 0.75rem 1.1rem;
    border: none;
    background: var(--gradient-primary);
    color: #fff;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
}

.profile-secondary-btn {
    background: var(--secondary-color);
}

.profile-map-list {
    display: grid;
    gap: 0.75rem;
}

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

.profile-stat-card {
    display: grid;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
}

.profile-stat-label {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.profile-stat-value {
    font-size: var(--font-size-xl);
    color: var(--text-primary);
}

.profile-map-card {
    display: grid;
    gap: 0.2rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    text-decoration: none;
    color: var(--text-primary);
}

.profile-map-card span {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

@media (max-width: 980px) {
    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: flex-start;
    }

    .nav-identity {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0.6rem 0;
        gap: 0.75rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .nav {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.35rem 0.5rem;
    }
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-heading);
    transition: all var(--transition-normal);
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
    border-radius: 3px;
}

.nav-link:hover {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(193, 18, 31, 0.05), rgba(102, 155, 188, 0.05));
    transform: translateY(-2px);
}

.nav-link:hover::before {
    width: 80%;
}

/* Hero Section - Enhanced with Vibrant Gradients */
.hero {
    background: var(--gradient-hero);
    color: white;
    padding: var(--space-3xl) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: gradientShift 15s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(102, 155, 188, 0.4) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(193, 18, 31, 0.2) 0%, transparent 70%);
    pointer-events: none;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translateY(-20px) scale(1.05);
        opacity: 0.9;
    }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-lg);
    line-height: var(--line-height-tight);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-2xl);
    opacity: 0.95;
    line-height: var(--line-height-relaxed);
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Input Section */
.input-section {
    margin-top: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.address-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.address-input:focus {
    outline: none;
    background: white;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 30px rgba(193, 18, 31, 0.3), 0 0 0 4px rgba(193, 18, 31, 0.1);
    transform: translateY(-3px) scale(1.02);
}

.address-input.analyzing {
    border-color: var(--primary-color);
    background-color: rgba(193, 18, 31, 0.05);
}

.address-input.ready {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.05);
}

.address-input.error {
    border-color: var(--error-color);
    background-color: rgba(193, 18, 31, 0.05);
}

.analyze-btn {
    padding: 1.125rem 2.5rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius-lg);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family-heading);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(193, 18, 31, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.analyze-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.analyze-btn:hover::before {
    width: 300px;
    height: 300px;
}

.analyze-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 30px rgba(193, 18, 31, 0.5);
    filter: brightness(1.1);
}

.analyze-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.analyze-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

.analyze-btn.ready {
    background: linear-gradient(135deg, #10b981, var(--primary-color)) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4) !important;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.analyze-btn .btn-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.analyze-btn .btn-spinner::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    text-align: center;
}

/* Results Section - Enhanced with Colorful Gradient */
.results {
    padding: 4rem 0;
    background: var(--gradient-surface);
    animation: fadeIn 0.6s ease-in;
    position: relative;
    overflow: hidden;
}

.results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(0, 48, 73, 0.05), transparent);
    pointer-events: none;
}

.address-info {
    text-align: center;
    margin-bottom: 2rem;
}

.address-title {
    font-size: var(--font-size-2xl);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.address-coords {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.coordinates {
    background-color: var(--background-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.cache-status {
    background-color: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

/* Districts Grid - Desktop Landscape */
.districts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    margin-top: var(--space-2xl);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Desktop: Landscape cards */
@media (min-width: 769px) {
    .district-card {
        display: grid;
        grid-template-columns: 1fr 2fr;
        min-height: 280px;
    }
    
    .district-header {
        padding: var(--space-xl);
        background: var(--gradient-primary);
        color: white;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        border-right: 1px solid rgba(255,255,255,0.2);
        transition: all var(--transition-normal);
        overflow: hidden;
    }
    
    .district-header::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
        animation: shimmer 3s ease-in-out infinite;
    }
    
    @keyframes shimmer {
        0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
        50% { transform: translate(-50%, -50%) rotate(180deg); }
    }
    
    .district-header::after {
        content: '';
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        width: 1px;
        background: linear-gradient(180deg, transparent, rgba(255,255,255,0.3), transparent);
    }
    
    .district-body {
        padding: var(--space-xl);
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
    
    .metrics-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-sm);
        margin-bottom: var(--space-lg);
    }
    
    .metric-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--space-md);
        background: linear-gradient(135deg, rgba(0, 48, 73, 0.08), rgba(102, 155, 188, 0.08));
        border-radius: var(--border-radius);
        border: 1px solid rgba(0, 48, 73, 0.15);
        transition: all var(--transition-fast);
    }
    
    .metric-label {
        font-size: 0.75rem;
        color: var(--secondary-color);
        font-weight: var(--font-weight-medium);
        letter-spacing: 0.01em;
        margin-bottom: var(--space-xs);
        text-transform: uppercase;
    }
    
    .metric-value {
        font-family: var(--font-family-heading);
        font-size: 1rem;
        font-weight: var(--font-weight-semibold);
        color: var(--secondary-color);
        letter-spacing: -0.01em;
    }
    
    .vvi-number {
        font-size: 2.5rem;
    }
}

/* Mobile: Portrait cards */
@media (max-width: 768px) {
    .district-card {
        display: block;
        min-height: auto;
    }
    
    .district-header {
        padding: var(--space-xl);
        background: var(--gradient-primary);
        color: white;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
    }
    
    .district-header::after {
        content: '';
        position: absolute;
        right: auto;
        bottom: 0;
        top: auto;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    }
    
    .district-body {
        padding: var(--space-xl);
        display: block;
        border-radius: 0 0 var(--border-radius-xl) var(--border-radius-xl);
    }
    
    .metrics-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
        margin-bottom: var(--space-2xl);
    }

    .metric-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: var(--space-md);
        background: linear-gradient(135deg, rgba(0, 48, 73, 0.08), rgba(102, 155, 188, 0.08));
        border-radius: var(--border-radius);
        border: 1px solid rgba(0, 48, 73, 0.15);
        transition: all var(--transition-fast);
    }

    .metric-label {
        font-size: 0.8rem;
        color: var(--secondary-color);
        font-weight: var(--font-weight-medium);
        letter-spacing: 0.01em;
        margin-bottom: 0;
        text-transform: none;
        word-break: break-word;
    }

    .metric-value {
        font-family: var(--font-family-heading);
        font-size: 1.125rem;
        font-weight: var(--font-weight-semibold);
        color: var(--secondary-color);
        letter-spacing: -0.01em;
    }

    .vvi-number {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
    }

    .metric-label {
        font-size: 0.8rem;
        flex: 1;
        padding-right: 0.5rem;
    }

    .metric-value {
        font-size: 1rem;
        flex-shrink: 0;
    }
}

/* District Card - Base Styles - Enhanced */
.district-card {
    background-color: var(--surface-elevated);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.district-card:nth-child(1) { animation-delay: 0.05s; }
.district-card:nth-child(2) { animation-delay: 0.15s; }
.district-card:nth-child(3) { animation-delay: 0.25s; }
.district-card:nth-child(4) { animation-delay: 0.35s; }

.district-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

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

.district-card:hover {
    transform: translateY(-6px) scale(1.008);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.district-title {
    font-family: var(--font-family-heading);
    font-size: 1.375rem;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-sm);
    letter-spacing: -0.01em;
}

.district-subtitle {
    opacity: 0.95;
    font-size: 0.9375rem;
    font-weight: var(--font-weight-medium);
}

/* VVI Score - Base Styles */
.vvi-score {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(0, 48, 73, 0.06), rgba(193, 18, 31, 0.06), rgba(102, 155, 188, 0.06));
    border-radius: var(--border-radius-lg);
    border: 2px solid rgba(0, 48, 73, 0.15);
    position: relative;
    overflow: hidden;
}

.vvi-score::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(193, 18, 31, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

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

.vvi-number, .vvi-label, .vvi-description {
    position: relative;
    z-index: 1;
}

.vvi-number {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    color: var(--secondary-color);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
}

.vvi-label {
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vvi-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.vvi-beta-note {
    font-size: 0.68rem;
    font-weight: 600;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    margin-top: 0.4rem;
    display: inline-block;
    letter-spacing: 0.02em;
}

/* Metrics - Base Styles */
.metrics-grid {
    display: grid;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.metric-item {
    display: flex;
    padding: var(--space-lg);
    background: linear-gradient(135deg, rgba(0, 48, 73, 0.06), rgba(102, 155, 188, 0.06));
    border-radius: var(--border-radius);
    border: 1px solid rgba(0, 48, 73, 0.15);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.metric-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.metric-item:hover::after {
    left: 100%;
}

.metric-item:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(0, 48, 73, 0.1), rgba(102, 155, 188, 0.1));
}

.metric-label {
    color: var(--secondary-color);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
}

.metric-value {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    color: var(--secondary-color);
    letter-spacing: -0.01em;
}

/* Representatives - Landscape Layout */
.representatives {
    margin-top: var(--space-lg);
    flex-grow: 1;
}

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

/* Representative Categories */
.representative-category {
    margin-bottom: 1.5rem;
}

.representative-category:last-child {
    margin-bottom: 0;
}

.representative-category-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

/* Category titles use balanced colors */
.representative-category.federal .representative-category-title {
    border-bottom-color: #003049;
    color: #003049;
}

.representative-category.state-upper .representative-category-title {
    border-bottom-color: #c1121f;
    color: #c1121f;
}

.representative-category.state-lower .representative-category-title {
    border-bottom-color: #669bbc;
    color: #669bbc;
}

.representative-category-title::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: currentColor;
}

.representative-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.representative-card {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background-color: var(--surface-elevated);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-color);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.representative-card:hover {
    background-color: rgba(0, 48, 73, 0.02);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

/* Category cards use balanced color borders */
.federal .representative-card {
    border-left-color: #003049;
}

.state-upper .representative-card {
    border-left-color: #c1121f;
}

.state-lower .representative-card {
    border-left-color: #669bbc;
}

.representative-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--border-color);
    object-fit: cover;
}

.representative-info {
    flex: 1;
}

.representative-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.representative-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.representative-party {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.representative-party.republican {
    background-color: #dc2626; /* Red background */
    color: white;
}

.representative-party.democrat,
.representative-party.democratic {
    background-color: #2563eb; /* Blue background */
    color: white;
}

.representative-party.independent {
    background-color: #059669; /* Green background */
    color: white;
}

/* Additional party colors */
.representative-party.libertarian {
    background-color: #f59e0b; /* Yellow/Orange for Libertarians */
    color: white;
}

.representative-party.green {
    background-color: #059669; /* Green for Green Party */
    color: white;
}

/* Representative contact information */
.representative-contact {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    overflow: hidden;
}

.contact-link {
    color: #003049;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-link:hover {
    color: #669bbc;
    text-decoration: underline;
}

/* Demographics section */
.demographics-section {
    margin: 1.5rem 0;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: var(--border-radius);
    border-left: 3px solid #669bbc;
}

.demographics-title {
    font-size: 1rem;
    font-weight: 600;
    color: #003049;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.demographic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: white;
    border-radius: var(--border-radius-sm);
    border: 1px solid #e2e8f0;
}

.demographic-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Fallback for any other party */
.representative-party:not(.democrat):not(.democratic):not(.republican):not(.independent):not(.libertarian):not(.green) {
    background-color: #6b7280; /* Gray for unknown parties */
    color: white;
}

/* Methodology Section - Colorful Gradient */
.methodology {
    padding: 5rem 0;
    background: var(--gradient-card);
    position: relative;
    overflow: hidden;
}

.methodology::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 10% 20%, rgba(102, 155, 188, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(193, 18, 31, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.methodology-detail {
    padding: 4rem 0;
}

.methodology-header {
    text-align: center;
    margin-bottom: 3rem;
}

.methodology-toc {
    background: var(--surface-elevated, #f8f9fa);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1.25rem 1.75rem;
    margin-bottom: 2.5rem;
    display: inline-block;
    min-width: 240px;
}

.methodology-toc h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted, #718096);
    margin-bottom: 0.75rem;
}

.methodology-toc ol {
    padding-left: 1.25rem;
    margin: 0;
}

.methodology-toc ol li {
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
}

.methodology-toc ol li a {
    color: var(--primary-color, #4f46e5);
    text-decoration: none;
}

.methodology-toc ol li a:hover {
    text-decoration: underline;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.methodology-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3rem;
}

.methodology-text {
    font-size: 1rem;
    line-height: 1.7;
}

.methodology-text p {
    margin-bottom: 1rem;
}

.factors-list {
    list-style: none;
    margin: 1.5rem 0;
}

.factors-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.factors-list li:last-child {
    border-bottom: none;
}

.methodology-visual {
    position: sticky;
    top: 2rem;
}

.radar-chart-container {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.radar-chart {
    width: 100%;
    height: 300px;
}

.methodology-sections {
    max-width: 800px;
    margin: 0 auto;
}

.methodology-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.methodology-section:last-child {
    border-bottom: none;
}

.methodology-section h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.methodology-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.methodology-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.formula-container {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 1.5rem 0;
}

.formula-step {
    margin-bottom: 2rem;
}

.formula-step:last-child {
    margin-bottom: 0;
}

.formula {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin: 0.75rem 0;
    overflow-x: auto;
}

.formula-explanation {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
}

.factor-detail {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.factor-detail ul {
    margin-top: 1rem;
    padding-left: 1.5rem;
}

.factor-detail li {
    margin-bottom: 0.5rem;
}

.data-sources-list {
    display: grid;
    gap: 1rem;
}

.data-source {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    border-left: 3px solid var(--primary-color);
}

.limitations {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.limitations h3 {
    color: #92400e;
    margin-top: 0;
}

.limitations ul {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
}

.limitations li {
    margin-bottom: 0.5rem;
    color: #92400e;
}

/* ── Getting Started Section ─────────────────────────────────────────────── */
.getting-started {
    padding: 5rem 0 4rem;
    background: var(--background-color);
    position: relative;
}

.getting-started-intro {
    text-align: center;
    max-width: 640px;
    margin: -1.5rem auto 3.5rem;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Steps */
.gs-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 760px;
    margin: 0 auto 4rem;
}

.gs-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 1.75rem 2rem;
    position: relative;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.gs-step:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.gs-step-number {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: #fff;
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    margin-top: 0.1rem;
}

.gs-step-body {
    flex: 1;
    min-width: 0;
}

.gs-step-title {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.gs-step-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 0.6rem;
}

.gs-step-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(102, 155, 188, 0.08);
    border-left: 3px solid var(--primary-light);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0.45rem 0.75rem;
    line-height: 1.5;
}

.gs-step-connector {
    width: 2px;
    height: 1.5rem;
    background: linear-gradient(to bottom, var(--border-color), transparent);
    margin: 0 auto;
    /* Center it under the step number: left offset = step padding + half number width */
    margin-left: calc(2rem + 1.25rem - 1px);
}

.gs-tip-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}
.gs-tip-link:hover {
    text-decoration: underline;
}

/* Score explainer */
.gs-score-explainer {
    max-width: 900px;
    margin: 0 auto;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-xl);
    padding: 2.25rem 2.5rem;
}

.gs-explainer-title {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.gs-factors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.gs-factor {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.1rem 0.75rem;
    gap: 0.35rem;
    transition: box-shadow var(--transition-fast);
}

.gs-factor:hover {
    box-shadow: var(--shadow-md);
}

.gs-factor-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.gs-factor-name {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.gs-factor-weight {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    font-size: 1rem;
    color: var(--primary-color);
}

.gs-factor-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.gs-explainer-footnote {
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 640px) {
    .gs-step {
        padding: 1.25rem 1.25rem;
        gap: 1rem;
    }
    .gs-step-connector {
        margin-left: calc(1.25rem + 1.25rem - 1px);
    }
    .gs-score-explainer {
        padding: 1.5rem 1.25rem;
    }
    .gs-factors {
        grid-template-columns: 1fr 1fr;
    }
    .getting-started-intro {
        font-size: 0.95rem;
    }
}

/* About Section */
.about {
    padding: 5rem 0;
    background: var(--gradient-surface);
    position: relative;
    overflow: hidden;
}

.about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 10% 90%, rgba(193, 18, 31, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.section-title {
    font-size: var(--font-size-4xl);
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.about-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

.about-cta {
    margin-top: 1rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family-heading);
    font-size: 1rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(193, 18, 31, 0.35);
}

.data-sources {
    background-color: var(--background-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
}

.data-sources h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.data-sources ul {
    list-style: none;
}

.data-sources li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-sources li:last-child {
    border-bottom: none;
}

/* CTA Section */
.cta-section {
    text-align: center;
    padding: 3rem 0;
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    margin: 3rem 0;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Shared Components — buttons, modals (single authoritative definition)
   ========================================================================== */

.btn-primary,
.btn-secondary {
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-base);
    padding: 0.65rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Shared modal */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.open {
    display: flex;
}

.modal-box {
    background: var(--surface-elevated);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    max-width: 680px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease;
}

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

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

/* Beta disclaimer banner */
.beta-banner {
    background: #fef9c3;
    border-bottom: 1px solid #fde047;
    padding: 0.6rem 0;
    font-size: 0.8rem;
    line-height: 1.5;
}
.beta-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.beta-badge {
    flex-shrink: 0;
    font-weight: 700;
    color: #854d0e;
    white-space: nowrap;
    padding-top: 1px;
}
.beta-banner-text {
    flex: 1;
    margin: 0;
    color: #713f12;
}
.beta-banner-link {
    color: #92400e;
    font-weight: 600;
    margin-left: 0.4rem;
    white-space: nowrap;
}
.beta-banner-dismiss {
    flex-shrink: 0;
    background: none;
    border: 1px solid #ca8a04;
    border-radius: 4px;
    color: #854d0e;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-start;
    margin-top: 1px;
}
.beta-banner-dismiss:hover {
    background: #fde047;
}
.beta-short { display: none; }
@media (max-width: 768px) {
    .beta-full { display: none; }
    .beta-short { display: block; flex: 1; margin: 0; color: #713f12; }
}

/* Permanent beta notice block (used in data_sources and methodology pages) */
.beta-notice {
    background: #fef9c3;
    border: 1px solid #fde047;
    border-left: 4px solid #ca8a04;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0 2rem;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #713f12;
}

.beta-notice strong {
    color: #854d0e;
}

/* Footer */
.footer {
    background-color: var(--text-primary);
    color: white;
    padding: 3rem 0;
    margin-top: 4rem;
    border-radius: var(--border-radius-xl) var(--border-radius-xl) 0 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
    text-align: center;
}

.footer-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-copyright {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    margin: 0;
    opacity: 0.95;
}

.footer-author {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    margin: 0;
    opacity: 0.85;
}

.footer-disclaimer {
    margin-top: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.footer-disclaimer p {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    margin: 0;
    opacity: 0.9;
}

.footer-disclaimer strong {
    font-weight: var(--font-weight-semibold);
}

.footer-disclaimer a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-disclaimer a:hover {
    color: white;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    opacity: 0.85;
    transition: all var(--transition-normal);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

.footer-links a:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Loading Overlay - Enhanced */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 48, 73, 0.95), rgba(102, 155, 188, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease-in;
}

.loading-content {
    background: var(--background-color);
    border-radius: var(--border-radius-xl);
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 320px;
}

.loading-content p {
    margin-top: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 48, 73, 0.1);
    border-top: 4px solid var(--primary-color);
    border-right: 4px solid var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    margin: 0 auto;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Skeleton Loaders */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin: 0.5rem 0;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-card {
    background: var(--surface-elevated);
    border-radius: var(--border-radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    border: 1px solid var(--border-color);
}

.skeleton-metric {
    height: 3rem;
    width: 100%;
    margin-bottom: var(--space-md);
}

/* Progressive Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.district-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 3rem 0;
}

.no-results-content {
    max-width: 500px;
    margin: 0 auto;
}

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

.no-results p {
    color: var(--text-secondary);
}

/* Responsive Design - Smooth Transitions */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        transition: padding var(--transition-normal);
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
        transition: font-size var(--transition-normal);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
        transition: font-size var(--transition-normal);
    }
    
    .input-group {
        flex-direction: column;
        gap: 1rem;
        transition: flex-direction var(--transition-normal);
    }
    
    .address-input,
    .analyze-btn {
        width: 100%;
        transition: all var(--transition-normal);
    }
    
    .districts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    
    .methodology-content,
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        transition: grid-template-columns var(--transition-normal);
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .logo {
        font-size: var(--font-size-xl);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
        line-height: 1.2;
    }
    
    .page-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .district-body {
        padding: 1rem;
    }
    
    .methodology-content,
    .about-content {
        gap: 1.5rem;
    }
    
    .methodology,
    .about,
    .results {
        padding: 3rem 0;
    }
}

/* Notice Banner */
.notice-banner {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--border-radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #92400e;
}

.notice-banner p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notice-banner strong {
    font-weight: 600;
}

/* Demo Mode Notice */
.demo-notice {
    color: #d97706;
    font-weight: 500;
    font-size: 0.875rem;
}

.coordinates-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Boundary map button styles removed per user request */

/* Boundary Success Message */
.boundary-success {
    animation: fadeIn 0.3s ease-in;
}

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

/* Location Map Tile */
.location-map {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    margin: 2rem 0;
    overflow: hidden;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #003049, #669bbc);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.map-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Fullscreen map button removed per user request */

.embedded-map {
    height: 400px;
    width: 100%;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.875rem;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    overflow: hidden;
}

.embedded-map iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: var(--border-radius-lg);
}

.map-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.map-loading .spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid #e9ecef;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* =============================================
   District color legend (map page)
   ============================================= */
.district-color-legend {
    margin: 0.75rem 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.75rem;
}

.district-color-legend .legend-title {
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: #334155;
    font-size: 0.8rem;
}

.district-color-legend .legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    color: #475569;
}

.district-color-legend .legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* =============================================
   Profile action link
   ============================================= */
.profile-action-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.profile-action-link:hover {
    text-decoration: underline;
}

/* =============================================
   Leaderboard page
   ============================================= */
.leaderboard-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.leaderboard-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
}

.leaderboard-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.leaderboard-play-link {
    display: inline-block;
    margin-top: 0.5rem;
}

.leaderboard-loading {
    text-align: center;
    padding: 3rem;
    color: #64748b;
    font-size: 1rem;
}

.leaderboard-empty {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.leaderboard-empty a {
    color: var(--primary-color);
}

.leaderboard-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.leaderboard-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.leaderboard-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
    vertical-align: middle;
}

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

.leaderboard-table tbody tr:hover {
    background: #f8fafc;
}

.lb-col-rank { width: 56px; }
.lb-col-num { width: 90px; text-align: right; }
.lb-col-pct { width: 100px; text-align: right; }

.lb-rank-num {
    font-weight: 700;
    color: #94a3b8;
    font-size: 1rem;
}

.lb-rank-1 .lb-rank-num { color: #f59e0b; }
.lb-rank-2 .lb-rank-num { color: #9ca3af; }
.lb-rank-3 .lb-rank-num { color: #b45309; }

.lb-accuracy {
    font-weight: 600;
    color: #0f172a;
}

.lb-player-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
}

.lb-player-link:hover .lb-player-name {
    text-decoration: underline;
}

.lb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lb-avatar-initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}

.lb-player-name {
    font-weight: 500;
}

.leaderboard-cta {
    padding: 1.25rem 1rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

.leaderboard-cta a {
    color: var(--primary-color);
}
