/*Start index.html CSS*/

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
    position: relative;

    padding-bottom: 0;
    overflow: hidden;

}

#countryDropdown .country-flag {
    width: 24px;
    height: auto;
    margin-left: 8px;
    object-fit: contain;
}

body {
    overflow-x: hidden;
    /*font-family: Arial, sans-serif;*/
    background-color: #f5f5f5;
}

.sadc_logo img {
    /*width: 100%;*/
    height: 40px;
}

/* Layout styling */
.row {
    display: flex;
    flex-wrap: wrap;
}

.sidebar {
    padding: 30px;
    /*height: calc(100vh - 70px);*/
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Logo styling */
.logo {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    width: 100%;
    margin-bottom: 20px;
}

.logo img {
    max-width: 80%;
    height: auto;
    margin-bottom: 10px;
}

/* Country data card for when a country is selected - improved to match design */
.country-data-card {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 160, 210, 0.05);
    padding: 20px;
    width: 320px;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* close button on html card */

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.close-button:hover {
    background: #e0e0e0;
}

.close-button svg {
    width: 14px;
    height: 14px;
}

@keyframes slide-in {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.country-data-title {
    font-size: 24px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.country-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.country-stat {
    background: linear-gradient(145deg, #ffffff, #f5f5f5);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease;
}

.country-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #069edb;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 16px;
    color: #00a0d2;
    font-weight: 500;
}

.button-container {
    margin-top: 15px;
}

.button-container .btn {
    background: #069edb;
    border: none;
    border-radius: 8px;
    padding: 12px 0;
    color: white;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 10px rgba(0, 160, 210, 0.3);
}

.button-container .btn:hover {
    background: linear-gradient(135deg, #0090c0, #33b0b8);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 160, 210, 0.4);
}

/* Search styling - improved to match design */
/* Search styling - fixed to match design */
.search-container {
    position: relative;
    width: 100%;
    max-width: 315px;
    margin-bottom: 40px;
}

.search-container input {
    width: 100%;
    padding: 10px 10px 10px 45px;
    /*border: 2px solid #00aaff;*/
    border: none;
    border-radius: 30px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.search-container input:focus {
    border-color: #3cbcc4;
    box-shadow: 0 0 15px rgba(60, 188, 196, 0.25);
}

.search-icon-country {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #00a0d2;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Country dropdown styling - improved to match design */
#countryDropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background-color: white;
    border-radius: 8px;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
}

#countryDropdown div {
    padding: 5px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

#countryDropdown div:hover {
    background-color: #f5f8fa;
}

#countryDropdown div:last-child {
    border-bottom: none;
}

/* Feature grid styling - improved to match design */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 250px);
    gap: 25px;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/*.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1100px;
}*/

.gradient img {
    width: 100%;
    height: 80px;
}

.feature-box {
    width: 250px;
    height: 160px;
    border-radius: 16px;
    /*background-color: #069edb;*/
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-box:hover {
    /*background-color: #0d699c;*/
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    margin-bottom: 10px;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.feature-icon img {
    width: 120px;
    height: 80px;
    object-fit: contain;
}

.feature-title {
    font-size: 20px;
    line-height: 1.2;
    /*color: #fff;*/
    color: #fb6a27;
    text-decoration: none;
    font-weight: 500;
}

/* Map container styling - improved to match design */
.map-container {
    height: calc(100vh - 70px);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.05);
    /* padding-bottom: 120px; */
}

.africa-map {
    width: 100%;
    height: 100%;
    background: #e4f2f9;
}

/* Country styling on map */
.country {
    transition: fill 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
}

.sadc-country {
    cursor: pointer;
}

.sadc-country.selected {
    fill: #069edb !important;
    filter: drop-shadow(0px 0px 5px rgba(60, 188, 196, 0.5));
}

.sadc-country:hover {
    fill: #069edb !important;
    filter: drop-shadow(0px 0px 5px rgba(60, 188, 196, 0.5));
    /*transform: scale(1.03);
    transform-origin: center;*/
}

.non-sadc {
    opacity: 0.5;
    pointer-events: none;
}

.country-label {
    font-size: 14px;
    font-weight: 600;
    /*font-family: Arial, sans-serif;*/
    text-shadow: 0px 0px 2px #ffffff, 0px 0px 2px #ffffff;
    pointer-events: none;
    fill: #333;
    transition: opacity 0.3s ease;
}

/* Tooltip styling - improved to match design */
.map-tooltip {
    background: linear-gradient(135deg, #00a0d2, #069edb);
    color: white;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    font-weight: 500;
    /*font-family: Arial, sans-serif;*/
    pointer-events: none;
    position: absolute;
    max-width: 240px;
    z-index: 1000;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: opacity 0.3s ease;
}

/* Country data card for when a country is selected */
.country-data-card {
    position: absolute;
    bottom: 100px;
    right: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 160, 210, 0.05);
    padding: 20px;
    width: 320px;
    animation: slide-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    z-index: 900;
    /* max-height: 350px;
overflow-y: auto; */
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: bottom 0.3s ease;
}


.country-data-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fb6a27;
    text-align: left;
}

.country-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.country-stat {
    background: #f1f1f1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 5px;
    text-align: center;
}

.stat-value {
    font-size: 25px;
    font-weight: bold;
    color: #00a0d2;
    margin-bottom: 5px;
}

/*Carousel CSS*/

.carousel-caption {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    text-align: left;
    /*background: rgba(0, 0, 0, 0.5);*/
    color: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 500px;
}

.carousel-caption h5,
.carousel-caption p {
    color: #fff;
}

.carousel-caption h5 {
    font-size: 2rem;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: #ff6b35;
    text-underline-offset: 8px;
    text-decoration-thickness: 3px;
}

.carousel-caption p {
    font-size: 1.25rem;
    line-height: 1.5;
    text-align: justify;
}

.carousel-caption .btn {
    margin-top: 10px;
}

.carousel-item img {
    object-fit: cover;
}

.carousel-control-next,
.carousel-control-prev {
    width: 10%;
}

.carousel-caption .btn-primary {
    background-color: #ff6b35;
    border: 1px solid #ff6b35;
    text-transform: uppercase;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .country-data-card {
        bottom: 80px;
        right: 15px;
        padding: 10px;
        ;
    }

    .country-data-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .country-stats-grid {
        gap: 10px;
    }

    .stat-value {
        font-size: 20px;
    }

    .country-stats-grid {
        margin-bottom: 10px;
    }

    .row {
        flex-direction: column;
    }

    .sidebar,
    .map-container {
        width: 100%;
        height: auto;
        min-height: 400px;
    }

    .feature-grid {
        padding: 15px;
        gap: 15px;
        grid-template-columns: repeat(2, 165px);
    }

    .feature-box {
        width: 160px;
    }

    .feature-title {
        font-size: 16px;
    }

    .search-container {
        max-width: 90%;
    }

    .story-overlay a {
        padding: 0;
    }
}

/*End index.html CSS*/

/*Start all-countries.html CSS*/
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.container-fluid {
    flex: 1;
}

.comparison-subtitle img {
    width: 30px;
    margin-right: 10px;
}

.country-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem 2rem;
    max-width: 1750px;
    margin: 0 auto;
}

.country-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    overflow: hidden;
    min-height: 200px;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.country-name {
    font-size: 1rem;
    color: #000000;
    text-align: center;
    font-weight: 550;
}

.flag-container {
    width: 100%;
    height: 130px;
    overflow: hidden;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    background-color: #f0f0f0;
    /* Light background to contrast with white flags */
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    /* Inner shadow */
    border: 1px solid #ddd;
}

/* Updated flag image with shadow */
.flag-img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    transition: transform 0.5s;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    /* Added shadow to make white edges visible */
}

