﻿
@font-face {
    font-family: 'baloo2-variablefont_wght';
    src: url('../../fonts/baloo2-variablefont_wght.ttf') format('truetype');
}


.main-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 16px;
    gap: 16px;
    background-color: white;
    border-bottom: 1px solid #ccc;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

    .main-header::-webkit-scrollbar {
        display: none;
    }

.pbs-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Trebuchet MS', 'Segoe UI', sans-serif;
    font-size: 22px;
    font-weight: 500;
    color: #004b5d;
    flex-shrink: 0;
}


    .pbs-title img {
        height: 36px;
        flex-shrink: 0;
    }

.psi-heading {
    font-family: 'baloo2-variablefont_wght';
    font-weight: 700;
    font-size: 22px;
    color: #74137c;
    flex-shrink: 0;
    margin-left: 20px;
}


@media (max-width: 1000px) {
    .pbs-title {
        font-size: 18px;
        font-size: 18px;
    }

    .psi-heading {
        font-size: 18px;
        margin-left: 16px;
    }
}

@media (max-width: 480px) {
    .pbs-title {
        font-size: 16px;
    }

    .psi-heading {
        font-size: 16px;
        margin-left: 10px;
    }

    .main-header {
        padding: 6px 10px;
        gap: 10px;
    }
}

@media (max-width: 425px) {
    .pbs-title {
        font-size: 10px;
        margin-left: 2px;
    }

    .psi-heading {
        font-size: 13px;
        margin-left: 5px;
    }

    .main-header {
        padding: 6px 10px;
        gap: 10px;
    }
}

/* Responsive Media Queries */
@media (max-width: 999px) {
    .main-content {
        display: none !important;
    }

    body.sidebar-hidden .main-content {
        display: block !important;
    }

    /* Always hide topic box on mobile */
    #select-topic-box {
        display: none !important;
    }

    #layer-control-wrapper,
    #scale-bar-container,
    #disclaimer-info,
    .polygon-label,
    footer#map-footer {
        display: none !important;
    }

    body.sidebar-hidden #layer-control-wrapper,
    body.sidebar-hidden #scale-bar-container,
    body.sidebar-hidden #disclaimer-info,
    body.sidebar-hidden footer#map-footer {
        display: block !important;
    }

    
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}


#map {
    cursor: default !important;
    width: 100%;
    height: 70vh; /* Default height for desktop */
    position: absolute;
}

/* Mobile responsiveness (below 1000px) */
@media (max-width: 1000px) {
    #map {
        height: 60vh; /* Shorter height on mobile for better UX */
    }
}

/* Extra small devices (phones, below 600px) */
@media (max-width: 600px) {
    #map {
        height: 50vh; /* Even shorter for very small screens */
    }
}

.leaflet-left .leaflet-control-zoom {
    position: absolute !important;
    top: 8px; /* adjust as needed */
    left: 400px !important; /* move 400px from left */
    z-index: 1001;
}

.leaflet-left .leaflet-control-csv-export {
    position: absolute !important;
    top: 248px !important; /* BELOW the zoom buttons (default zoom is at 10px) */
    left: 405px !important; /* EXACTLY 400px from the left */
    width: 30px;
    height: 30px;
    line-height: 30px;
    background-color: white;
    text-align: center;
    font-size: 20px;
    z-index: 1001;
    border: 1px solid #ccc;
    border-radius: 4px;
}


/* Snapshot button custom position */
.leaflet-control-snapshot {
    position: absolute;
    left: 405px; /* ✅ container is correct */
    top: 216px; /* or adjust as needed */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 24px;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 1001;
}

#scale-bar-container {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 20px;
    width: 90%;
    max-width: 650px;
    min-height: 130px;
    text-align: center;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    padding: 12px 15px 25px;
    border-radius: 8px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
    overflow: visible;
    box-sizing: border-box;
}

/* ✅ Horizontal title + hover info */
#scale-bar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
    text-align: left;
    word-break: break-word;
}

