@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/roboto-slab-v36-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Roboto Slab';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/roboto-slab-v36-latin-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/fira-sans-v18-latin-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: italic;
    font-weight: 400;
    src: url('fonts/fira-sans-v18-latin-italic.woff2') format('woff2');
}

@font-face {
    font-family: 'Fira Sans';
    font-style: normal;
    font-weight: 700;
    src: url('fonts/fira-sans-v18-latin-700.woff2') format('woff2');
}

h1,
h1.display-4 {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    color: #25282A;
}

h2 {
    font-family: 'Roboto Slab', serif;
    font-weight: 400;
    color: #25282A;
}

h3,
h4,
h5,
h6 {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    color: #25282A;
}

body {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 400;
    color: #25282A;
    background-color: #f8f9fa;
}

.text-container {
    max-width: 75ch;
    margin: 0 auto;
}

.chart-container-responsive {
    width: 100%;
    height: auto;
    position: relative;
    display: block;
}

.chart-container-responsive svg {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.chart-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    width: 100%;
    align-items: start;
}

.chart-grid-separator {
    display: none;
}

@media (min-width: 992px) {
    .chart-grid-2 {
        grid-template-columns: 1fr 1px 1fr;
        gap: 0;
    }

    .chart-grid-item {
        padding: 0 1rem;
    }

    .chart-grid-separator {
        display: block;
        width: 1px;
        height: 100%;
        min-height: 400px;
        background-color: #dee2e6;
        opacity: 0.5;
        margin: 0 auto;
    }
}

.map-container-responsive {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 700;
    overflow: hidden;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.map-container-responsive svg,
.map-container-responsive canvas {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.map-container-responsive .zoom-controls-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chart-theme-universal .axis path,
.chart-theme-universal .axis line {
    display: none;
}

.chart-theme-universal .grid line {
    display: block !important;
    stroke: #a8a8a8;
    stroke-opacity: 0.7;
    stroke-dasharray: 4, 4;
}

.chart-theme-universal .grid path {
    display: none;
}

.chart-theme-universal .axis-x path.domain {
    display: block !important;
    stroke: #333;
    stroke-width: 2px;
}

.chart-theme-universal .axis-x .tick line {
    display: block !important;
    stroke: #666;
    stroke-width: 2px;
}

.chart-theme-universal text {
    font-family: 'Fira Sans', sans-serif;
    fill: #25282A;
}

.chart-theme-universal .axis text {
    font-size: 16px;
    font-weight: 500;
    fill: #444;
}

.chart-theme-universal .line-path {
    fill: none;
    stroke-width: 3px;
    stroke-linecap: round;
    filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.1));
    transition: opacity 0.3s ease;
}

.year-ticker {
    font-family: 'Roboto Slab', serif;
    font-size: 140px;
    font-weight: 700;
    fill: #e0e0e0;
    text-anchor: end;
    opacity: 0.5;
    pointer-events: none;
}

.chart-header {
    display: block;
}

.chart-title {
    font-family: 'Roboto Slab', serif;
    font-weight: 700;
    font-size: 1.4rem;      
    color: #25282A;         
    margin-bottom: 0.25rem; 
    line-height: 1.2;
}

.chart-subtitle {
    font-family: 'Fira Sans', sans-serif;
    font-weight: 400;
    font-style: italic;    
    font-size: 1rem;        
    color: #6c757d;        
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .chart-title {
        font-size: 1.25rem;
    }
    .chart-subtitle {
        font-size: 0.9rem;
    }
}

.shared-tooltip {
    position: absolute;
    visibility: hidden;
    font-family: 'Fira Sans', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 3000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    white-space: normal;
}

.tooltip-header {
    font-weight: 700;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 4px;
    margin-bottom: 8px;
    font-size: 13px;
    display: block;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    margin-bottom: 3px;
    font-size: 13px;
}

.tooltip-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooltip-bullet {
    font-size: 16px;
    line-height: 0;
}

.tooltip-value {
    font-weight: 700;
    color: #25282A;
    font-variant-numeric: tabular-nums;
}

.tooltip-row.dimmed {
    opacity: 0.3;
}

.chart-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    border-radius: 8px;
}

.loader-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #444;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

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

.compact-menu-bar {
    position: relative;
    margin: 0 auto;
    background-color: #ffffff;
    padding: 8px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    max-width: fit-content;
}

.compact-menu-bar.fluid-width {
    max-width: 90%;
    width: auto;
}

.compact-group {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    position: relative;
}

.compact-label {
    font-size: 10px;
    text-transform: uppercase;
    color: #999;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.compact-select {
    border: none;
    background-color: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 0;
    width: 100%;
    cursor: pointer;
    background-position: right 0 center;
    background-size: 10px auto;
}

.compact-divider {
    width: 1px;
    height: 35px;
    background-color: #eee;
    margin: 0 10px;
}

.btn-compact {
    background: none;
    border: none;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 600;
    font-size: 14px;
    color: #999;
    cursor: pointer;
    padding: 0 15px;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    width: 100%;
    text-align: center;
    margin: 0;
}

.btn-compact:hover {
    color: #555;
}

.btn-compact.active {
    color: #25282A;
    font-weight: 700;
}