.country-checkbox {
    /* position: absolute; */
    bottom: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 1;
}

.country-card.selected {
    border: 3px solid #0077be;
    animation: pulse 1s;
}

.country-card.selected .flag-img {
    transform: scale(1.05);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 119, 190, 0.7);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(0, 119, 190, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 119, 190, 0);
    }
}

.compare-button-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    padding-bottom: 2rem;
}

.compare-button {
    background-color: #0077be;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

.compare-button:hover {
    background-color: #005fa3;
    transform: scale(1.05);
}

.compare-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

/* Updated float-compare-button styling */
.float-compare-button-container {
    position: fixed;
    bottom: 80px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 100;
}

.float-compare-text {
    background-color: #333;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    margin-bottom: 8px;
    font-weight: bold;
}

.float-compare-button {
    background-color: #fb6a27;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, background-color 0.3s;
    cursor: pointer;
}

.float-compare-button:hover {
    background-color: #069edb;
    transform: scale(1.05);
}

.float-compare-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
}

.float-compare-button img {
    width: 35px;
    height: 35px;
}

.checkmark {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 25px;
    height: 25px;
    background-color: #0077be;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s, transform 0.3s;
}

.country-card.selected .checkmark {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 768px) {
    .country-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }

    .country-card {
        min-height: 180px;
    }

    .flag-container {
        height: 100px;
    }

    .country-name {
        font-size: 1rem;
    }

    .compare-button {
        padding: 10px 20px;
        font-size: 16px;
    }

    .float-compare-button {
        width: 50px;
        height: 50px;
    }

    .float-compare-button img {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .country-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .navbar h1 {
        font-size: 1.5rem;
    }
}

/*End all-countries.html CSS*/

/*Start country-detail.html CSS*/
:root {
    --primary: #fb6a27;
    --secondary: #00cccc;
    --dark-blue: #003366;
    --light-gray: #f5f5f5;
    --white: #ffffff;
    --chart-blue: #2196F3;
    --chart-green: #4CAF50;
    --chart-dark: #333333;
}

/* Base styles */
body {
    margin: 0;
    /*font-family: -apple-system, BlinkMacSystemFont, 'Arial', sans-serif;*/
    /* Enhanced font stack for better Safari compatibility */
    transition: background-color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    /* Better text rendering on macOS */
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
}

.country-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    /* Ensures padding doesn't increase width */
}

/* Responsive grid adjustments */
@media (max-width: 1024px) {
    .country-content {
        grid-template-columns: 1fr 2fr;
    }
}

@media (max-width: 768px) {
    .country-content {
        grid-template-columns: 1fr;
        padding: 15px;
        /* Reduced padding on smaller screens */
    }
}