/* Title: big and bold */
#scale-bar-title {
    font-size: 35px;
    font-weight: bold;
    color: #000;
    white-space: nowrap;
}

/* Hover info beside title */
#hover-value {
    font-size: 17px;
    font-weight: bold;
    color: #333;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
    flex: 1 1 auto;
}

/* Main color scale bar */
#scale-bar {
    display: flex;
    width: 100%;
    height: 20px;
    border: 1px solid black;
    position: relative;
    box-sizing: border-box;
    margin-bottom: 15px;
}

/* Segments inside bar */
.scale-segment {
    flex: 1;
    height: 100%;
    position: relative;
}

/* Number labels below */
#scale-values {
    position: relative;
    width: 95%;
    left: 3%;
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    padding: 0 4px;
    text-align: center;
    white-space: nowrap;
}

/* Cursor arrows */
#scale-cursor,
#fixed-cursor {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 1001;
}

#scale-cursor {
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 14px solid black;
    transition: left 0.3s ease;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
}

#fixed-cursor {
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 16px solid white;
    filter: drop-shadow(0px 0px 2px black);
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
}

/* Mobile responsive */
@media (max-width: 768px) {
    #scale-bar-container {
        bottom: 40px;
        right: 10px;
        padding: 12px 10px 20px;
        overflow-x: hidden; /* ✅ Hide anything that goes out */
        right: 0;
        max-width: 100vw;
    }

    #scale-bar-title {
        font-size: 35px;
    }

    #hover-value {
        font-size: 17px;
        font-weight: bold;
        color: #333;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    #scale-values {
        font-size: clamp(12px, 1.4vw, 16px);
    }
}

#disclaimer-info {
    position: absolute;
    top: 300px;
    left: 420px;
    z-index: 999;
}


.tooltip .tooltip-inner {
    text-align: left !important;
    max-width: 250px;
    white-space: normal;
    font-size: 14px;
}

#map-header {
    position: absolute;
    top: 17px;
    left: calc(250px + (100% - 250px - 300px) / 2);
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(32, 96, 149, 0.7), rgba(79, 172, 254, 0.7));
    color: white;
    padding: 12px 18px 20px 18px;
    border-radius: 10px;
    z-index: 999;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    text-align: center;
    max-width: 500px;
    min-width: 250px;
    border: 2px solid #080c54;
    box-shadow: 0 4px 0 #080c54;
    white-space: nowrap;
    padding-bottom: 30px;
}


@media (max-width: 1500px) and (min-width: 1000px) {
    #map-header {
        left: 55%;
        transform: translateX(-50%);
        max-width: 80%;
        white-space: normal;
        line-height: 1.3em;
        font-size: 0.9rem;
        padding: 10px 16px 18px 16px;
        border-radius: 8px;
        padding-bottom: 30px;
    }
}


@media (max-width: 1000px) {
    #map-header {
        left: 50%;
        transform: translateX(-50%);
        max-width: 90%;
        white-space: normal;
        line-height: 1.3em;
    }
}


@media (max-width: 768px) {
    #map-header {
        font-size: 0.9rem;
        padding: 10px 14px 16px 14px;
        padding-bottom: 30px;
    }

    .map-title {
        font-size: 1rem;
    }

    .map-description {
        font-size: 0.75rem;
    }
}


@media (max-width: 480px) {
    #map-header {
        left: 50%;
        font-size: 0.8rem;
        padding: 8px 10px 12px 10px;
        border-radius: 6px;
    }
}



.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.map-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    word-break: break-word;
}

.map-description {
    font-size: 0.8rem;
    opacity: 0.85;
    line-height: 1.3em;
    white-space: normal;
    word-wrap: break-word;
    padding-top: 2px;
}

