/* import Poppins in google fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@200;400;600&display=swap');

/* root */
body {
  font-family: 'Poppins', sans-serif !important;
  margin: 0;
  padding: 0;
  background-color: #f4f4f4;
}

:root {
    --primary: #1C3662;
    --secondary: #014AA8;
    --main-card-sub-card: #E2E8F0;
    --black: #252525;
    --white: #fff;
    --form-control-stroke: #ced4da;
    --form-control-bg: rgba(255, 255, 255, 0.27);
    --tooltip-stroke: #8FBCFA;
    --tooltip-bg: #E9F3FF;
    --primary-hover: rgba(28, 54, 98, 0.46);
    --secondary-hover: rgba(228, 194, 60, 0.46);
    --secondary-button: #E4C23C;
    --bs-primary-rgb: 28, 54, 98;
    --bs-secondary-rgb: 1, 74, 168;
    --bs-success-rgb: 25, 135, 84;
    --bs-font-sans-serif: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    --bs-border-radius: 10px;
    --bs-btn-active-color: white;
    --bs-btn-active-bg: var(--secondary-button);
    --bs-btn-active-border-color: var(--secondary-button);
    --bs-btn-disabled-border-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}
body {
    overflow: hidden;
}

p {
    margin: 0;
    padding: 0;
    font-weight: 400;
    font-size: 0.75rem;
}

.bg-login-image {
  background: url("../img/login-bg.jpeg");
  background-position: center;
  background-size: cover;
}

.custom-navbar {
    background-color: #172a5a;
    background-image: url('../img/bsp-nav-bar.svg');
    background-size: cover;
    background-repeat: repeat;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
    border-radius: 8px;
    /* margin: 10px; */
    position: absolute;
    z-index: 5; /* Ensure it sits above the map */
    height: 100%;
    width: 100%;
    align-content: center;
}

/* Custom Input Group for the Search Box (Input) */
.custom-input-group {
    width: 250px;
}

.custom-search-input {
    /* Style for the 'Search Location' input field */
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    border-radius: 6px;
    padding: 8px 12px;
}

.custom-search-input::placeholder {
    /* Placeholder text style (e.g., 'Search Location') */
    color: rgba(255, 255, 255, 0.6);
    opacity: 1;
}