/* Ensure Safari compatibility for grid layouts */
@supports (-webkit-touch-callout: none) {
    .country-content {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .country-content>* {
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 auto;
        flex: 1 1 auto;
    }

    @media (min-width: 769px) {
        .country-section {
            -webkit-flex: 1;
            flex: 1;
        }

        .info-section {
            -webkit-flex: 3;
            flex: 3;
        }
    }

    @media (min-width: 769px) and (max-width: 1024px) {
        .info-section {
            -webkit-flex: 2;
            flex: 2;
        }
    }
}

.country-section {
    padding: 20px;
    position: relative;
    border-radius: 10px;
    /* Added for consistency */

}

.country-map {
    width: 100%;
    height: 250px;
    max-height: 250px;
    text-align: center;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.country-map img {
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    border-radius: 5px;

    transition: transform 0.3s ease;
    -webkit-transition: transform 0.3s ease;
    /* Safari compatibility */
}

.country-map img:hover {
    transform: scale(1.05);
    -webkit-transform: scale(1.05);
    /* Safari compatibility */
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

/* Safari support for stats grid */
@supports (-webkit-touch-callout: none) {
    .stats-grid {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        margin: 0 -7.5px;
        /* Compensate for inner margins */
    }

    .stats-grid>* {
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 calc(50% - 15px);
        flex: 1 1 calc(50% - 15px);
        margin: 7.5px;
    }

    @media (max-width: 480px) {
        .stats-grid>* {
            -webkit-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }
}

.stat-card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    /* Safari compatibility */
    /*cursor: pointer;*/
}

.stat-card:hover {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    /* Safari compatibility */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: var(--chart-blue);
    margin-bottom: 10px;
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
    -webkit-animation: fadeInUp 0.5s forwards;
    /* Safari compatibility */
}

.stat-label {
    font-size: 14px;
    color: #555;
    transition: color 0.3s ease;
    -webkit-transition: color 0.3s ease;
    /* Safari compatibility */
}

.stat-card:hover .stat-label {
    color: var(--primary);
}

.info-section {
    padding: 20px;
    transition: all 0.3s ease;
    border-radius: 10px;
    /* Added for consistency */

}

.section-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #fb6a27;
    position: relative;
    transition: color 0.3s ease;
    -webkit-transition: color 0.3s ease;
    /* Safari compatibility */
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.section-text {
    line-height: 1.6;
    margin-bottom: 20px;
    color: #069edb;
    opacity: 0;
    transform: translateY(20px);
    -webkit-transform: translateY(20px);
    /* Safari compatibility */
    animation: fadeInUp 0.5s forwards;
    -webkit-animation: fadeInUp 0.5s forwards;
    /* Safari compatibility */
    animation-delay: calc(var(--index) * 0.1s);
    -webkit-animation-delay: calc(var(--index) * 0.1s);
    /* Safari compatibility */
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
    transition: all 0.3s ease;
}

/* Safari support for charts grid */
@supports (-webkit-touch-callout: none) {
    .charts-grid {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .charts-grid>* {
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 calc(33.333% - 15px);
        flex: 1 1 calc(33.333% - 15px);
    }

    @media (max-width: 1024px) and (min-width: 769px) {
        .charts-grid>* {
            -webkit-flex: 1 1 calc(50% - 15px);
            flex: 1 1 calc(50% - 15px);
        }
    }

    @media (max-width: 768px) {
        .charts-grid>* {
            -webkit-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

.chart-card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    /* Safari compatibility */
    opacity: 0;
    transform: translateY(20px);
    -webkit-transform: translateY(20px);
    /* Safari compatibility */
    animation: fadeInUp 0.5s forwards;
    -webkit-animation: fadeInUp 0.5s forwards;
    /* Safari compatibility */
    animation-delay: calc(var(--index) * 0.1s);
    -webkit-animation-delay: calc(var(--index) * 0.1s);
    /* Safari compatibility */
}

.chart-card:hover {
    transform: translateY(-5px);
    -webkit-transform: translateY(-5px);
    /* Safari compatibility */
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.chart {
    height: 250px;
    margin-bottom: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    /* Safari compatibility */
}

.chart-title {
    font-weight: bold;
    margin: 10px 0 5px 0;
    font-size: 16px;
    transition: color 0.3s ease;
    -webkit-transition: color 0.3s ease;
    color: #188cff;
}

.chart-card:hover .chart-title {
    color: var(--primary);
}

.chart-subtitle {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.chart-footer {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #999;
    margin-top: 10px;
}

/* Safari flex support */
@supports (-webkit-touch-callout: none) {
    .chart-footer {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-align-items: center;
        align-items: center;
    }
}

.chart-caption {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Safari flex support */
@supports (-webkit-touch-callout: none) {
    .chart-caption {
        display: -webkit-inline-box;
        display: -webkit-inline-flex;
        display: inline-flex;
        -webkit-align-items: center;
        align-items: center;
        margin-right: 5px;
        /* Fallback for gap */
    }
}

.chart-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--chart-blue);
    transition: background-color 0.3s ease;
    -webkit-transition: background-color 0.3s ease;
    /* Safari compatibility */
}

.chart-card:hover .chart-icon {
    background-color: var(--primary);
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* Safari support for indicators grid */
@supports (-webkit-touch-callout: none) {
    .indicators-grid {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
        margin: 0 -7.5px;
        /* Compensate for inner margins */
    }

    .indicators-grid>* {
        -webkit-box-flex: 1;
        -webkit-flex: 1 1 calc(50% - 15px);
        flex: 1 1 calc(50% - 15px);
        margin: 7.5px;
    }

    @media (max-width: 480px) {
        .indicators-grid>* {
            -webkit-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }
}

@media (max-width: 480px) {
    .indicators-grid {
        grid-template-columns: -2fr;
    }

    .stats-grid {
        grid-template-columns: -2fr;
    }
}

.indicator-card {
    background-color: var(--white);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    /* Safari compatibility */
    /*cursor: pointer;*/
}

.indicator-card:hover {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px);
    /* Safari compatibility */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.indicator-title {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    transition: color 0.3s ease;
    -webkit-transition: color 0.3s ease;
    /* Safari compatibility */
}

.indicator-card:hover .indicator-title {
    color: var(--primary);
}

.indicator-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--chart-blue);
    margin: 10px 0;
    opacity: 0;
    animation: fadeInUp 0.5s forwards;
    -webkit-animation: fadeInUp 0.5s forwards;
    /* Safari compatibility */
    animation-delay: 0.2s;
    -webkit-animation-delay: 0.2s;
    /* Safari compatibility */
    transition: color 0.3s ease;
    -webkit-transition: color 0.3s ease;
    /* Safari compatibility */
}

.indicator-card:hover .indicator-value {
    color: var(--primary);
}

.indicator-source {
    font-size: 12px;
    color: #999;
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 500px;
    font-size: 20px;
    color: var(--primary);
}

/* Safari flex support */
@supports (-webkit-touch-callout: none) {
    .loading {
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        -webkit-justify-content: center;
        justify-content: center;
        -webkit-align-items: center;
        align-items: center;
    }
}

/* Loading animation */
.loading:after {
    content: '...';
    animation: dots 1.5s steps(5, end) infinite;
    -webkit-animation: dots 1.5s steps(5, end) infinite;
    /* Safari compatibility */
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

@-webkit-keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60% {
        content: '...';
    }

    80%,
    100% {
        content: '';
    }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
    }

    to {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@-webkit-keyframes pulse {
    0% {
        -webkit-transform: scale(1);
    }

    50% {
        -webkit-transform: scale(1.05);
    }

    100% {
        -webkit-transform: scale(1);
    }
}

/* Tooltip styles */
.tooltip {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-transition: opacity 0.3s ease;
    /* Safari compatibility */
    max-width: 250px;
    font-size: 14px;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    -webkit-animation: loading 1.5s infinite;
    /* Safari compatibility */
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@-webkit-keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Chart tooltips */
.custom-tooltip {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
}

/* Touch device optimizations */
@media (hover: none) {

    .stat-card:hover,
    .chart-card:hover,
    .indicator-card:hover {
        transform: none;
        -webkit-transform: none;
    }

    /* Active state styles for touch devices */
    .stat-card:active,
    .chart-card:active,
    .indicator-card:active {
        transform: scale(0.98);
        -webkit-transform: scale(0.98);
    }
}

/* Fix for any potential Safari rendering issues */
.country-section,
.info-section,
.stat-card,
.chart-card,
.indicator-card {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Print media query for better print layout */
@media print {
    body {
        background-color: white !important;
    }

    .country-content {
        display: block;
        width: 100%;
    }

    .country-section,
    .info-section,
    .stat-card,
    .chart-card,
    .indicator-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .chart {
        max-height: 200px;
    }

    /* Hide animations for print */
    * {
        animation: none !important;
        -webkit-animation: none !important;
        transition: none !important;
        -webkit-transition: none !important;
        opacity: 1 !important;
    }
}


/* Additional responsive enhancements - Add to end of your existing CSS */

/* Improved viewport handling */
@viewport {
    width: device-width;
    zoom: 1.0;
}

/* Better handling for iOS Safari notch */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 480px) {
    .country-content {
        padding: 10px;
        gap: 15px;
    }

    .country-section,
    .info-section {
        padding: 15px;
    }

    .stat-card,
    .chart-card,
    .indicator-card {
        padding: 12px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    .stat-number {
        font-size: 28px;
    }

    .chart {
        height: 220px;
    }
}

/* Tablet optimizations */
@media (min-width: 481px) and (max-width: 768px) {

    .indicators-grid,
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart {
        height: 230px;
    }
}

/* Safari-specific grid fixes */
@supports (-webkit-touch-callout: none) {
    @media (max-width: 480px) {

        .stats-grid>*,
        .indicators-grid>* {
            -webkit-flex: 1 1 100%;
            flex: 1 1 100%;
        }
    }

    @media (min-width: 481px) and (max-width: 768px) {

        .stats-grid>*,
        .indicators-grid>* {
            -webkit-flex: 1 1 calc(50% - 15px);
            flex: 1 1 calc(50% - 15px);
        }
    }
}

/* Enhanced text rendering for Safari */
.section-text,
.chart-title,
.chart-subtitle,
.indicator-title,
.stat-label {
    -webkit-text-size-adjust: 100%;
}

/* Better touch handling for mobile Safari */
@media (pointer: coarse) {

    .stat-card,
    .chart-card,
    .indicator-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }

    a,
    button,
    .nav-button {
        min-height: 44px;
        /* Apple's recommended minimum touch target size */
        min-width: 44px;
        padding: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Fix for sticky hover state in iOS Safari */
@media (hover: hover) {

    .stat-card:hover,
    .chart-card:hover,
    .indicator-card:hover {
        transform: translateY(-3px);
        -webkit-transform: translateY(-3px);
    }
}

/* Portrait orientation optimizations for mobile */
@media screen and (max-width: 480px) and (orientation: portrait) {
    .charts-grid {
        gap: 20px;
    }

    .breadcrumb {
        font-size: 14px;
    }
}

/* Landscape orientation optimizations for mobile */
@media screen and (max-width: 896px) and (orientation: landscape) {
    .country-content {
        grid-template-columns: 1fr 2fr;
    }

    .chart {
        height: 180px;
    }
}

/* Fix for Safari's overflow issues */
html,
body {
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Additional fixes for Safari on MacBooks */
@media screen and (min-width: 1200px) {
    @supports (-webkit-touch-callout: none) {

        .stat-card,
        .chart-card,
        .indicator-card {
            will-change: transform;
        }
    }
}

/* High-density MacBook screen optimization */
@media screen and (min-width: 1440px) and (-webkit-min-device-pixel-ratio: 2) {
    .country-content {
        max-width: 1600px;
    }

    .chart {
        height: 300px;
    }
}

/* Fix for Safari flex gap issues */
@supports (-webkit-touch-callout: none) and (not (gap: 20px)) {

    .stats-grid,
    .indicators-grid,
    .charts-grid {
        margin: -7.5px;
    }

    .stats-grid>*,
    .indicators-grid>*,
    .charts-grid>* {
        margin: 7.5px;
    }
}

/* Fix for iOS Safari text inflation */
html {
    -webkit-text-size-adjust: 100%;
}

/* Make sure charts are responsive on all devices */
canvas {
    max-width: 100%;
    height: auto;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 30px;
    transition: all 0.3s ease;
}

/* More explicit and refined media queries */
@media (min-width: 769px) and (max-width: 1023px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        /* Slightly reduced gap */
    }
}

@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

/*End country-detail.html CSS*/

/*Start country-compare.html CSS*/
/*Start country-compare.html CSS*/
:root {
    --primary-blue: #0078D4;
    --light-blue: #E6F0FA;
    --dark-gray: #333333;
    --medium-gray: #666666;
    --light-gray: #E5E5E5;
    --white: #FFFFFF;
    --green: #28A745;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --hover-scale: 1.02;
}

/* Global reset and font settings */
/* * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  } */

body {
    background-color: #e4f2f9;
    color: var(--dark-gray);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    /* Prevent horizontal scrolling */
}

.touch-active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(0, 120, 212, 0.1);
    transition: all 0.2s ease;
}

/* Main container for layout */
/*.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
  }*/

/* Header styling */


/* Main content area */
.compare-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 1400px;
    min-height: 100vh;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

/* Content area for charts and tables */
.content-area {
    flex: 3;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Generic section styling */
.section {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 120, 212, 0.08);
    padding: 28px;
    margin-bottom: 25px;
    border: 1px solid rgba(0, 120, 212, 0.05);
    width: 100%;
}

/* Section title styling */
.section-title {
    text-align: center;
    color: #0077be;
    margin: 1.2rem 0;
    font-weight: bold;
    font-size: 2rem;
    position: relative;
    display: block;
    width: 100%;
    text-decoration: underline;
    text-decoration-color: #ff6b35;
    text-underline-offset: 8px;
    text-decoration-thickness: 3px;
}

/* Grid for chart cards */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
}

/* Individual chart card styling */
.chart-card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.08);
    padding: 28px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 120, 212, 0.05);
}

.chart-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 30px rgba(0, 120, 212, 0.15);
    border-color: rgba(0, 120, 212, 0.1);
}

/* Chart container for canvas */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* Custom tooltip styling for charts and heatmap */
.custom-tooltip {
    background: linear-gradient(135deg, #00a0d2, #069edb);
    color: white;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    position: fixed;
    max-width: min(280px, 80vw);
    z-index: 1000;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: opacity 0.3s ease, transform 0.2s ease;
    line-height: 1.5;
    text-align: left;
    transform: translateY(0);
}

.custom-tooltip.visible {
    opacity: 1;
    transform: translateY(-5px);
}

/* Chart title styling */
.chart-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #188cff;
    margin-top: 15px;
    text-align: center;
}

.chart-card:hover .chart-title {
    color: #fb6a27;
}

/* Chart description styling */
.chart-description {
    font-size: 0.875rem;
    color: var(--medium-gray);
    text-align: center;
    margin-bottom: 15px;
}

/* Chart source citation styling */
.chart-source {
    font-size: 0.75rem;
    color: var(--medium-gray);
    text-align: center;
    margin-top: 10px;
}

/* Table styling for indicators */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
}

/* Table styling */
.indicators-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background-color: var(--white);
}

/* Header cells */
.indicators-table th {
    background: linear-gradient(135deg, #0078D4, #0066b2);
    color: var(--white);
    font-weight: 600;
    text-align: center;
    padding: 16px 12px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

/* First column header */
.indicators-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    /* Higher than other headers to appear above */
    background: linear-gradient(135deg, #0078D4, #0066b2);
}

/* Table data cells */
.indicators-table td {
    padding: 14px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 120, 212, 0.1);
    color: #188cff;
    transition: background-color 0.2s ease;
}

/* First column cells - sticky */
.indicators-table td:first-child {
    position: sticky;
    left: 0;
    background-color: #f9f9f9;
    font-weight: 500;
    color: #188cff;
    text-align: left;
    z-index: 5;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Row hover effect */
.indicators-table tr:hover td {
    background-color: rgba(0, 120, 212, 0.05);
}

/* Make first cell maintain background on row hover */
.indicators-table tr:hover td:first-child {
    background-color: #f0f7fc;
}

/* Improved flag display in table */
.country-flag-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
}

.country-flag {
    width: 30px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.country-flag:hover {
    transform: scale(1.2);
}

.country-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #0066b2;
}

/* Heatmap section styling */
.heatmap-section {
    margin-top: 30px;
    width: 100%;
}

.heatmap-card {
    padding: 30px;
}

/* Heatmap container styling */
.heatmap-container {
    position: relative;
    margin: 20px auto;
    width: 100%;
    display: flex;
    justify-content: center;
    transition: all var(--transition-speed);
}

/* SVG for heatmap */
.heatmap-svg {
    width: 100%;
    height: auto;
    max-width: 800px;
    overflow: visible;
}

/* Heatmap legend styling */
.heatmap-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px auto;
    padding: 15px;
    background-color: var(--light-blue);
    border-radius: var(--border-radius);
    max-width: 600px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.heatmap-description {
    font-size: 24px;
    text-align: center;
    margin-bottom: 15px;
    color: #188cff;
}

.heatmap-card:hover .heatmap-description {
    color: #fb6a27;
}

.legend-title {
    width: 100%;
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--dark-gray);
    font-size: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 5px;
    transition: transform var(--transition-speed);
}

.legend-item:hover {
    transform: scale(1.1);
}

.legend-color {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    transition: all var(--transition-speed);
}

.legend-label {
    font-size: 0.875rem;
    color: var(--dark-gray);
    font-weight: 500;
}

/* Error message styling for missing data */
.missing-data-error {
    background-color: #FFF3F3;
    color: #B00020;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Footer styling */
footer {
    background-color: var(--white);
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--light-gray);
    font-size: 0.75rem;
    color: var(--medium-gray);
    width: 100%;
}

/* Scrollable table container */
.indicators-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: thin;
    max-width: 100%;
    position: relative;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.indicators-table td:first-child,
.indicators-table th:first-child {
    position: sticky;
    left: 0;
    background-color: #f9f9f9;
    /* match your table background */
    z-index: 2;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    /* subtle divider */
}

.scroll-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 5;
}

.show-indicator {
    opacity: 1;
}

/* Loading animation for charts */
.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 12px;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.chart-loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 120, 212, 0.1);
    border-radius: 50%;
    border-top-color: #0078D4;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation for chart entries */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Responsive adjustments for tablets */
@media (max-width: 1024px) {
    .section {
        padding: 20px;
    }

    .main-content {
        flex-direction: column;
        padding: 0 15px;
    }

    .content-area {
        min-width: 100%;
    }

    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 15px;
    }

    .custom-tooltip {
        font-size: 13px;
        padding: 10px 14px;
        max-width: 70vw;
    }

    .chart-card {
        padding: 20px;
    }

    .heatmap-container {
        margin-left: 0;
    }

    .indicators-scroll {
        overflow-x: auto;
        position: relative;
        /* ensures sticky works inside */
    }

    .indicators-table td:first-child,
    .indicators-table th:first-child {
        position: sticky;
        left: 0;
        background-color: #f9f9f9;
        /* match your table background */
        z-index: 2;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        /* subtle divider */
    }
}