.psi-badge {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background-color: #8e2a8b;
    color: white;
    font-weight: bold;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    letter-spacing: 1px;
}



    #province-dropdown {
        position: absolute;
        top: 90px;
        left: 407px;
        z-index: 1100;
        display: inline-block;
    }


        #province-dropdown .dropdown-panel {
            display: none;
        }



        /* Trigger button style */
        #province-dropdown .dropdown-trigger {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.001px;
            background: white;
            border: 2px solid #080c54;
            border-radius: 8px;
            padding: 6px 10px;
            font-family: 'Poppins', 'Segoe UI', sans-serif;
            font-weight: 600;
            color: #080c54;
            box-shadow: 0 4px 0 #080c54;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
        }

            #province-dropdown .dropdown-trigger strong {
                writing-mode: vertical-rl;
                text-orientation: upright;
                transform: rotate(360deg);
                font-size: 11px;
                letter-spacing: 0.001px;
                font-family: 'Poppins', sans-serif;
            }

            #province-dropdown .dropdown-trigger:hover {
                background-color: #f1f2f7;
                transform: translateY(1px);
                box-shadow: 0 2px 0 #080c54;
            }

        /* ✅ Dropdown opens below the button */
        #province-dropdown .dropdown-panel {
            display: none;
            position: absolute;
            top: 0;
            left: 100%;
            margin-left: 2px;
            background: white;
            padding: 12px 14px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.15);
            width: 220px;
            border: 1px solid #080c54;
            color: #080c54;
            z-index: 1001;
        }

        /* Radio button list */
        #province-dropdown .checkbox-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

            #province-dropdown .checkbox-group label {
                display: flex;
                align-items: center;
                gap: 8px;
                font-size: 14px;
                font-weight: 500;
                color: #080c54;
                cursor: pointer;
            }

        #province-dropdown input[type="radio"] {
            accent-color: #080c54;
            cursor: pointer;
        }


    #layer-control-wrapper {
        position: absolute;
        top: 140px;
        left: 410px;
        z-index: 1000;
    }

    /* Trigger button stays the same */
    #layer-control-trigger {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.001px;
        background: white;
        border: 2px solid #080c54;
        border-radius: 8px;
        padding: 6px 10px;
        font-family: 'Poppins', 'Segoe UI', sans-serif;
        font-weight: 600;
        color: #080c54;
        box-shadow: 0 4px 0 #080c54;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
        position: relative; /* ✅ required to anchor absolute dropdown */
    }

        #layer-control-trigger strong {
            writing-mode: vertical-rl;
            text-orientation: upright;
            transform: rotate(360deg);
            font-size: 11px;
            letter-spacing: 0.5px;
            font-family: 'Poppins', sans-serif;
        }

        #layer-control-trigger:hover {
            background-color: #f1f2f7;
            transform: translateY(1px);
            box-shadow: 0 2px 0 #080c54;
        }

    .icon-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

    /* ✅ Dropdown styled as floating panel */
    #layer-control-box {
        display: none;
        position: absolute;
        top: 0; /* Align with trigger's top */
        left: 100%; /* Opens to the right */
        margin-left: 2px; /* Small gap */
        background: white;
        padding: 12px 14px;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0,0,0,0.15);
        width: 200px;
        border: 1px solid #080c54;
        color: #080c54;
        z-index: 9999; /* Always on top */
    }



    /* Radio group remains same */
    .radio-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

        .radio-group label {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 500;
            color: #080c54;
            cursor: pointer;
        }

        .radio-group input[type="radio"] {
            accent-color: #080c54;
            width: 16px;
            height: 16px;
            cursor: pointer;
        }




    /*features css*/
    #features {
        position: absolute;
        top: 185px;
        left: 410px;
        z-index: 1000;
    }

        #features > div:first-child {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: white;
            border: 2px solid #080c54;
            border-radius: 8px;
            padding: 8px 14px;
            font-family: 'Segoe UI', sans-serif;
            font-size: 14px;
            font-weight: 600;
            color: #080c54;
            box-shadow: 0 4px 0 #080c54;
            cursor: pointer;
            transition: all 0.2s ease-in-out;
        }

            #features > div:first-child:hover {
                background-color: #f1f2f7;
                transform: translateY(1px);
                box-shadow: 0 2px 0 #080c54;
            }

.icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .icon svg {
        width: 100%;
        height: 100%;
        display: block;
    }



    #layer-control {
        display: none;
    }


    #layer-control {
        position: absolute;
        top: -10px;
        left: 100%;
        margin-left: 1px;
        display: none;
        background: white;
        padding: 12px 14px;
        border-radius: 8px;
        box-shadow: 0 0 10px rgba(0,0,0,0.15);
        margin-top: 5px;
        width: 200px;
        border: 1px solid #080c54;
        color: #080c54;
    }

    /* ✅ Checkbox group styling (renamed) */
    .checkbox-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 10px;
    }

        .checkbox-group label {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 14px;
            font-weight: 500;
            color: #080c54;
            cursor: pointer;
        }

        .checkbox-group input[type="checkbox"] {
            accent-color: #080c54;
            width: 16px;
            height: 16px;
            cursor: pointer;
        }
    /*features css close*/


    #map-footer {
        position: absolute;
        bottom: 0;
        left: 24rem;
        width: calc(100% - 24rem);
        background: rgba(255, 255, 255, 0.9);
        text-align: center;
        padding: 0.5rem;
        font-size: 0.9rem;
        z-index: 999;
    }

    .category-link, .subcategory-link {
        cursor: pointer;
        font-weight: bold;
    }

        .category-link:hover, .subcategory-link:hover {
            text-decoration: underline;
        }


    .footer-social {
        position: absolute;
        left: 1rem;
        bottom: 0.5rem;
        display: flex;
        gap: 12px;
    }

        .footer-social a {
            text-decoration: none;
            font-size: 1.3rem;
        }

            .footer-social a:nth-child(1) {
                color: #1877F2; /* Facebook Blue */
            }

            .footer-social a:nth-child(2) {
                color: #E1306C; /* Instagram Pink (note: gradient not possible via plain color) */
            }

            .footer-social a:nth-child(3) svg {
                fill: #000000; /* X (Twitter) Black */
            }



    #select-topic-box {
        position: absolute;
        top: 50%;
        left: 53%;
        transform: translate(-50%, -50%);
        background-color: white;
        border: 2px solid #4682B4;
        padding: 10px 20px;
        font-size: 16px;
        color: #4682B4;
        border-radius: 5px;
        display: none;
        z-index: 1000;
        font-weight: bold;
        display: flex;
        align-items: center;
    }

    .arrow {
        width: 0;
        height: 0;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-right: 10px solid #4682B4;
        margin-right: 10px;
    }



    /* === Sidebar Main === */
    aside {
        position: fixed;
        width: 24rem;
        height: 94vh;
        background: white;
        display: flex;
        flex-direction: column;
        border-right: 1px solid #dee2e6;
        z-index: 1000;
    }

    .sidebar-scroll {
        overflow: auto;
        flex-grow: 1;
        max-height: calc(70vh - 300px);
    }

    .sidebar-scroll-body {
        overflow-y: auto;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    /* === Card Layout === */
    #sidebar-items .cards-wrapper {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    /* Hide map container when no topic is selected (desktop view) */
    body:not(.topic-selected) #map-container {
        display: none !important;
    }

    @media (max-width: 999px) {
        /* Sidebar base (default full width) */
        aside {
            position: fixed !important;
            top: 60px;
            left: 0;
            width: 100% !important;
            max-width: none !important;
            height: calc(100vh - 60px);
            transform: translateX(0);
            box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease, width 0.3s ease;
            z-index: 1000;
        }

        /* Sidebar shrinks when topic is selected */
        body.topic-selected aside {
            width: 90% !important;
        }

        /* Sidebar hidden (slid left) */
        body.sidebar-hidden aside {
            transform: translateX(-100%);
        }

        /* Card layout for tablets - 2 columns */
        #sidebar-items .cards-wrapper {
            grid-template-columns: 1fr 1fr !important;
        }

        /* Show map container on mobile even when no topic is selected */
        body:not(.topic-selected) #map-container {
            display: block !important;
        }

        /* Sidebar Toggle Button styles */
        .sidebar-toggle {
            display: none;
            align-items: center;
            justify-content: center;
            position: fixed;
            top: 50%;
            left: 0;
            transform: translateY(-50%);
            width: 40px;
            height: 90px;
            background: #fff;
            border: 1px solid #080c54;
            border-left: none;
            border-radius: 0 8px 8px 0; /* Rounded right side */
            cursor: pointer;
            z-index: 1100;
            box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.15);
            padding: 0;
            transition: background 0.3s ease;
        }

        /* Show toggle only when topic is selected */
        body.topic-selected .sidebar-toggle {
            display: block;
            left: 90%;
        }

        /* When sidebar is hidden, move toggle to far left */
        body.sidebar-hidden .sidebar-toggle {
            left: 0 !important;
            border-radius: 0 4px 4px 0;
        }

        .sidebar-toggle:hover {
            background: #f0f0ff;
        }

        .sidebar-toggle svg {
            width: 24px;
            height: 24px;
            stroke: #5856d6;
        }

        .leaflet-left .leaflet-control-zoom {
            position: absolute !important;
            left: 10px !important;
        }

        .leaflet-left .leaflet-control-csv-export {
            position: fixed !important;
            left: auto !important;
            right: 10px !important;
            top: 185px !important;
        }

        #province-dropdown {
            position: absolute;
            left: 12px;
        }

            #province-dropdown .dropdown-trigger strong {
                display: none !important;
            }


        /* Snapshot button custom position */
        .leaflet-control-snapshot {
            position: fixed !important;
            left: auto !important;
            right: 10px !important;
            top: 130px !important;
        }

        #disclaimer-info {
            position: fixed !important;
            left: auto !important;
            right: 12px !important;
            top: 230px !important;
        }

        #layer-control-wrapper {
            position: absolute;
            left: 15px;
            top: 140px;
        }

        #layer-control-trigger strong {
            display: none !important;
        }

        #features {
            position: absolute;
            left: 15px !important;
            top: 185px;
        }

        #map-footer {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
        }

        #pbs-footer {
            position: absolute;
            bottom: 0 !important;
            width: 100% !important;
        }

        .pbs-header {
            gap: 32px !important;
        }

        #scale-bar-container {
            bottom: 60px !important;
            right: 30px !important;
            padding: 12px 10px 20px;
            overflow-x: hidden; /* ✅ Hide anything that goes out */
            right: 0;
            max-width: 100vw;
        }
    }

    /* === Small Mobile Devices === */
    @media (max-width: 576px) {
        .dropdown-wrapper > div {
            grid-template-columns: 1fr 1fr;
        }

        /* Single column for small devices */
        #sidebar-items .cards-wrapper {
            grid-template-columns: 1fr !important;
        }

            /* Fix for radio buttons moving while scrolling */
            #sidebar-items .cards-wrapper .d-flex {
                position: relative;
                padding-left: 0;
                padding-right: 0;
                flex-wrap: nowrap;
                overflow-x: hidden;
                align-items: center;
                gap: 0.5rem;
            }

            #sidebar-items .cards-wrapper .form-check-input {
                position: absolute;
                left: 0;
                top: 2px;
                margin: 0 !important;
                width: 16px;
                height: 16px;
            }

            #sidebar-items .cards-wrapper .form-check-label {
                padding-left: 24px;
                flex: 1;
                font-size: 14px;
                line-height: 1.2;
                word-break: break-word;
            }

        header img {
            height: 30px !important;
        }

        header span {
            font-size: 14px !important;
        }

        #map-footer {
            position: absolute;
            bottom: 0px !important;
            left: 0;
            width: 100%;
        }

        #scale-bar-container {
            bottom: 60px !important;
            right: 20px !important;
            padding: 12px 10px 20px;
            overflow-x: hidden; /* ✅ Hide anything that goes out */
            right: 0;
            max-width: 100vw;
        }
    }

    @media (max-width: 600px) {
        #map-footer {
            font-size: 0.75rem;
            padding: 0.4rem 0.8rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            text-align: center;
        }

        .footer-social {
            position: static;
            order: -1; /* show social icons on top */
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-bottom: 4px;
        }

            .footer-social a {
                font-size: 0.9rem;
            }
    }



    /* === Desktop Only === */
    @media (min-width: 1000px) {
        .sidebar-toggle {
            display: none !important;
        }
    }

    @media (max-width: 1557px) {
        #pbs-footer {
            position: absolute;
            bottom: 0 !important;
        }
    }


    @media (min-width: 1000px) and (max-width: 1189px) {
        .leaflet-left .leaflet-control-zoom {
            position: absolute !important;
            left: 360px !important;
        }

        .leaflet-left .leaflet-control-csv-export {
            position: absolute !important;
            left: 360px !important;
        }


        /* Snapshot button custom position */
        .leaflet-control-snapshot {
            position: absolute !important;
            left: 360px !important;
        }

        #disclaimer-info {
            position: absolute !important;
            left: 376px !important;
        }

        #layer-control-wrapper {
            position: absolute;
            left: 365px;
        }

        #province-dropdown {
            position: absolute;
            left: 365px;
        }

        #features {
            position: absolute;
            left: 365px !important;
        }

        #map-footer {
            position: absolute;
            bottom: 0;
            left: 22rem;
            width: calc(100% - 22rem);
        }

        #pbs-footer {
            position: absolute;
            bottom: 0 !important;
            height: 220px !important;
        }


        aside {
            width: 22rem !important;
        }

        #sidebar-scroll {
            height: 60vh !important;
        }

        .dropdown-wrapper label {
            display: flex;
            align-items: center;
            color: #007bff;
            font-size: 13px;
            cursor: pointer;
            padding: 1px 0;
        }

        .sidebar-toggle.moved {
            left: calc(22rem + 4px); /* Adjust toggle button */
        }

        #scale-bar-container {
            max-width: calc(100vw - 23rem); /* Leave space for sidebar + some gap */
            right: 15px; /* Add breathing room from edge */
        }
    }

    @media (max-width: 1900px) {
        #pbs-footer {
            position: absolute;
            bottom: 0 !important;
        }
    }


    #ranking-table-container {
        position: absolute;
        top: 10px;
        right: 10px;
        width: 350px;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.7);
        border-radius: 5px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        overflow: hidden;
    }


        #ranking-table-container.collapsed {
            width: 40px;
            height: 40px;
        }



    #ranking-table-header {
        padding: 10px;
        background-color: rgba(0, 0, 0, 0.1);
        font-weight: bold;
        text-align: center;
    }

    #ranking-table {
        width: 100%;
        border-collapse: collapse;
    }



    .highlighted-row {
        background-color: #ffeb3b !important;
        font-weight: bold !important;
    }

    #ranking-table th {
        background-color: rgba(0, 0, 0, 0.1);
        padding: 5px;
        text-align: left;
    }
        /* Center the Top and Bottom 5 headers */
        #ranking-table th[colspan="2"] {
            text-align: center;
            padding: 8px;
            font-weight: bold;
        }

    /* Table column headers */
    #ranking-table thead tr:not(.top-header):not(.bottom-header) th {
        text-align: left;
        padding: 6px;
    }

        /* Align the Value column to right */
        #ranking-table thead tr:not(.top-header):not(.bottom-header) th:last-child {
            text-align: right;
            padding-right: 10px; /* 👈 adjust this value as needed */
        }

    .scroll-equal {
        max-height: calc((60vh - 50px) / 3); /* same logic, just 60vh */
        overflow-y: auto;
    }


    #ranking-table td {
        padding: 5px;
        border-bottom: 1px solid #ddd;
    }

    #ranking-table tr:hover {
        background-color: rgba(0, 0, 0, 0.05);
        cursor: pointer;
    }

    /* Scrollable Areas — split into 3 equal parts */
    .scroll-equal {
        max-height: calc((60vh - 50px) / 3); /* same logic, just 60vh */
        overflow-y: auto;
    }


    .top-header {
        background-color: #080c54;
        color: white;
        font-weight: bold;
    }

    .bottom-header {
        background-color: #cde594;
        color: #333;
        font-weight: bold;
    }

    @media (max-width: 1700px) {
        #ranking-table-container {
            width: 250px;
            max-height: 68vh;
            top: 10px;
        }

    }

    @media (max-width: 1443px) {
        #ranking-table-container {
            width: 250px;
            max-height: 68vh;
            top: 10px;
        }



        /* ====================== MOBILE DRAWER STYLES ====================== */
        @media (max-width: 1000px) {
            #ranking-table-container {
                position: fixed;
                top: 60px;
                right: 0;
                width: 250px;
                max-height: calc(100vh - 70px);
                background: white;
                box-shadow: -2px 0 8px rgba(0, 0, 0, 0.2);
                z-index: 1000;
                overflow-y: auto;
                transition: transform 0.3s ease-in-out;
                transform: translateX(100%);
            }

                #ranking-table-container.active {
                    transform: translateX(0);
                }

            #ranking-table-toggle {
                position: fixed;
                top: 50%;
                right: 0;
                transform: translateY(-50%);
                width: 40px;
                height: 90px;
                background: #fff;
                border: 1px solid #080c54;
                border-right: none;
                border-radius: 8px 0 0 8px;
                cursor: pointer;
                z-index: 1100;
                display: flex;
                align-items: center;
                justify-content: center;
                box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.15);
                padding: 0;
            }

                #ranking-table-toggle svg {
                    width: 24px;
                    height: 24px;
                }
        }
    }

    /* Table inside drawer */
    .ranking-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 14px;
    }

        .ranking-table th,
        .ranking-table td {
            border: 1px solid #ccc;
            padding: 8px;
            text-align: left;
        }

        .ranking-table th {
            background-color: #f0f0f0;
        }

    .scroll-equal {
        max-height: calc((60vh - 50px) / 3); /* same logic, just 60vh */
        overflow-y: auto;
    }

    /* Optional: ensure table row height is consistent */
    #ranking-table td, #ranking-table th {
        padding: 4px 6px;
        line-height: 1.8em;
    }


    #ranking-table td, #ranking-table th {
        line-height: 1.8em;
        padding: 4px 6px;
    }


    #ranking-table-container.collapsed {
        height: 40px;
        width: 40px;
    }

        #ranking-table-container.collapsed #ranking-table-content {
            display: flex;
            flex-direction: column;
            flex: 1;
            overflow: hidden; /* ✅ Prevent inner overflow */
        }


    .custom-link {
        color: #ffff;
        font-size: 0.875rem;
        text-decoration: none;
        font-weight: bold;
        text-decoration: underline;
    }

        .custom-link:hover {
            text-decoration: underline;
        }

    #pbs-footer {
        position: absolute;
        bottom: 0;
        height: 240px;
        left: 0;
        right: 0;
        background: #414042;
    }

    .pbs-header {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }


    .pbs-logo {
        height: 26px;
        width: auto;
        object-fit: contain;
        filter: brightness(0) invert(1);
    }

    .pbs-header h2 {
        font-size: 1.25rem;
        font-weight: 700;
        color: white;
        margin: 0;
        font-family: 'Source Sans Pro', sans-serif;
        line-height: 1;
        transform: translateY(2px);
    }

    .psi-license {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        font-family: 'Source Sans Pro', sans-serif;
        font-size: 10px;
        color: #ddd;
        margin-top: 20px;
        padding-left: 12px;
    }

    .psi-logo {
        font-weight: 900;
        font-size: 15px;
        letter-spacing: -1px;
        color: white;
        margin-bottom: 4px;
    }

    .psi-text a {
        color: #9ecfff;
        text-decoration: none;
    }

        .psi-text a:hover {
            text-decoration: underline;
        }