.custom-search-input:focus {
    /* Focus state (optional, for better UX) */
    background-color: rgba(255, 255, 255, 0.15); 
    border-color: #ffffff;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Custom Buttons ('Environment' and 'Physical Risk') */
.custom-btn {
    /* General button style */
    background-color: var(--form-control-bg);
    border: 1px solid var(--form-control-stroke);
    color: #ffffff;
    border-radius: 10px;
    padding: 8px 15px;
    transition: all 0.2s ease-in-out;
}

.custom-btn:hover {
    /* Hover/Focus state */
    background-color: var(--primary-hover);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: none; /* Remove default Bootstrap shadow if it conflicts */
}

.custom-btn:focus {
    /* Hover/Focus state */
    background-color: var(--secondary-button);
    border-color: var(--secondary-button);
    color: #ffffff;
    box-shadow: none; /* Remove default Bootstrap shadow if it conflicts */
}

/* Menu Button - use menu from materials symbol */
.btn-menu {
    background-color: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.material-symbols-outlined {
    font-variation-settings:
    'FILL' 0,
    'wght' 200,
    'GRAD' 0,
    'opsz' 48;
    display: flex !important;
    align-content: center;
}

.dropdown-menu {
    background-color: var(--primary);
}

.dropdown-item {
    color: var(--white);
}

.dropdown-item:hover {
    background-color: var(--secondary);
    color: var(--white);
}

.dropdown-item:focus {
    background-color: var(--secondary-button);
    color: var(--white);
}

/* Custom desktopGeocoderContainer style */
.mapboxgl-ctrl-geocoder {
    font-family: 'Poppins', sans-serif !important;
    background: var(--form-control-bg) !important;
    border: 1px solid var(--form-control-stroke) !important;
    color: var(--white) !important;
    border-radius: 10px;
}

.mapboxgl-ctrl-geocoder--input {
    color: white !important;
}

/* change the mapboxgl-ctrl-geocoder--input aria-label text color */
.mapboxgl-ctrl-geocoder--input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

.mapboxgl-ctrl-geocoder--icon {
    fill: white;
}

.mapboxgl-ctrl-geocoder--icon-close {
    fill: white;
}

.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--pin-right > * {
    background: transparent !important;
}

/* Main container for zoom controls */
.mapboxgl-ctrl-group.mapboxgl-ctrl {
    display: flex;
    flex-direction: row;
    border-radius: 8px;
    overflow: hidden;
    background-color: #0047AB;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.mapboxgl-ctrl-group.mapboxgl-ctrl button:hover {
    background-color: var(--primary);
}

/* Individual zoom buttons */
.mapboxgl-ctrl-group button {
    background-color: transparent; /* Make individual button backgrounds transparent */
    color: white; /* White icon color */
    width: 40px; /* Adjust width as needed */
    height: 40px; /* Adjust height as needed */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px; /* Adjust icon size */
    font-weight: bold; /* Make + and - bolder */
    border: none; /* Remove default button borders */
    cursor: pointer;
    padding: 0; /* Remove default padding */
    transition: background-color 0.2s ease; /* Smooth transition for hover */
}

/* Separator line between buttons (optional, but good for visual separation) */
.mapboxgl-ctrl-group button + button {
    border-left: 1px solid rgba(255, 255, 255, 0.3); /* Thin white separator */
}

/* Focus state for accessibility */
.mapboxgl-ctrl-group button:focus {
    background-color: rgba(var(--secondary-button), 1);
    outline: none; /* Remove default focus outline */
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5); /* Custom focus outline */
}

.map-controls-container {
    position: absolute;
    bottom: 2.5rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.mapboxgl-ctrl-group button:last-child {
    border-radius: 0 0 0 0;
}

.mapboxgl-ctrl-group button+button {
    border-top: 0px !important;
}

.mapboxgl-ctrl-compass {
    /* Set the button to use flexbox to perfectly center the icon */
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.new-compass-icon {
    /* Ensure smooth rotation animation */
    transition: transform 0.1s linear; 
    /* Prevent any jiggle during rotation */
    backface-visibility: hidden;
}

.map-control-buttons {
    padding: 0 10px 0 10px !important;
    width: 100% !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mapboxgl-ctrl-group.mapboxgl-ctrl button:active {
    background-color: var(--secondary-button);
}

.form-switch .form-check-input {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%2828, 54, 98, 0.25%29'/%3e%3c/svg%3e");
    width: 2em;
    margin-left: -2.5em;
    background-image: var(--bs-form-switch-bg);
    background-position: left center;
    border-radius: 2em;
    transition: background-position .15s ease-in-out;
}

.form-check-input:checked {
    background-color: var(--secondary-button);
    border-color: var(--secondary-button);
}

.form-check {
    margin-bottom: 0px;
}

.icon-btn-group {
    border-radius: 10px;
    background-color: var(--secondary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#topbarDropdowns {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* width: 100%; */
    justify-content: end;
    position: absolute;
    top: 5rem;
    right: 0rem;
    z-index: 5;
    gap: 1rem;
}

#main-card {
    display: flex;
    position: absolute;
    z-index: 5;
    bottom: 2.5rem;
    left: 1rem;
    background: white;
    border-radius: 10px;
    flex-direction: column;
    width: 36rem;
    max-height: 40rem;
    overflow-y: hidden;
}

@media (max-width: 480px) {
    #main-card {
        display: flex;
        position: absolute;
        z-index: 5;
        bottom: 5.5rem;
        left: 1rem;
        background: white;
        border-radius: 10px;
        flex-direction: column;
        width: 25rem;
        max-height: 20rem;
        overflow-y: hidden;
    }
}

/* Custom style to override the collapse transition for the main card hide */
.card-close-hide.collapsing, 
.card-close-hide.collapse:not(.show) {
    /* Ensures the card uses a clean display: none; toggle for disappearing */
    display: none !important;
}
.card-close-hide.show {
    /* Ensures the card is displayed when "open" */
    display: block !important;
}

.more-details-toggle .material-icons {
    vertical-align: middle;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

/* When the button does *not* have the 'collapsed' class (i.e., it is open), rotate the icon up */
.more-details-toggle:not(.collapsed) .material-icons {
    transform: rotate(180deg); 
}
/* When the button *has* the 'collapsed' class (i.e., it is closed), the rotation is reset (0 degrees) */
.more-details-toggle.collapsed .material-icons {
    transform: rotate(0deg); 
}




.custom-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Ensures rounded corners cut off overflow */
}
.card-header-main {
    padding: 1rem;
    background-color: #fff; /* Match card background */
    border-bottom: none; /* No default border */
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
}
.card-header-main .title {
    font-size: 0.9rem;
    color: #6c757d; /* Muted text */
    margin-bottom: 0;
}
.card-header-main .main-number {
    font-size: 3.5rem; /* Large number */
    font-weight: 700;
    line-height: 1;
}
@media (max-width: 480px) {
    .card-header-main .main-number {
        font-size: 2.5rem; /* Adjust for smaller screens */
    }
}
.btn-overseas {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 10px;
    padding: 0rem 1.5rem;
    font-size: 0.75rem;
}
.stats-grid-item {
    padding: 0.5rem 0; /* Adjust padding for items like Head Office */
}
.stats-grid-item .label {
    font-size: 0.9rem;
    color: #6c757d;
}
.stats-grid-item .value {
    font-size: 1.5rem;
    font-weight: 600;
}
.chart-placeholder {
    background-color: #e9ecef; /* Light grey for the bar chart area */
    height: 150px; /* Adjust height as needed */
    margin-top: 1rem;
    border-radius: 5px;
    /* Placeholder styles - replace with actual chart library */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 0.9rem;
}

/* Custom styles for the "More Details" button */
.more-details-toggle {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.75rem;
    background-color: var(--primary);
    border-top: 1px solid #dee2e6;
    color: #ffffff;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-radius: 0px 0px 10px 10px;
}
.more-details-toggle:hover {
    background-color: #e9ecef;
    color: #0d6efd;
}
.more-details-toggle .material-icons {
    vertical-align: middle;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}
.more-details-toggle[aria-expanded="true"] .material-icons {
    transform: rotate(180deg);
}

/* Styles for the expanded content items */
.expanded-item {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}
.expanded-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.expanded-item .item-title {
    font-size: 1.1rem;
    font-weight: 600;
}
.expanded-item .item-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #343a40;
}
.expanded-item .item-sub-values {
    font-size: 0.85rem;
    color: #6c757d;
}
.expanded-item .material-icons.info-icon {
    font-size: 1.2rem;
    color: #6c757d;
}
.expanded-content-grid {
    padding: 1rem;
    background-color: #fdfdfd; /* Slightly different background for expanded content */
}
.expanded-content-grid .col-md-6:nth-child(odd) {
    border-right: 1px solid #e9ecef; /* Separator for vertical lines */
}
.expanded-content-grid .col-md-6:nth-child(odd),
.expanded-content-grid .col-md-6:nth-child(even) {
    border-bottom: 1px solid #e9ecef; /* Separator for horizontal lines */
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}
/* Remove border for last row items */
.expanded-content-grid .col-md-6:nth-last-child(-n + 2) {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
/* Remove right border for last item of the first column in the last row */
.expanded-content-grid .col-md-6:nth-last-child(2) {
    border-right: 1px solid #e9ecef;
}

#moreDetailsContent {
    overflow-y: scroll;
    max-height: 17rem;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 0.5rem; */
}

.item-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.offices-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
}

.data-bar {
    /* Default color when not hovered */
    fill: var(--secondary);
    transition: fill 0.3s ease; /* Adds a smooth transition */
}

.data-bar.highlighted {
    /* Color when the 'highlighted' class is added by JavaScript */
    fill: var(--primary);
    /* You can also change the border color (stroke) */
    stroke: #333333;
    stroke-width: 2px;
}

.sub-card {
    background-color: var(--main-card-sub-card);
    border-radius: 10px;
    padding: 1rem;
}

.tooltip-box {
    background-color: var(--tooltip-bg);
    border: 1px solid var(--tooltip-stroke);
    border-radius: 10px;
}

.mapboxgl-popup-content {
    border-radius: 10px;
}

.form-select {
    /* change icon color to white */
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    /* --bs-form-select-bg-icon: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='white' d='M4 6l4 4 4-4z'/%3e%3c/svg%3e"); */
    display: block;
    width: 100%;
    padding: .375rem 2.25rem .375rem .75rem;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: var(--secondary);
    background-image: var(--bs-form-select-bg-img), var(--bs-form-select-bg-icon, none);
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    transition: border-color .15s 
ease-in-out, box-shadow .15s 
ease-in-out;
}

#secondMenuDropdown {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* width: 100%; */
    justify-content: end;
    position: absolute;
    top: 9.5rem;
    right: 0rem;
    z-index: 5;
    gap: 1rem;
}

