:root {
    --primary-red: #c41e3a;
    --primary-black: #1a1a1a;
    --soft-green: #2d5016;
    --soft-white: #f8f9fa;
    --text-dark: #2d2d2d;
    --text-light: #666666;
    --bg-light: #ffffff;
    --border-color: #e0e0e0;
    --navbar-height: 60px;
}

body.dark-mode {
    --bg-light: #1a1a1a;
    --soft-white: #2d2d2d;
    --text-dark: #ffffff;
    --text-light: #cccccc;
    --border-color: #444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

.navbar {
    background: var(--primary-black);
    color: white;
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

body.map-page .navbar {
    position: relative;
    z-index: 5;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.85rem;
    color: var(--primary-red);
    font-weight: bold;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-red);
}

.hero {
    background: white;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(26, 26, 26, 0.02) 35px, rgba(26, 26, 26, 0.02) 70px);
    color: var(--primary-black);
    padding: 5rem 2rem 4.5rem;
    text-align: center;
    border-bottom: 5px solid var(--primary-red);
}

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

.hero-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    letter-spacing: 3px;
    color: var(--primary-black);
}

.hero-underline {
    width: 150px;
    height: 4px;
    background: var(--primary-red);
    margin: 0 auto 1.5rem;
}

.hero-subtitle {
    font-size: 1.6rem;
    color: var(--primary-red);
    margin-bottom: 1.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.hero-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.75rem;
    color: var(--text-dark);
}

.independence-notice {
    font-size: 0.82rem;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary-red);
    background: var(--soft-white);
    padding: 0.65rem 1rem;
    border-radius: 4px;
    margin-bottom: 2rem;
    text-align: left;
    line-height: 1.6;
}

.cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.cta-button {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 0.9rem 2.5rem;
    font-size: 1.05rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    border: 2px solid var(--primary-red);
    letter-spacing: 0.5px;
}

.cta-button:hover {
    background: var(--primary-black);
    border-color: var(--primary-black);
}

.cta-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.phases {
    padding: 4rem 2rem;
    background: var(--soft-white);
}

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

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-black);
}

.phase-card {
    background: white;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative;
    border-left: 5px solid var(--primary-red);
}

.phase-number {
    position: absolute;
    top: -15px;
    left: 2rem;
    background: var(--primary-red);
    color: white;
    padding: 0.5rem 1rem;
    font-weight: bold;
    border-radius: 5px;
}

.phase-card h3 {
    font-size: 1.8rem;
    margin: 1rem 0;
    color: var(--primary-black);
}

.phase-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.phase-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.phase-status.completed {
    background: #d4edda;
    color: #155724;
}

.phase-status.in-progress {
    background: #fff3cd;
    color: #856404;
}

.phase-status.coming-soon {
    background: #d1ecf1;
    color: #0c5460;
}

.phase-button {
    display: inline-block;
    background: var(--primary-black);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.phase-button:hover {
    background: var(--primary-red);
}

.phase-button.disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.principles {
    padding: 4rem 2rem;
    background: white;
}

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

.principle-item {
    text-align: center;
    padding: 2rem;
    background: var(--soft-white);
    border-radius: 10px;
    transition: transform 0.3s;
}

.principle-item:hover {
    transform: translateY(-5px);
}

.principle-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    color: var(--primary-red);
}

.principle-icon svg {
    width: 100%;
    height: 100%;
}

.principle-item h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-black);
}

.principle-item p {
    color: var(--text-light);
}

.page-content {
    padding: 4rem 2rem;
    min-height: 60vh;
}

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

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.coming-soon-box {
    background: var(--soft-white);
    padding: 3rem;
    border-radius: 10px;
    margin-bottom: 3rem;
    border-left: 5px solid var(--primary-red);
}

.coming-soon-box h2 {
    color: var(--primary-red);
    margin-bottom: 1.5rem;
}

.mission-statement {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 2rem;
    font-weight: 500;
}

.coming-soon-box h3 {
    margin: 2rem 0 1rem 0;
    color: var(--primary-black);
}