/* Responsive adjustments for mobile devices */
@media (max-width: 767px) {
    .section {
        padding: 15px;
    }

    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-title {
        font-size: 1.5rem;
        text-underline-offset: 6px;
        text-decoration-thickness: 2px;
    }

    .chart-title {
        font-size: 1rem;
    }

    .chart-description {
        font-size: 0.8rem;
    }

    .custom-tooltip {
        font-size: 13px;
        padding: 10px 14px;
        max-width: 70vw;
    }

    .chart-card {
        padding: 15px;
    }

    .heatmap-card {
        padding: 15px;
    }

    .heatmap-container {
        overflow-x: auto;
    }

    .heatmap-svg {
        width: 100%;
        max-width: 100%;
        height: auto;
    }

    .indicators-scroll {
        overflow-x: auto;
        position: relative;

    }

    .indicators-table td:first-child,
    .indicators-table th:first-child {
        position: sticky;
        left: 0;
        background-color: #f9f9f9;
        z-index: 2;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);

    }

}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
    .section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .main-content {
        margin: 10px auto;
        gap: 15px;
        padding: 0 10px;
    }

    .indicators-table th,
    .indicators-table td {
        padding: 8px;
        font-size: 0.8rem;
        z-index: 2;
    }

    .custom-tooltip {
        font-size: 12px;
        padding: 8px 12px;
        max-width: 85vw;
    }

    .charts-grid {
        gap: 12px;
    }

    .chart-card {
        padding: 12px;
        height: auto;
    }

    .chart-container {
        min-height: 200px;
    }

    .heatmap-description {
        font-size: 12px;
    }

    /* Adjust header spacing */
    .section-title {
        margin: 0.8rem 0;
        font-size: 1.3rem;
        text-underline-offset: 5px;
        text-decoration-thickness: 2px;
    }

    .heatmap-legend {
        padding: 10px;
        gap: 8px;
    }

    .legend-item {
        margin: 0 3px;
    }

    .legend-color {
        width: 16px;
        height: 16px;
        margin-right: 6px;
    }

    .legend-label {
        font-size: 0.75rem;
    }

    .indicators-scroll {
        overflow-x: auto;
        position: relative;
        /* ensures sticky works inside */
    }

    .indicators-table td:first-child,
    .indicators-table th:first-child {
        position: sticky;
        left: 0;
        background-color: #f9f9f9;
        /* match your table background */
        z-index: 2;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        /* subtle divider */
    }
}