#thirdMenuDropdown {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* width: 100%; */
    justify-content: end;
    position: absolute;
    top: 5rem;
    left: 0rem;
    z-index: 5;
    gap: 1rem;
}

#fourthMenu {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    /* width: 100%; */
    justify-content: end;
    position: absolute;
    top: 13rem;
    right: 0rem;
    z-index: 5;
    gap: 1rem;
}

.ai-buttons-container {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
}

#additionalTopbarMenus {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    top: 5rem;
    position: absolute;
    right: 0rem;
}

.hazard-popup {
    display: flex;
    flex-direction: column;
    transform: translateX(0px);
    width: 36rem;
    height: 17rem;
    overflow-y: scroll;
    background-color: white;
    border-radius: 10px;
    padding: 1rem;
}

.scenario-popup {
    display: flex;
    flex-direction: column;
    transform: translateX(0px);
    width: 45rem;
    max-height: 38rem;
    overflow-y: scroll;
    background-color: white;
    border-radius: 10px;
    padding: 1rem;
}

#scenario-analysis-overview {
    /* height: 16rem; */
    align-items: end;
    display: flex;
}

.loader {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary);
    box-shadow: 32px 0 var(--primary), -32px 0 var(--primary);
    position: relative;
    animation: flash 0.5s ease-out infinite alternate;
}

@keyframes flash {
    0% {
        background-color: rgba(28, 54, 98, 0.13); /* var(--primary) with opacity */
        box-shadow: 32px 0 rgba(28, 54, 98, 0.13), -32px 0 var(--primary);
    }
    50% {
        background-color: var(--primary);
        box-shadow: 32px 0 rgba(28, 54, 98, 0.13), -32px 0 rgba(28, 54, 98, 0.13);
    }
    100% {
        background-color: rgba(28, 54, 98, 0.13);
        box-shadow: 32px 0 var(--primary), -32px 0 rgba(28, 54, 98, 0.13);
    }
}
      