body {
    background: #1f2230;
    color: #e1e3e8;
    font-family: Mulish, sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 90px;
}

.navbar {
    background-color: #2f3445;
    min-height: 90px;
    padding: 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
    transition: transform 0.3s ease-in-out;
    will-change: transform;
}

.navbar--hidden {
    transform: translateY(-100%);
}

.navbar-brand {
    padding: 0.5rem;
}

.navbar-brand img {
    max-height: 80px;
    width: auto;
    display: block;
}

.navbar-collapse {
    justify-content: center;
}

.navbar-nav {
    align-items: center;
}

.content {
    padding-top: 20px;
    max-width: 100%;
}

/* top card layout for single card */
.top-cards-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: stretch;
    flex-wrap: wrap;
}

.card-chart {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #2f3445;
    min-height: 200px;
}

.card-chart .card-body {
    flex-grow: 1;
}

/* combined legend and controls card styling */
.legend-controls-card {
    width: 100%;
    background-color: #2f3445;
    display: flex;
    flex-direction: column;
}

.legend-controls-card .card-header {
    background-color: #2f3445;
    text-align: center;
    padding: 15px 20px;
    border-bottom: 1px solid #404759;
}

.legend-controls-card .card-body {
    display: flex;
    gap: 30px;
    padding: 25px;
    align-items: stretch;
    min-height: 180px;
}

.legend-container {
    flex: 0 0 400px;
    background-color: #2f3445;
    border-radius: 8px;
    padding: 0;
    border: 1px solid #404759;
    overflow: hidden;
}

.legend-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    border-radius: 8px;
    margin: 0;
    padding: 0;
}

.controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background-color: #2f3445;
    border-radius: 8px;
    border: 1px solid #404759;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group label {
    color: #e1e3e8;
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.control-description {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 5px;
    line-height: 1.4;
}

.controls-container select,
#selectRegimeType {
    background-color: #000;
    color: #fff;
    border: 1px solid #5c5c5c;
    padding: 8px 12px;
    font-family: Mulish, sans-serif;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
}

.controls-container select:focus,
#selectRegimeType:focus {
    outline: none;
    border-color: #ffffff;
}

.controls-container select option,
#selectRegimeType option {
    background: #2f3445;
    color: #fff;
}

@media (max-width: 968px) {
    .legend-controls-card .card-body {
        flex-direction: column;
        gap: 20px;
    }

    .legend-container {
        flex: none;
        order: 2;
    }

    .legend-container iframe {
        height: 120px;
    }

    .controls-container {
        flex: none;
        order: 1;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .content {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .legend-controls-card .card-body {
        padding: 20px 15px;
    }

    .controls-container {
        padding: 15px;
    }

    .controls-container select,
    #selectRegimeType {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .legend-container iframe {
        height: 100px;
    }

    .controls-container select {
        font-size: 13px;
        padding: 6px 10px;
    }

    .control-description {
        font-size: 12px;
    }
}

text {
    font-size: 13px;
}

#tooltip {
    position: absolute;
    text-align: center;
    padding: 12px 16px;
    font: 13px sans-serif;
    color: #fff;
    background: rgba(47, 52, 69, 0.95);
    border: 1px solid #5c5c5c;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: opacity 0.2s ease;
}

#map-detail {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2f3445;
    border: 1px solid #5c5c5c;
    border-radius: 12px;
    padding: 0;
    z-index: 9999;
    max-height: 90vh;
    max-width: 95vw;
    min-width: 800px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

#map-detail .modal-header {
    background: #3a4056;
    padding: 20px 25px;
    border-bottom: 1px solid #5c5c5c;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#map-detail .modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
}

#map-detail .modal-body {
    padding: 0;
    background: #2f3445;
    position: relative;
}

#world-map {
    width: 100%;
    height: 500px;
    background: #2f3445;
}

.country-path {
    stroke: #404759;
    stroke-width: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.country-path:hover {
    stroke-width: 1.5px;
    stroke: #ffffff;
}

.country-highlighted {
    stroke: #ffffff;
    stroke-width: 1.5px;
}

.country-info {
    padding: 15px 25px;
    border-top: 1px solid #5c5c5c;
    color: #e1e3e8;
    font-size: 14px;
}

#map-detail .close-btn {
    background: #5775b3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

#map-detail .close-btn:hover {
    background-color: #4662a0;
}

#chart-detail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(47, 52, 69, 0.95);
    z-index: 9999;
}

#chart-detail h3 {
    color: #fff;
    margin-left: 20px;
    margin-top: 10px;
}

#chart-detail button {
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    padding: 6px 12px;
    background-color: #5775b3;
    color: white;
    border: none;
    border-radius: 4px;
}

#chart-detail button:hover {
    background-color: #4662a0;
}

.x-axis text {
    fill: white;
    font-size: 12px;
}

.x-axis line,
.x-axis path {
    stroke: white;
}

@media (max-width: 600px) {
    .page-title {
        font-size: 1.4rem;
    }

    #map-detail {
        min-width: 95vw;
        max-width: 95vw;
        max-height: 95vh;
    }

    #world-map {
        height: 400px;
    }
}

/* Chrome, Edge, Safari */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