/* Safari-specific font adjustments */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }

    /* Fix for Safari canvas rendering */
    canvas {
        image-rendering: -webkit-optimize-contrast;
    }
}

/*End country-compare.html CSS*/

/*End country-compare.html CSS*/

/*Start stories-of-transformation.html CSS*/
.stories-bg {
    background: linear-gradient(to right, #c8a3f1, #f5d5f2);
}

main.main-content {
    flex: 1;
    min-height: 0;
    /* prevents overflow from flex children */
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.content-container {
    display: flex;
    flex: 1;
    min-height: 0;
}

.left-section {
    flex: 1;
    background: url(../img/flower.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 100vh;
}

.right-section {
    flex: 2;
    padding-left: 30px;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
    color: #000;
}

.right-section h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    font-weight: 550;
    color: #000;
    position: relative;
}

.right-section h2::after {
    content: '';
    width: 70%;
    height: 4px;
    background-color: #ff6b35;
    display: inline-block;
    position: absolute;
    left: 0;
    bottom: 0;
}

.story-right-section {
    flex: 2;
    margin: 25px;
    display: flex;
    align-items: center;
    flex-direction: column;
    color: #000;
    background: #ffffff;
    border-radius: 10px;
}

.stories-list-container {
    flex: 1;
    max-width: 90%;
    padding: 10px;
}

.stories-list-container::-webkit-scrollbar {
    width: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stories-list-container::-webkit-scrollbar-track {
    background: transparent;
}

/* Make it visible on hover */
.stories-list-container:hover::-webkit-scrollbar {
    opacity: 1;
}

.stories-list-container::-webkit-scrollbar-thumb {
    background-color: #ffffff;
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.stories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stories-list li {
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.stories-list a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #000;
}

.stories-list a:hover {
    background-color: #f0f0f0;
}

.story-bg {
    background: linear-gradient(to bottom right, #bd90d5, #e1d3ff);
}

.story-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.story-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid #e0d4f7;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
    width: calc(25% - 15px);
    display: flex;
    flex-direction: column;
    padding: 5px;
}

.story-list {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid #e0d4f7;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s;
    padding: 5px;
}

.story-list img,
.news-item img {
    width: 150px;
    height: 90px;
    object-fit: fill;
    border-radius: 5px;
}

#butterfly-container {
    display: none;
}

#butterfly-container img {
    max-width: 60%;
}

::-webkit-scrollbar,
#list-container::-webkit-scrollbar {
    width: 8px;
}

/* Track */
::-webkit-scrollbar-track,
#list-container::-webkit-scrollbar-track {
    box-shadow: inset 0 0 5px #069edb;
    border-radius: 10px;
}

