body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Dropdown styles */
.dropdown {
    width: 190px;
}

.dropdown-icon {
    fill: #585858;
    height: 22px;
    margin-left: -1px;
}

.dropdown-toggle {
    border-radius: 4px;
    padding: 4px 16px;
    width: 100%;
    text-align: left;
    background-color: #fff;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-toggle::after {
    margin-left: 10px;
}

.dropdown-menu {
    width: 100%;
    border-radius: 5px;
    margin-top: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.dropdown-item {
    padding: 8px 16px;
    color: #666;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item.active {
    background-color: #f8f9fa;
    color: #333;
}

/* Performance table specific styles */
#performance-table th:nth-child(1) { width: 15%; }
#performance-table th:nth-child(2) { width: 15%; }
#performance-table th:nth-child(3) { width: 15%; }
#performance-table th:nth-child(4) { width: 15%; }

.dataTables_filter {
    padding: 8px 1rem;
    background: #f2f2f2;
    color: #464646;
    font-weight: 500;
    text-align: left !important;
}

/* DataTables styles */
.top-table {
    background: #f2f2f2;
}

.dt-search {
    border-top: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-left: 1px solid #ddd;
    text-align: left !important;
    padding: 4px 16px 4px 16px;
    color: #565656;
}

table.table.dataTable.table-striped>tbody>tr:nth-of-type(2n+1)>* {
    background: #f2f2f2 !important;
    box-shadow: none;
}

.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
}

.dataTables_wrapper .dataTables_paginate {
    text-align: center;
    margin-top: 10px;
    background-color: #f2f2f2;
    padding: 10px;
    border-radius: 0 0 8px 8px;
}

.dataTables_paginate {
   /* Added additional margin-top so it doesn't conflict when .dataTables_wrapper is used */
    margin-top: 20px;
}
/* paginate button base styles */
.paginate_button {
    padding: 0.5em 1em;
    margin: 0 0.2em;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    color: #666;
}
/* paginate button styles inside .dataTables_wrapper */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    margin-left: 4px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    color: #0074D9;
}

ul.pagination {
    --bs-pagination-font-size: 15px;
}

.page-link {
    color: #0074D9;
}

.active>.page-link, .page-link.active {
    background-color: #0074D9;
    border-color: #0074D9;
}

.bottom-table {
    padding: 5px;
    background: #f2f2f2;
}
.bottom-table nav {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

/* override specific styles */
.page-item:first-child .page-link {
    border-radius: 3px;
}

.page-item:last-child .page-link {
    border-radius: 3px;
}

.paginate_button {
    padding: 5px 10px;
    margin: 0 5px;
    border: none;
    cursor: pointer;
}

.paginate_button.current {
    background: #f0f0f0;
    border-radius: 4px;
}

.paginate_button.previous, .paginate_button.next {
    font-weight: bold;
}

.selected-row {
    background-color: #f0f7ff !important;
}

/* Header styles */
.header {
    background-image: linear-gradient(to right, #274771, #24456D, #254B75, #26507D);
    color: #fff;
    padding: 10px 15px 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 55px;
}

.header-title {
    display: flex;
    align-items: center;
    font-size: 23px;
    font-weight: 600;
    width: 21rem;
}

.header-title svg {
    margin-right: 10px;
}

.header-suffix {
    color: #2ab14e;
}

.header-update {
    display: flex;
    align-items: center;
}

.header-update svg {
    /*margin-right: 8px;*/
}

/* Link styles */
.location-link {
    color: #0074D9;
    text-decoration: none;
    font-weight: 500;
}

.location-link:hover {
    text-decoration: underline;
}

/* Layout containers */
.container-fluid {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 100px);
    padding: 0 !important;
}

.map-container {
    position: relative;
    flex: 1;
    display: flex;
}

/* Dashboard styles */
.dashboard {
    background-color: #f5f5f5;
    padding: 13px;
    display: flex;
    justify-content: space-around; /* Distribute space evenly when in a row */
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.1), 0 6px 12px rgba(0,0,0,0.1);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.dashboard-item {
    margin: 0 10px;
    font-size: 14px;
    text-align: left;
    flex: 0 0 auto;
    height: calc(2em + 2.7rem);
}

.dashboard::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

.dot-container {
    z-index: 10;
    display: none !important;
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: none;
    background: #ddd;
    padding: 0;
}

#scroll-buttons {
    display: none !important;
}

.dot:hover {
    background: #808080;
    transition: background 250ms;
}

.dot.active {
    background: #808080;
}

.dashboard {
    scroll-snap-type: x mandatory;
}

.dashboard-item {
    scroll-snap-align: start;
}

.dashboard-item h5 {
    margin-bottom: 7px;
    font-size: 15px;
    color: #808080;
}

.dashboard-item p {
    margin: 0;
    font-size: 27px;
    font-weight: bold;
}

.metric-container {
    display: flex;
    text-align: left;
}

.metric-container p {
    min-width: 30px;
    display: inline-block;
    overflow: visible;
}