.coming-soon-box ul {
    margin-left: 2rem;
    color: var(--text-light);
}

.coming-soon-box ul li {
    margin: 0.8rem 0;
    line-height: 1.6;
}

.coming-soon-text {
    margin-top: 2rem;
    font-weight: bold;
    color: var(--primary-red);
    font-size: 1.1rem;
}

.stats-container {
    background: white;
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stats-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--primary-black);
}

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

.stat-box {
    text-align: center;
    padding: 2rem;
    background: var(--soft-white);
    border-radius: 10px;
    border: 3px solid var(--border-color);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: translateY(-5px);
}

.stat-box.verified {
    border-color: var(--soft-green);
    background: #f0f8f0;
}

.stat-box.unverified {
    border-color: var(--primary-red);
    background: #fff5f5;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-black);
    margin-bottom: 0.5rem;
}

.stat-label {
    display: block;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.stat-percentage {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-red);
}

.stat-box.verified .stat-percentage {
    color: var(--soft-green);
}

.resource-section {
    margin-bottom: 3rem;
}

.resource-section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-black);
    border-bottom: 3px solid var(--primary-red);
    padding-bottom: 0.5rem;
}

.resource-card {
    background: white;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-red);
}

.resource-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-black);
}

.resource-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.resource-button {
    display: inline-block;
    background: var(--primary-red);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.3s;
}

.resource-button:hover {
    background: var(--primary-black);
}

.resource-button.external::after {
    content: ' ↗';
}

.info-box {
    background: var(--soft-white);
    padding: 2rem;
    border-radius: 10px;
    border-left: 5px solid var(--soft-green);
}

.info-box h3 {
    color: var(--primary-black);
    margin: 1.5rem 0 0.5rem 0;
}

.info-box h3:first-child {
    margin-top: 0;
}

.info-box p {
    color: var(--text-light);
    line-height: 1.8;
}

.footer {
    background: var(--primary-black);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

.footer p {
    margin: 0.5rem 0;
}

.footer a {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: bold;
}

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

body.map-page {
    overflow: hidden;
}

#map { 
    position: absolute; 
    top: var(--navbar-height);
    bottom: 0; 
    left: 0;
    right: 0;
    width: 100%; 
}

.controls {
    position: absolute;
    top: calc(var(--navbar-height) + 10px);
    left: 10px;
    background: var(--bg-light);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 10;
    max-width: 300px;
    max-height: calc(100vh - var(--navbar-height) - 20px);
    overflow-y: auto;
    transition: background 0.3s;
}

.controls h2 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #2E75B6;
}

.controls input[type="text"] {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-sizing: border-box;
    background: var(--bg-light);
    color: var(--text-dark);
}

.controls select {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    background: var(--bg-light);
    color: var(--text-dark);
}

.controls button {
    width: 100%;
    padding: 10px;
    background: #2E75B6;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 5px;
}

.controls button:hover {
    background: #1f5a8a;
}

.boundary-toggles {
    margin: 15px 0;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.boundary-toggles label {
    display: block;
    margin: 8px 0;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-dark);
}

.boundary-toggles input[type="checkbox"] {
    margin-right: 8px;
}

.view-toggles {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.view-toggle-btn {
    width: 48%;
    padding: 8px;
    background: #6c757d;
    font-size: 12px;
}

.view-toggle-btn:hover {
    background: #5a6268;
}

.export-buttons {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.export-btn {
    width: 48%;
    padding: 8px;
    background: #28a745;
    font-size: 12px;
}

.export-btn:hover {
    background: #218838;
}

.side-panel {
    position: absolute;
    top: var(--navbar-height);
    right: -400px;
    width: 400px;
    height: calc(100vh - var(--navbar-height));
    background: var(--bg-light);
    box-shadow: -2px 0 10px rgba(0,0,0,0.2);
    z-index: 10;
    transition: right 0.3s, background 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.side-panel.open {
    right: 0;
}

.panel-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-light);
}

.panel-header h3 {
    margin: 0;
    color: #2E75B6;
}

.close-panel {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.station-list {
    flex: 1;
    padding: 10px;
}

.station-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.station-item:hover {
    background: var(--soft-white);
}

.station-item h4 {
    margin: 0 0 5px 0;
    color: #2E75B6;
}

.station-item p {
    margin: 3px 0;
    font-size: 14px;
    color: var(--text-light);
}

.pagination {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--soft-white);
    flex-wrap: wrap;
}

.pagination button {
    padding: 8px 12px;
    background: #2E75B6;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination button:hover:not(:disabled) {
    background: #1f5a8a;
}

.pagination .page-number {
    padding: 8px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
}

.pagination .page-number.active {
    background: #2E75B6;
    color: white;
    border-color: #2E75B6;
}

.pagination .page-ellipsis {
    padding: 8px 4px;
    color: var(--text-light);
}

.map-info-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-light);
    border-top: 2px solid var(--border-color);
    z-index: 15;
    transition: transform 0.3s, background 0.3s;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.map-info-bar.collapsed {
    transform: translateY(100%);
}