/* Handle */
::-webkit-scrollbar-thumb,
#list-container::-webkit-scrollbar-thumb {
    background: #069edb;
    border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover,
#list-container::-webkit-scrollbar-thumb:hover {
    background: #0d699c;
}

.story-card-bg {
    width: 100%;
    height: 120px;
    border-radius: 5px;
    background-size: cover !important;
}

.story-card:hover,
.story-list:hover {
    transform: translateY(-5px);
}

.story-card a.card-link,
.story-list a.card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#list-container {
    overflow-y: auto;
    max-height: 520px;
}

.d-none {
    display: none !important;
}

.story-overlay {
    display: flex;
    flex-direction: column;
}

.story-overlay span,
.story-details span {
    color: #878787;
    font-size: 0.85rem;
    font-weight: 500;
}

.story-overlay a,
.story-details a {
    /*margin: 5px;*/
    /*color: #727272;*/
    color: #333;
    font-size: 1.2em;
    font-weight: 500 !important;
    text-decoration: none;
    line-height: normal;
}

.story-detail-image {
    display: block;
    border-radius: 5px;
    margin: auto;
    max-width: 1024px;
    max-height: 480px;
}

.story-detail-content {
    font-size: 1.1em;
    line-height: 1.8;
    text-align: justify;
    margin: 20px 0;
    color: #333;
}

