/* Healthcare Access Visualization - Teevial Styling */
/* Matches Cultureproj: color coding (#0A1032), data-story language, comprehensive visualizations */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Noto+Sans+Armenian:wght@300;400;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: #f8f9fa;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lato', sans-serif;
}

/* Navbar - Teevial Dark Blue (#0A1032) */
.navbar {
    background-color: #0A1032 !important;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.navbar .navbar-brand,
.navbar .nav-link {
    color: #ffffff !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #cccccc !important;
}

.navbar .nav-link.active {
    color: #ffffff !important;
    font-weight: normal;
}

.navbar-logo {
    height: 40px;
    width: auto;
}

/* Content Layout */
.quarto-container {
    padding-top: 80px;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.page-section {
    min-height: 100vh;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow-x: hidden;
    padding: 2rem;
}

/* Page Navigation Dots */
.page-dots {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.page-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(10, 16, 50, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(10, 16, 50, 0.6);
}

.page-dot:hover {
    background: rgba(10, 16, 50, 0.7);
    transform: scale(1.2);
}

.page-dot.active {
    background: #0A1032;
    border-color: #0A1032;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(10, 16, 50, 0.5);
}

/* Page 0: Introduction */
#intro-page {
    background: #ffffff;
    color: #333;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
}

.intro-content {
    max-width: 900px;
    margin: 0 auto;
}

.intro-title {
    font-family: 'Lato', sans-serif;
    font-size: 2.5rem;
    color: #0A1032;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

.intro-subtitle {
    font-size: 1.15rem;
    color: #555;
    max-width: 780px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.intro-author {
    font-size: 0.95rem;
    color: #777;
    margin: 0 auto 1.25rem;
    font-style: italic;
}

.intro-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

/* Page Headers & Data Story Bubbles */
.page-header {
    text-align: center;
    padding: 3rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header h2 {
    font-family: 'Lato', sans-serif;
    font-size: 2.5rem;
    color: #0A1032;
    margin-bottom: 1rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.section-intro {
    font-size: 1.1rem;
    font-family: 'Lato', sans-serif;
    color: #555;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.analytical-text {
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    color: #444;
    line-height: 1.65;
    max-width: 820px;
    margin: 0 auto 1.5rem;
}

/* Stat Cards - Dark Blue Gradient */
.analysis-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    width: 100%;
}

.stat-card {
    background: linear-gradient(135deg, #0A1032 0%, #1a2342 100%);
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    color: white;
    box-shadow: 0 5px 20px rgba(10, 16, 50, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(10, 16, 50, 0.3);
}

.stat-card h4 {
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.stat-card .value {
    font-size: 3rem;
    font-weight: 700;
    margin: 0.5rem 0;
    color: white;
}

.stat-card .label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Highlight Box - Critical Finding */
.highlight-box {
    background: #ffffff;
    border: 2px solid #0A1032;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.15);
}

.highlight-box h4 {
    color: #0A1032;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: 'Lato', sans-serif;
}

.highlight-box p,
.highlight-box ul {
    color: #333;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
    font-family: 'Lato', sans-serif;
}

.highlight-box strong {
    color: #0A1032;
}

/* Map Wrapper (legend overlays map) */
#map-container-full {
    position: relative;
}

/* Map Container & Legend */
#map-container,
.map-container {
    width: 90%;
    max-width: 1400px;
    height: 70vh;
    min-height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    margin: 2rem auto;
    border: 1px solid #e0e0e0;
}

.map-legend {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid #0A1032;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.2);
    z-index: 1000;
    min-width: 200px;
}

.legend-title {
    font-weight: 600;
    color: #0A1032;
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    text-align: center;
    font-family: 'Lato', sans-serif;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #333;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.legend-label {
    font-family: 'Lato', sans-serif;
    font-size: 0.85rem;
}

/* Map Controls & Metric Selector */
.map-controls {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.1);
    margin: 0 auto 1.5rem;
    max-width: 1400px;
    border: 1px solid #e0e0e0;
}

.metric-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.metric-selector label {
    font-weight: 600;
    color: #0A1032;
    font-family: 'Lato', sans-serif;
}

.metric-selector select {
    padding: 0.6rem 1.25rem;
    border: 2px solid #0A1032;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    color: #0A1032;
    font-family: 'Lato', sans-serif;
}

.metric-selector select:hover,
.metric-selector select:focus {
    background: rgba(10, 16, 50, 0.05);
}

/* Chart Containers - Comprehensive Analysis Style */
.chart-container,
#analysis-chart-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.chart-wrapper {
    width: 100%;
}

.chart-wrapper h3,
.chart-container h3 {
    color: #0A1032;
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.5rem;
    font-family: 'Lato', sans-serif;
}

.chart-subtitle,
.chart-caption {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

/* Chart Description - Data Story Box (Dark Blue) */
.chart-description {
    font-family: 'Lato', sans-serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.6;
    color: white;
    padding: 1.5rem;
    background: linear-gradient(135deg, #0A1032 0%, #1a2342 100%);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.3);
    margin-top: 1.5rem;
}

.chart-description p {
    margin: 0 0 0.75rem 0;
    color: rgba(255, 255, 255, 0.95);
}

.chart-description p:last-child {
    margin-bottom: 0;
}

.chart-description strong {
    color: #ffffff;
    font-weight: 600;
}

/* Narrative Content */
.narrative-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    font-family: 'Lato', sans-serif;
}

.narrative-content p {
    margin-bottom: 1.25rem;
}

.narrative-content h3 {
    color: #0A1032;
    font-size: 1.75rem;
    margin: 2.5rem 0 1rem;
    font-weight: 600;
}

/* Policy Section */
.policy-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #0A1032;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.1);
}

.policy-section h3 {
    color: #0A1032;
    margin-bottom: 1.25rem;
    font-family: 'Lato', sans-serif;
}

.policy-section ul {
    margin-left: 1.5rem;
}

.policy-section li {
    margin: 0.75rem 0;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
}

.policy-section li strong {
    color: #0A1032;
}

/* Footer */
.project-footer {
    background: #ffffff;
    padding: 1.25rem 2rem;
    text-align: center;
    color: #000000;
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 5;
}

.footer-text {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    font-weight: normal;
    font-family: 'Lato', sans-serif;
}

.footer-author {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.02em;
}

/* Map Page Background */
#map-page {
    background: #f8f9fa;
    color: #333;
}

#findings-page,
#analysis-page {
    background: #ffffff;
    color: #333;
    padding: 4rem 2rem;
}

#policy-page {
    background: #f8f9fa;
    color: #333;
    padding: 4rem 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .intro-title {
        font-size: 2rem !important;
    }

    .intro-description {
        font-size: 0.95rem !important;
    }

    .page-dots {
        right: 15px;
        gap: 10px;
    }

    .page-dot {
        width: 10px;
        height: 10px;
    }

    .page-header h2 {
        font-size: 2rem;
    }

    #map-container,
    .map-container {
        width: 95%;
        height: 60vh;
    }

    .map-legend {
        top: 10px;
        right: 10px;
        padding: 0.75rem 1rem;
        min-width: 160px;
        font-size: 0.8rem;
    }

    .stat-card .value {
        font-size: 2.25rem;
    }
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #0A1032;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #141a3a;
}

/* Chart tooltip (D3) */
.chart-tooltip {
    position: fixed;
    padding: 10px 14px;
    background: rgba(10, 16, 50, 0.95);
    color: #fff;
    border: 2px solid #0A1032;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
}

.chart-tooltip strong {
    color: #fff;
}

/* Data panel - explore by region */
.data-panel {
    background: linear-gradient(135deg, #0A1032 0%, #1a2342 100%);
    border: 2px solid #0A1032;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    color: #fff;
    min-width: 240px;
    box-shadow: 0 4px 15px rgba(10, 16, 50, 0.3);
}

.data-panel h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    font-family: 'Lato', sans-serif;
}

.data-panel .region-select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    cursor: pointer;
}

.data-panel .region-select option {
    background: #1a2342;
    color: #fff;
}

.data-panel .metric-row {
    display: flex;
    justify-content: space-between;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.data-panel .metric-row:last-child {
    border-bottom: none;
}

.data-panel .metric-value {
    font-weight: 600;
    color: #fff;
}

.data-panel .hint {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Chart containers for D3 */
.chart-svg-container {
    width: 100%;
    min-height: 360px;
    margin: 1rem 0;
}