@media (max-width: 768px) {
    .compact-menu-bar {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        justify-content: flex-start !important;
        width: fit-content !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        gap: 0px !important;
        padding: 4px 6px !important;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    .compact-menu-bar::-webkit-scrollbar {
        display: none;
    }

    .btn-compact,
    .compact-menu-bar label { 
        width: auto !important;
        flex: 0 0 auto !important;
        font-size: 11px !important;
        white-space: nowrap !important;
        padding: 6px 12px 10px 12px !important; 
        margin: 0 !important;
    }

    #filter-container .btn-compact::after,
    label[for="check-battles"]::after,
    label[for="check-explosions"]::after {
        bottom: 3px !important;
        width: 70% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        height: 3px !important;
    }

    .compact-divider {
        display: none !important;
    }
}

.btn-player {
    border-radius: 6px !important;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    height: 36px;
    transition: all 0.2s ease;
    background-color: #8a8e92;
    border: none;
}

.btn-player:hover {
    background-color: #515357 !important;
    box-shadow: 0 2px 5px rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.btn-player:active {
    background-color: #0a58ca;
    transform: translateY(0);
}

.chart-help-trigger {
    margin-top: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: fit-content;
}

.chart-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #484B4D;
    color: white;
    border-radius: 50%;
    font-family: serif;
    font-weight: bold;
    font-style: italic;
    font-size: 12px;
}

.chart-help-text {
    font-family: sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #484B4D;
}

.chart-help-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    pointer-events: none;
}

.chart-help-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #ddd;
    max-width: 700px;
    text-align: center;
    font-family: sans-serif;
}

.chart-help-divider {
    height: 2px;
    width: 50px;
    background: #C8102E;
    margin: 10px auto;
}

.chart-help-content ul {
    text-align: left;
    padding-left: 20px;
    line-height: 1.6;
    color: #484B4D;
    margin-top: 20px;
    margin-bottom: 0;
}

#zoom-controls,
#front-zoom-controls,
#spike-zoom-controls {
    position: absolute !important;
    top: 20px;
    right: 18px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: top 0.3s ease;
}

#zoom-controls .zoom-btn,
#front-zoom-controls .zoom-btn,
#spike-zoom-controls .zoom-btn {
    width: 36px;
    height: 36px;
    font-size: 18px;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-color: #fff9f9;
    border: 1px solid #ffffff;
    color: #000000;
    cursor: pointer;
}

@media (max-width: 768px) {
    #zoom-controls .zoom-btn,
    #front-zoom-controls .zoom-btn,
    #spike-zoom-controls .zoom-btn {
        width: 25px;
        height: 25px;
        font-size: 14px;
    }

    #zoom-controls,
    #front-zoom-controls,
    #spike-zoom-controls {
        top: 7px !important;
        right: 7px !important;
        gap: 3px !important;
    }
}

#controls {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 10px 16px !important;
}

#front-map-section #controls {
    width: 100%;
}

.custom-range-slider {
    height: 6px;
    margin-top: 0;
}

.custom-range-slider::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#current-date-display {
    font-size: 14px;
    color: #25282A;
}

#time-slider {
    position: relative;
    z-index: 20;
    background: transparent;
    width: 100%;
}

.timeline-tick {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 16px;
    background-color: #ffc107;
    border: 1px solid white;
    border-radius: 2px;
    cursor: pointer;
    z-index: 10;
    pointer-events: auto;
    transition: opacity 0.1s;
}

.timeline-tick:hover {
    transform: translateY(-50%) scale(1.3);
    background-color: #ff9800;
    z-index: 30;
}

#slider-ghost-thumb {
    transform: translateX(10px);
}

@media (min-width: 768px) {
    #time-slider {
        width: 180px !important;
    }
}

.universal-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 100%;
    padding: 0;
    list-style: none;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.legend-marker {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-text {
    font-family: 'Fira Sans', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.legend-item:not(.dimmed):hover .legend-text {
    color: #25282A;
}

.legend-item.dimmed {
    opacity: 0.3;
}

.legend-item.active .legend-text {
    color: #000;
    font-weight: 700;
}

@media (max-width: 768px) {
    .universal-legend {
        gap: 10px;
        row-gap: 5px;
    }

    .legend-item {
        padding: 2px 4px;
    }

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

label[for="check-battles"],
label[for="check-explosions"] {
    position: relative;
    opacity: 0.7;
    transition: color 0.2s ease, opacity 0.2s ease;
    border-bottom: none !important;
    padding-bottom: 10px;
}

label[for="check-battles"]::after,
label[for="check-explosions"]::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

label[for="check-battles"]:hover,
label[for="check-battles"].active,
label[for="check-explosions"]:hover,
label[for="check-explosions"].active {
    color: #25282A !important;
    font-weight: 700 !important;
    opacity: 1;
}

label[for="check-battles"]:hover::after,
label[for="check-battles"].active::after {
    background-color: #ff6361;
}

label[for="check-explosions"]:hover::after,
label[for="check-explosions"].active::after {
    background-color: #ffa600;
}

#filter-container .btn-compact {
    position: relative;
    opacity: 0.7;
    transition: color 0.2s ease, opacity 0.2s ease;
    padding-bottom: 10px;
}

#filter-container .btn-compact::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

#filter-container .btn-compact:hover,
#filter-container .btn-compact.active {
    color: #25282A !important;
    font-weight: 700 !important;
    opacity: 1;
}

#filter-container .btn-compact[data-type="Battles"]:hover::after,
#filter-container .btn-compact[data-type="Battles"].active::after {
    background-color: #ff6361;
}

#filter-container .btn-compact[data-type="Explosions/Remote violence"]:hover::after,
#filter-container .btn-compact[data-type="Explosions/Remote violence"].active::after {
    background-color: #ffa600;
}

#filter-container .btn-compact[data-type="all"]:hover::after,
#filter-container .btn-compact[data-type="all"].active::after {
    background-color: #333;
}

#sunburst-controls .btn-compact {
    flex-basis: 0;
    flex-grow: 1;
    min-width: 0;
    justify-content: center;
}

#sankey-controls .btn-compact {
    flex-basis: 0;
    flex-grow: 1;
    min-width: 0;
    justify-content: center;
}