.line {
    fill: none;
    stroke: #4a90e2;
    stroke-width: 2px;
    stroke-linecap: round;
}

.point {
  fill: #ff5c5c;
  stroke: white;
  stroke-width: 1px;
}

.point.max {
  fill: #ff5c5c;
}

.point.min {
  fill: #16a34a;
}

.point-label {
  font-size: 11px;
  fill: #505050;
  font-weight: 600;
}

/* Map styles */
#map {
    width: 100%;
    height: 100%;
}

.mapboxgl-popup {
    padding-bottom: 5px;
    z-index: 1000;
}

.mapboxgl-popup-content {
    font: 400 15px/16px 'Source Sans Pro', 'Helvetica Neue', sans-serif;
    padding: 0;
    width: 270px;
}

.mapboxgl-popup-anchor-top > .mapboxgl-popup-tip {
    /*border-bottom-color: #404040;*/
}

.mapboxgl-popup-anchor-top > .mapboxgl-popup-content {
    /*margin-top: 3px;*/
}

.pop-up-type-text {
    margin-top: 15px;
}

.pop-up-detail-text {
    line-height: 1.5;
}

.mapboxgl-container {
    cursor: pointer;
}

.mapboxgl-ctrl-geocoder {
    width: 315px !important;
}

/* Table styles */

#data-table {
     position: fixed;
     bottom: 0;
     left: 10px;
     right: 0;
     background: #fff;
     box-shadow: 2px 0 0 0 rgba(0,0,0,.1);
     z-index: 10;
     transition: transform 0.25s ease-out;
     font-size: 15px;
     width: 75%;
     border-radius: 4px;
     transform: translateY(100%); /* Hide table completely */
}

#data-table > * {
    overflow: visible; /* Allow child elements to be visible */
}

#data-table.show {
    transform: translateY(0); /* Show the entire table */
}

.table-tab {
    position: absolute;
    bottom: 100%;
    left: 0px;
    background: #f2f2f2;
    padding: 8px 20px;
    cursor: pointer;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 11;
    user-select: none;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c6c6c;
}

#table-tab-title {
    font-weight: 500;
}

.table-tab.show {
    color: #0074d9;
    border-bottom: none;
}

.table-tab:hover {
    background: #e5e5e5;
    color: #0074D9;
}

#table-tab-icon {
     height: 21px;
     width: 21px;
     fill: currentColor;
}

.table-tab .arrow {
    margin-left: 4px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid currentColor;
    transition: transform 0.2s;
}

.table-tab.show .arrow {
    transform: rotate(180deg);
}

/*
#data-table {
     position: fixed;
     bottom: -18.35em;
     left: 10px;
     right: 0;
     background: #fff;
     box-shadow: 2px 0 0 0 rgba(0,0,0,.1);
     z-index: 10;
     transition: bottom 0.25s ease-out;
     font-size: 15px;
     width: 75%;
     border-radius: 4px;
}

#data-table > * {
    overflow: visible;
}
*/
/*
#data-table.show {
    bottom:0;
}

.table-tab {
    position: absolute; /* Position within the #data-table */
    /*top: -40px;
    bottom: 100%;   
    left: 0px;
    background: #f2f2f2;
    padding: 8px 20px;
    cursor: pointer;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    z-index: 11;
    user-select: none;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #6c6c6c;
}
*/
/*
#table-tab-title {
    font-weight: 500;
}

.table-tab.show {
    color: #0074d9;
    border-bottom: none;
}

.table-tab:hover {
    background: #e5e5e5;
    color: #0074D9;
}

#table-tab-icon {
     height: 21px;
     width: 21px;
     fill: currentColor;
}

.table-tab .arrow {
    margin-left: 4px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid currentColor;
    transition: transform 0.2s;
}

.table-tab.show .arrow {
    transform: rotate(180deg);
}
*/

.table > :not(caption) > * > * {
    padding: .4rem 1rem !important;
}

th, td {
    padding: 8px 8px 8px 3%;
    border-bottom: 1px solid #ddd !important;
    text-align: left !important;
    white-space: nowrap;
}

th {
    background-color: #f2f2f2 !important;
    position: sticky;
    top: 0;
    z-index: 1;
    cursor: pointer;
    padding-right: 20px;
}

th:hover {
    background-color: #e2e2e2;
}

th .sort-icon {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 0.7em;
}

th.sort-asc .sort-icon,
th.sort-desc .sort-icon {
    opacity: 1;
}

tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

#unified-container {
    position: absolute;
    height: 475px;
    width: 300px;
    top: 10px;
    right: 15px;
    background: rgba(242,242,242,.99);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0,0,0,0.25);
    z-index: 100;
    padding: 15px;
}

/* Filter styles */
.filter-container {
    /*
    position: fixed;
    bottom: 27.5rem;
    right: 10px;
    background: #f2f2f2;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 10px;
    z-index: 100;
    max-height: 80%;
    overflow-y: auto;
    */
    width: 275px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.filter-header span {
    font-weight: 600;
    font-size: 15px;
    color: #26507D;
}

.filter-header a {
    color: #0074D9;
    text-decoration: none;
    font-size: 14px;
}

.filter-header a:hover {
    text-decoration: underline;
}

.filter-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 0;
    background-color: #f9f9f9;
}