.info-bar-toggle {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 6px 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-dark);
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.info-bar-toggle:hover {
    background: var(--soft-white);
}

.info-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    gap: 20px;
}

.stats {
    flex: 1;
}

.stats p {
    margin: 3px 10px 3px 0;
    font-size: 13px;
    color: var(--text-dark);
    display: inline-block;
}

.legend {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-dark);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin: 3px 10px 3px 0;
    font-size: 12px;
    color: var(--text-dark);
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #fff;
}

.help-btn {
    position: absolute;
    top: calc(var(--navbar-height) + 10px);
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2E75B6;
    color: white;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.help-btn:hover {
    background: #1f5a8a;
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.help-modal.active {
    display: flex !important;
}

.help-content {
    background: var(--bg-light);
    padding: 30px;
    border-radius: 10px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}



.close-help {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-dark);
}

.help-content h2 {
    margin-top: 0;
    color: #2E75B6;
}

.help-section {
    margin: 20px 0;
}

.help-section h3 {
    color: #2E75B6;
    margin-bottom: 10px;
}

.help-section p {
    color: var(--text-dark);
    line-height: 1.6;
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-light);
    padding: 20px 40px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2E75B6;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-red);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    align-items: center;
    justify-content: center;
}

.mobile-filter-toggle:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    :root {
        --navbar-height: 56px;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-black);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s;
    }

    .nav-links.active {
        max-height: 300px;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-links a {
        display: block;
        padding: 1rem 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .principles-grid {
        grid-template-columns: 1fr;
    }

    .phase-card {
        padding: 2rem 1.5rem;
    }

    body.map-page .controls {
        left: -320px;
        top: calc(var(--navbar-height) + 8px);
        max-height: calc(100vh - var(--navbar-height) - 16px);
        z-index: 25;
        transition: left 0.3s, background 0.3s;
        width: 290px;
    }

    body.map-page .controls.mobile-open {
        left: 10px;
    }

    .export-buttons,
    .view-toggles {
        display: none;
    }

    .controls-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 24;
    }

    .controls-backdrop.active {
        display: block;
    }

    .mobile-filter-toggle {
        display: flex !important;
        position: fixed;
        bottom: 80px;
        right: 20px;
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: var(--primary-red);
        color: white;
        border: none;
        font-size: 20px;
        cursor: pointer;
        z-index: 20;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        align-items: center;
        justify-content: center;
    }

    .side-panel {
        width: 100%;
        right: -100%;
    }

    .side-panel-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 9;
    }

    .side-panel-backdrop.active {
        display: block;
    }

    .info-bar-content {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
    }

    .stats p {
        font-size: 12px;
        margin: 3px 0;
    }

    .legend h3 {
        font-size: 12px;
    }

    .legend-item {
        font-size: 11px;
    }

    .legend-color {
        width: 12px;
        height: 12px;
    }

    .info-bar-toggle {
        font-size: 12px;
        padding: 6px 12px;
    }

    .help-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .help-content {
        margin: 20px;
        max-width: calc(100% - 40px);
    }

    .map-info-bar.collapsed {
        transform: translateY(100%);
    }
}