/* Global Vars */
:root {
    --primary: #1e3a8a;
    /* Dark Blue */
    --accent: #2563eb;
    /* Bright Blue */
    --accent-light: #eff6ff;
    --text: #1e293b;
    --text-light: #64748b;
    --bg: #f8fafc;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #ca8a04;
    --card-bg: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--primary);
    margin-top: 0;
    line-height: 1.3;
}

h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--accent);
    padding-left: 1rem;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* Container */
.container {
    max-width: 900px;
    /* Slightly wider for charts */
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, #172554 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

header h1 {
    color: white;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

header svg.bg-art {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.05;
    width: 600px;
    height: 600px;
    pointer-events: none;
    z-index: 1;
}

/* Sections */
section {
    background: var(--card-bg);
    margin-bottom: 40px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

/* --- TIMELINE COMPONENT --- */
.timeline {
    position: relative;
    padding: 20px 0;
    margin: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    /* Adjust for icon width */
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 30px;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.timeline-content {
    background: var(--accent-light);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #bfdbfe;
}

.timeline-content h4 {
    margin-bottom: 5px;
    color: var(--primary);
}

.timeline-content p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-light);
}

/* --- CARD GRID --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    /* Indicates clickable for modal */
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.card h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card .icon-corner {
    color: var(--accent);
    width: 24px;
    height: 24px;
}

/* --- CHARTS (CSS Only) --- */
.chart-container {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.bar-chart-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.bar-label {
    width: 120px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
}

.bar-track {
    flex-grow: 1;
    background: #f1f5f9;
    height: 24px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: var(--accent);
    width: 0;
    /* JS handles this */
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
}

.bar-fill.negative {
    background: var(--danger);
}

.bar-fill.positive {
    background: var(--success);
}

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 700px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    /* Using vh mostly safe for fixed overlays, usually */
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: background 0.2s;
}

.close-modal:hover {
    background: #e2e8f0;
    color: var(--danger);
}

/* --- BUTTONS --- */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 15px;
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

/* --- SVG ICONS --- */
.icon-inline {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
}

/* --- ANIMATIONS --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    header {
        padding: 40px 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .timeline::before {
        left: 15px;
    }

    .timeline-item {
        padding-left: 50px;
    }

    .timeline-icon {
        width: 32px;
        height: 32px;
    }

    .bar-label {
        width: 100px;
        font-size: 0.8rem;
    }
}