.read-more {
    display: block;
    margin: 0 15px 15px;
    color: #fb6a27;
    text-decoration: none;
    font-size: 0.8rem;
}

.read-more:hover {
    text-decoration: underline;
}

.view-toggle-icons button {
    color: #000000;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    border: 0;
    padding: 2px 5px;
    border-radius: 5px;
    font-size: 1.5rem;
    background-color: #ffffff;
}

.view-toggle-icons button:hover {
    opacity: 1;
}

.view-toggle-icons button.active-view {
    opacity: 1;
    color: #fb6a27;
    /* Amber/yellow highlight for active */
}

@media (max-width: 1024px) {
    .story-card {
        width: calc(50% - 10px);
    }

    .story-detail-image {
        max-width: 720px;
    }
}

@media (max-width: 600px) {
    .story-card {
        width: 100%;
    }

    .story-detail-image {
        max-width: 100%;
    }
}

.doc-icon {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.external-icon {
    margin-left: auto;
    color: #999;
}



@media (max-width: 767.98px) {
    .content-container {
        flex-direction: column;
    }

    .left-section {
        display: none;
    }

    .right-section {
        width: 100%;
    }
}

/* Responsive: Tablet and down */
@media (max-width: 991.98px) {
    .content-container {
        flex-direction: column;
    }

    .left-section {
        min-height: 250px;
    }

    .right-section {
        max-height: none;
        padding: 20px;
    }
}


/* Mobile view: up to 767.98px */
@media (max-width: 767.98px) {
    .content-container {
        flex-direction: column;
    }

    .left-section {
        display: none;
    }

    .right-section {
        display: block;
    }
}

/* Tablet view: 768px to 1024px */
@media (min-width: 768px) and (max-width: 1024px) {
    .content-container {
        flex-direction: column;
    }

    .left-section {
        display: none;
        /* Optional: depends on your design */
    }

    .right-section {
        display: block;
    }
}

/*End stories-of-transformation.html CSS*/

/*Start resources.html CSS*/
.resources-bg {
    background: #e4f2f9;
}

.resources-left-section {
    flex: 1;
    background: url(../img/resources-bg.svg);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    height: 100vh;
}

.resources-right-section {
    flex: 2;
    padding-left: 30px;
    padding-right: 30px;
    display: flex;
    flex-direction: column;
    color: #000;
    max-width: 100%;
    margin: 0 auto;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.page-banner img {
    width: 100%;
}

.resource-card {
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    height: 220px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
}

.resource-card h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
}

.resource-card a {
    color: #f15a24;
    font-weight: bold;
    text-decoration: none;
}

.resource-card a:hover {
    text-decoration: underline;
}

.resource-overlay {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 12px;
    text-align: center;
    width: 100%;
}

.resource-overlay .action-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.resource-overlay .btn {
    font-size: 0.85em;
    padding: 2px 35px;
    -webkit-appearance: none;
    border-radius: 4px;
}

.resource-overlay .btn-view {
    background-color: #fb6a27;
    color: #fff;
}

.resource-overlay h3 {
    margin: 0;
    font-size: 1.1em;
}

.resource-overlay a {
    color: #ffd166;
    font-weight: bold;
    display: block;
    margin-top: 5px;
    text-decoration: none;
}

.resource-overlay a:hover {
    text-decoration: underline;
}

.section-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    justify-content: end;
}

.swiper-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fb6a27;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.swiper-button-disabled {
    opacity: 0.5;
    cursor: auto;
}

.swiper-container {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    overflow: hidden;
    background-color: #fff;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 10px;

}

.swiper-button i {
    font-size: 16px;
    color: #fff;
}

.resource-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.85);
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.modal-header {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1rem;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-body {
    padding: 0;
    flex-grow: 1;
    overflow: auto;
    height: calc(90vh - 120px);
    display: flex;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 60px;
}

.modal-footer .btn {
    margin-left: 10px;
    background: #fb6a27;
    color: white;
    -webkit-appearance: none;
    border-radius: 4px;
    padding: 5px 10px;
}

.close-modal {
    color: #069edb;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0 10px;
}

.resource-modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.85);
    -webkit-overflow-scrolling: touch;
}