.filter-item:hover .marker-color {
    outline: 1px solid #828181;
    outline-offset: 1px; /* Moves the outline outside the element */
}

.filter-item label {
    cursor: pointer;
}

.filter-item:nth-child(even) {
    background-color: #f2f2f2;
}

.filter-item:hover {
    background-color: #e9e9e9;
}

.filter-item .marker-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.filter-item > input[type="checkbox"] {
    margin-right: 10px;
    color: black; /* Ensures label text isn't affected */
}
.filter-item > input[type="checkbox"] {
    accent-color: #1e90ff !important;
}
/* Utility classes */
.text-green-600 {
    color: #219540 !important;
}

.text-red-600 {
    color: #FF4136 !important;
}

#logo {
    height:26px; 
    margin-right: 9px; 
    margin-top: 2px;
}

/* Histogram */


#histogram-container {
    width: 275px;
    height: 240px;
}

#histogram-container .axis-label {
    font-family: sans-serif;
    font-size: 13px;
    fill: #888;
}

.histo-text {
    font-size: 13px;
    fill: #3c3c3c;
}

#int-num, #delay-bin-1, #delay-bin-2 {
    font-weight: 600;
}

.histogram-bar {
    cursor: pointer; /* Change cursor to pointer */
}

.histogram-bar:hover {
    fill: #73b1e7; /* Change fill color to gray on hover */
}

#tooltip {
    font-size: 13px;
    position: fixed;
    background-color: white; 
    border: 1px solid #ccc; 
    padding: 5px; 
    display: block;
    z-index: 1000;
    pointer-events: none;
}

/* Range Slider Styles */
#range-slider {
    width: 230px; /* Match slider width */
    margin-top: -28px;
    margin-left: 10px; /* To align inside container */
}

.noUi-horizontal {
    height: 8px;
}

.noUi-handle {
    background: #f9f9f9;
    /*border: 1px solid #d6d6d6;*/
}

.noUi-horizontal .noUi-handle {
    width: 12px;
    height: 16px;
    right: -6px;
    top: -5px;
    cursor: pointer !important;
}

.noUi-connect:active {
    background: #c5c5c5;
}

.noUi-handle {
    border-radius: 2px;
}

.noUi-handle:before {
    left: 3px;
    background: #d6d6d6;
    top: 3px;
    height: 8px;
}

.noUi-handle:after {
    left: 6px;
    background: #d6d6d6;
    top: 3px;
    height: 8px;
}

/* Style the bar slider */
.noUi-connect {
    background: #e0e0e0;
    cursor: pointer;
}

.noUi-target {
    border-radius: 0;
}

.noUi-connects {
    border-radius: 0;
}

@media (max-width: 767.98px) { /* Changed to 767.98px for exact match with Bootstrap */
    /*
    .dashboard {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: flex-start;
    }
    */

    .dashboard {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
    }

    .dot-container {
        display: block !important;
    }

    /*
    .dashboard-item {
        margin-bottom: 0;
        text-align: left;
    }
    */

    .dashboard-item {
        width: 50%;
        margin-bottom: 10px;
        text-align: center;
    }

    #scroll-buttons {
        display: flex !important;
    }

    .metric-container {
        text-align: center; /* Center the content including the sparkline */
        justify-content: center;  /*This will center everything to the center and is needed for correct results */
    }

    .dashboard-item p {
        margin: 0;
        font-size: 24px;
        font-weight: bold;
    }

    #unified-container {
        display: none;
    }

    .dt-search {
        display: none;
    }

    #data-table {
        width: 100%;
        left: 0px;
    }
}

@media screen and (max-width: 640px) {
    .header-title {
        font-size: 17px;
    }

    .dashboard {
        padding: 10px 10px 5px 10px;
    }

    .dashboard-item p {
        font-size: 24px;
    }

    .metric-container p {
        margin: 0;
        overflow: visible;
        padding-left: 15px;
    }

    .dropdown-icon {
        fill: #5f6368;
        height: 17px;
        margin-left: -7px;
    }

    #logo {
        height: 20px;
    }

    .dropdown {
        width: 175px;
    }

    .dropdown-toggle {
        padding: 2px 16px;
        font-size: 15px;
    }

    .dropdown-item {
        font-size: 15px;
        padding: 6px 16px;
    }

    .pagination {
        /*font-size: 14px !important;*/
        --bs-pagination-font-size: 14px !important;
    }

    .bottom-table {
        padding: 4px;
    }
    
    #data-table {
        font-size: 14px;
    }
    
    .mapboxgl-ctrl-geocoder--input {
        height: 36px;
        padding: 6px 35px;
    }
    .mapboxgl-ctrl-geocoder {
        font-size: 15px;
        line-height: 18px;
    }

    .mapboxgl-ctrl-geocoder--icon-search {
        top: 8px;
        left: 8px;
        width: 20px;
        height: 20px;
    }
}