/* Color Variables */
:root {
    --bg-aqua-primary: #AFE6E8;
    --bg-aqua-alt: #C6EDEF;
    --paper-highlight: #E1F5F5;
    --coral-primary: #E85D48;
    --coral-secondary: #DB9788;
    --deep-teal: #0B3A3D;
}

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--deep-teal);
    background-color: var(--bg-aqua-primary);
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(11, 58, 61, 0.03) 10px, rgba(11, 58, 61, 0.03) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(11, 58, 61, 0.03) 10px, rgba(11, 58, 61, 0.03) 20px);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Logo Section */
.logo-section {
    text-align: center;
    padding: 60px 20px 40px;
    background-color: var(--bg-aqua-alt);
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(11, 58, 61, 0.05) 2px,
            rgba(11, 58, 61, 0.05) 4px
        );
    pointer-events: none;
    opacity: 0.3;
}

.logo {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: 'League Spartan', sans-serif;
    font-weight: 900;
    color: var(--coral-primary);
    text-align: left;
    line-height: 1;
}

.logo-number {
    font-size: 8rem;
    font-weight: 900;
    display: inline-block;
    letter-spacing: -0.02em;
}

.logo-and {
    font-size: 2rem;
    font-weight: 700;
    display: inline-block;
    margin-left: 10px;
    position: relative;
    top: -20px;
    padding: 0 8px;
    border-top: 2px solid var(--coral-primary);
    border-bottom: 2px solid var(--coral-primary);
}

.logo-free {
    font-size: 6rem;
    font-weight: 900;
    display: block;
    margin-top: 10px;
    letter-spacing: -0.02em;
}

/* Content Sections */
main {
    margin-bottom: 40px;
}

.content-box {
    background-color: var(--paper-highlight);
    padding: 40px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(11, 58, 61, 0.1);
}

h1 {
    font-family: 'League Spartan', sans-serif;
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--coral-primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

h2 {
    font-family: 'League Spartan', sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: var(--coral-primary);
    margin-bottom: 20px;
}

.lead {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 25px;
    line-height: 1.8;
}

.lead strong {
    color: var(--coral-primary);
    font-weight: 600;
}

blockquote {
    border-left: 4px solid var(--coral-secondary);
    padding-left: 25px;
    margin: 25px 0;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.8;
}

cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 600;
    color: var(--deep-teal);
}

/* Math Breakdown */
.math-breakdown {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
}

.math-item {
    text-align: center;
    padding: 20px;
    background-color: var(--bg-aqua-alt);
    border-radius: 10px;
    min-width: 150px;
}

.math-item.highlight {
    background-color: var(--coral-primary);
    color: white;
}

.math-number {
    font-family: 'League Spartan', sans-serif;
    font-weight: 900;
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 10px;
}

.math-item.highlight .math-number {
    color: white;
}

.math-label {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.math-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

.math-plus, .math-equals {
    font-family: 'League Spartan', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--coral-primary);
}

/* Zip Code Form */
.zip-form {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

#zip-code {
    flex: 1;
    min-width: 200px;
    padding: 15px 20px;
    font-size: 1.1rem;
    font-family: 'Inter', sans-serif;
    border: 2px solid var(--coral-secondary);
    border-radius: 8px;
    background-color: white;
    color: var(--deep-teal);
}

#zip-code:focus {
    outline: none;
    border-color: var(--coral-primary);
    box-shadow: 0 0 0 3px rgba(232, 93, 72, 0.1);
}

.cta-button {
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background-color: var(--coral-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.cta-button:hover {
    background-color: var(--coral-secondary);
    transform: translateY(-2px);
}

.cta-button:active {
    transform: translateY(0);
}

.secondary-button {
    background: transparent;
    border: 2px solid var(--coral-primary);
    color: var(--coral-primary);
    padding: 10px 16px;
    font-size: 0.95rem;
}

.secondary-button:hover {
    background: var(--coral-primary);
    color: #ffffff;
}

.district-results {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-aqua-alt);
    border-radius: 8px;
    display: none;
}

.district-results.show {
    display: block;
}

.district-map {
    margin-top: 20px;
    height: 360px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e3f0f2;
    display: none;
}

.district-map.show {
    display: block;
}

.district-map-legend {
    margin-top: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.9rem;
    color: var(--deep-teal);
}

.district-map-legend.show {
    display: flex;
}

.legend-swatch {
    width: 120px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #d62728, #7b2cbf, #1f77b4);
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--deep-teal);
    font-weight: 600;
}

.toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #c6e3e8;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(15, 45, 55, 0.2);
    transition: transform 0.2s ease;
}

.toggle input:checked + .toggle-slider {
    background: var(--coral-primary);
}

.toggle input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    white-space: nowrap;
}

.district-list-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--deep-teal);
    font-weight: 600;
    margin-bottom: 16px;
}

.district-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.district-list-item {
    display: grid;
    grid-template-columns: 50px 1fr 100px;
    gap: 16px;
    align-items: center;
    background: var(--bg-aqua-alt);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(15, 45, 55, 0.08);
    box-shadow: 0 6px 14px rgba(10, 37, 46, 0.08);
}

.district-rank {
    font-weight: 700;
    color: var(--deep-teal);
    font-size: 1.1rem;
}

.district-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--deep-teal);
}

.district-subtitle {
    font-size: 0.85rem;
    color: #4a6c75;
    margin-top: 4px;
}

.district-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #35525a;
}

.district-subtitle .seat-label {
    font-weight: 600;
    color: #1f4f5a;
}

.district-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.score-pill {
    min-width: 56px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 8px rgba(15, 45, 55, 0.15);
}

.score-label {
    font-size: 0.75rem;
    color: #4a6c75;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.district-list-item:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 18px rgba(10, 37, 46, 0.12);
}

.district-result-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.district-result-card h3 {
    color: var(--coral-primary);
    font-family: 'League Spartan', sans-serif;
    font-weight: 800;
    font-size: 1.8rem;
    margin-bottom: 20px;
    text-align: center;
}

.district-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: var(--bg-aqua-alt);
    border-radius: 6px;
}

.info-item.highlight {
    background-color: var(--coral-primary);
    color: white;
    font-weight: 600;
}

.info-label {
    font-weight: 600;
    color: var(--deep-teal);
}

.info-item.highlight .info-label {
    color: white;
}

.info-value {
    font-weight: 700;
    color: var(--coral-primary);
}

.info-item.highlight .info-value {
    color: white;
}

.purple-score-very-competitive {
    color: #8B008B !important; /* Purple */
}

.purple-score-competitive {
    color: #9370DB !important; /* Medium purple */
}

.purple-score-moderate {
    color: #BA55D3 !important; /* Light purple */
}

.purple-score-safe {
    color: #DDA0DD !important; /* Very light purple */
}

.score-bar-container {
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, #9370DB 0%, #8B008B 100%);
    transition: width 0.5s ease;
    border-radius: 15px;
}

.very-competitive {
    color: #8B008B;
    font-weight: 700;
}

.competitive {
    color: #9370DB;
    font-weight: 600;
}

.moderate {
    color: #BA55D3;
    font-weight: 600;
}

.safe {
    color: #666;
    font-weight: 500;
}

.district-message {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--bg-aqua-alt);
    border-radius: 8px;
    font-style: italic;
    color: var(--deep-teal);
    text-align: center;
}

.districts-list {
    margin-top: 20px;
}

.coming-soon {
    padding: 20px;
    background-color: var(--bg-aqua-alt);
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    color: var(--deep-teal);
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--deep-teal);
    font-size: 0.9rem;
}

footer a {
    color: var(--coral-primary);
    font-weight: 600;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-divider {
    margin: 0 8px;
    color: var(--deep-teal);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-number {
        font-size: 5rem;
    }
    
    .logo-free {
        font-size: 4rem;
    }
    
    .logo-and {
        font-size: 1.5rem;
        top: -15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .content-box {
        padding: 25px;
    }
    
    .math-breakdown {
        flex-direction: column;
    }
    
    .math-plus, .math-equals {
        transform: rotate(90deg);
    }
    
    .zip-form {
        flex-direction: column;
    }
    
    #zip-code {
        width: 100%;
    }
    
    .cta-button {
        width: 100%;
    }
}