.doc-viewer {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

.img-viewer {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.video-viewer {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

/*News section CSS start*/
.news-layout {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    padding: 30px;
}

.news-item h3,
.fc-toolbar-title {
    color: #333;
    font-size: 1.2em !important;
    font-weight: 500;
    text-decoration: none;
    line-height: normal;
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number {
    color: #878787;
    text-decoration: none;
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: #fb6a2759;
}

.fc .fc-button-primary {
    background-color: #fb6a27;
    border-color: #fb6a27;
}

.fc .fc-button-primary:hover {
    background-color: #069edb;
    border-color: #069edb;
}

.fc .fc-button-primary:disabled {
    background-color: #069edb;
}

.fc .fc-button-primary:focus {
    box-shadow: none;
}

.fc-daygrid-event {
    cursor: pointer;
}

.fc-event-title {
    color: #069edb;
}

.fc-daygrid-event-dot {
    border-color: #069edb;
}

.news-item h2 {
    color: #878787 !important;
    font-size: 0.85rem;
    font-weight: 500;
}

.news-item button {
    background-color: #069edb;
    border: 1px solid #069edb;
}

.news-item button:hover {
    background-color: #fb6a27;
    border: 1px solid #fb6a27;
}

.main-news {
    flex: 3;
    min-width: 70%;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.news-detail-content h2 {
    color: #0056b3;
    margin-bottom: 15px;
}

.news-detail-content p {
    line-height: 1.6;
    margin-bottom: 1.2em;
    text-align: justify;
}

.latest-updates {
    flex: 1;
    min-width: 20%;
    border-radius: 8px;
    height: fit-content;
}

.latest-updates h1 {
    font-size: 2rem;
    color: #0077be;
    border-bottom: 3.5px solid #fb6a27;
    padding-bottom: 5px;
    font-weight: bold;
}

.calendar,
.upcoming {
    background-color: #fff;
    padding: 20px 15px;
    border-radius: 8px;
}

.calendar h1,
.upcoming h1 {
    margin-top: 1.2rem;
}

ul.latest-list {
    max-height: 100vh;
    overflow-y: auto;
}

.latest-list {
    list-style: disc;
    padding-left: 5px;
    margin: 0;
    font-size: .9rem;
    text-align: justify;
}

.latest-list li {
    margin-bottom: 10px;
    color: #444;
}

.latest-list li span {
    color: #0077be;
    font-weight: bold;
}

.event-card {
    display: flex;
    align-items: center;
    background-color: #fb6a27;
    /* Orange background */
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: white;
    position: relative;
    justify-content: space-between;
    cursor: pointer;
}

.event-date {
    background-color: #fff;
    color: #6b4f4f;
    padding: 0.5rem 0.8rem;
    text-align: center;
    border-radius: 10px;
    min-width: 95px;
    font-weight: bold;
    flex-shrink: 0;
}

.event-date span {
    display: block;
}

.event-details {
    margin-left: 1rem;
    flex-grow: 1;
}

.event-details h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

#eventModal .modal-content {
    max-height: 40vh;
}

#eventModal .modal-title {
    color: #0077be;
}

#eventModal .modal-body {
    padding: 1.2rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

/* For tablets (width ≤ 992px) */
@media (max-width: 992px) {
    .news-layout {
        flex-direction: column;
        gap: 30px;
    }

    .latest-updates {
        width: 100%;
        padding: 15px;
    }
}

/* For mobile devices (width ≤ 600px) */
@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .main-news {
        padding: 15px;
    }

    .news-detail-content h2 {
        font-size: 1.2em;
    }

    .page-title {
        font-size: 1.6em;
    }

    .latest-updates h2 {
        font-size: 1.2em;
    }

    .latest-list li {
        font-size: 0.95em;
    }
}

/*News section CSS ends*/

/*About section starts*/


/*About section ends*/


/*Media Queries*/
/* Responsive adjustments */
@media (max-width: 1440px) {
    .sadc_logo img {
        height: 40px;
    }

    .resources-right-section {
        max-width: 100%;
    }

    .page-title,
    .latest-updates h1 {
        font-size: 1.8rem;
    }

    .main-news {
        min-width: 50%;
    }

    .latest-updates {
        min-width: 35%;
    }
}

@media (max-width: 1200px) {
    .resources-right-section {
        max-width: 1200px
    }

    .resource-card {
        height: 200px;
    }
}

@media (max-width: 1024px) {
    .resources-right-section {
        max-width: 1024px
    }

    .resource-card {
        width: 100%;
        height: 180px;
    }

    .page-container {
        padding: 0 10px;
    }

    .resources-right-section {
        padding: 0px;
    }
}

@media (max-width: 768px) {
    .stories-list-container {
        max-width: 100%;
    }

    .story-right-section {
        margin: auto;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .news-layout {
        padding: 0;
    }

    .modal-content {
        width: 95%;
        height: 90vh;
        margin: 5vh auto;
        max-height: none;
    }

    .modal-body {
        height: calc(90vh - 120px);
    }

    .resource-card {
        height: 160px;
    }

    .section-header {
        margin-bottom: 15px;
    }

    .section-header h2 {
        font-size: 1.5rem;
        width: 100%;
        margin-bottom: 10px;
    }

    .section-controls {
        width: 100%;
        justify-content: flex-end;
    }

    .resource-overlay h3 {
        font-size: 0.9em;
    }

    .resource-overlay .btn {
        padding: 2px 20px;
        font-size: 0.8em;
    }
}

@media (max-width: 600px) {
    .resources-right-section {
        max-width: 100%;
    }

    .resource-card {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .resource-card {
        height: 140px;
    }

    .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-body {
        height: calc(100vh - 120px);
    }

    .resource-overlay h3 {
        font-size: 0.85em;
        -webkit-line-clamp: 1;
    }

    .modal-title {
        font-size: 0.9rem;
    }

    .modal-footer .btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Safari-specific fixes */
@supports (-webkit-touch-callout: none) {

    /* CSS specific to iOS devices */
    .modal-body {
        overflow-y: scroll;
    }

    .doc-viewer {
        -webkit-overflow-scrolling: touch;
    }

    /* Fix for Safari's 100vh issue */
    .resources-bg,
    .modal-content {
        height: -webkit-fill-available;
    }
}

/* MacBook-specific adjustments for Retina displays */
@media screen and (-webkit-min-device-pixel-ratio: 2) {
    .resource-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .modal-content {
        box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
    }
}