body {
    background: #f5f5f5 !important;
	font-size: .8rem !important;
	/* 
	-webkit-touch-callout: none; iOS Safari
    -webkit-user-select: none; Safari
     -khtml-user-select: none; Konqueror HTML
       -moz-user-select: none; Firefox
        -ms-user-select: none; Internet Explorer/Edge
            user-select: none; Non-prefixed version, currently
                                  supported by Chrome and Opera
    */
}

/* Sticky header - Layer 3: Navigation & Layout */
.sticky-header {
    z-index: 1020 !important;
}

/* Bus stop cells - prevent text selection and enable proper touch handling */
.bus-stop-dblclick {
    -webkit-touch-callout: none; /* iOS Safari - disable callout */
    -webkit-user-select: none; /* Safari - disable text selection */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version */
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on iOS */
    touch-action: manipulation; /* Disable double-tap zoom, enable single-finger panning */
    cursor: pointer; /* Show pointer cursor to indicate interactivity */
}

/* Remove color change on press/hold - disabled */
/* .bus-stop-dblclick:active {
    background-color: rgba(0, 0, 0, 0.1);
} */

.eta-time {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(-45deg);
  transform-origin: center;
  font-size: 0.9em;
  font-weight: bold;
  color: #000;
  white-space: nowrap;
  text-align: center;
  line-height: 1.0em;
  z-index: 5000;
  background: #fff;
  padding: 1px;
  border-radius: 3px;
  -moz-border-radius: 3px;
  -webkit-border-radius: 3px;
}

.top-row .eta-time {
  top: -30px;    /* above the stop */
}

.bottom-row .eta-time {
  bottom: -30px; /* below the stop */
}

.tagDropdown {
	list-style: none;
	width: 20px;
	height: 15px;
	text-align: center;
/*	border: 1px solid red;*/
	float: right;
}

.mt-7 {
	margin-top: 70px;
}

.tag-row {
  display: flex;
}

#routes-content {
  text-align: center;
}

#routes-content .tag-row {
  display: inline-flex;     /* makes the row shrink to content */
  gap: 10px;
  margin-bottom: 10px;
}

/* THESE ARROWS ARE STRICTLY FOR THE KEY AT ON THE INPUT CARD */
.arrow_key {
  position: relative;
  display: inline-block;
  background: #fff;
  color: black;
  border: 1px solid black;
  border-right: none !important;   /* 🚨 remove the right border */
  font-size: 11px;
  font-family: Arial, sans-serif;
  line-height: 1.2;
  vertical-align: top;
  padding: 0;
  margin: 6px 4px;
}

.arrow_key table {
  border-collapse: collapse;
}

.arrow_key td {
  padding: 2px 4px;
  white-space: nowrap;
  font-size: 11px;
}

.arrow_key .arrowhead {
  position: absolute;
  top: -1px;                    /* cover top border */
  right: -12px;                 /* arrowhead width */
  width: 13px;                  /* give a hair more width */
  height: calc(100% + 2px);     /* cover top+bottom borders */
  pointer-events: none;         /* don’t block clicks */
}
/* ^^ THESE ARROWS ARE STRICTLY FOR THE KEY AT ON THE INPUT CARD ^^ */

.upcoming_eta_icon {
	background: black;
	color: white;
	padding: 1px;
}

.refresh-icon,
.hide-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;       /* nice square */
    height: 32px;
    border: none;      /* remove the unwanted borders */
    background: transparent;
    cursor: pointer;
    color: inherit;
	text-decoration: none !important;
}


.refresh-icon i {
  position: relative;
  top: 1px; /* adjust up/down until visually centered */
}

/* Default (light mode) */
.hide-card-icon {
  color: var(--text-primary);
  background: transparent;
  border: none;
}

/* Dark mode */
[data-theme="dark"] .hide-card-icon {
  color: var(--text-primary) !important;  /* ensures it follows your light text color */
  background: transparent !important;
  border: none !important;
}

.refresh-icon:hover {
  text-decoration: none !important;
}

.theme-toggle i.fa-sun {
  color: #f1c40f; /* bright yellow */
}

.theme-toggle i.fa-moon {
  color: #bdc3c7; /* silvery gray */
}

#cookie-bar {
    position: fixed;
    top: 0;
    display: block;
    background: #343A40;
    padding: 10px;
    width: 100%;
    z-index: 99999;
    line-height: 20px;
    color: #f5f5f5;
    height: 40px;
    box-sizing: border-box;
}

.sticky-header {
    transition: top 0.3s ease;
}

/* When cookie bar is present, position sticky header right below it */
body.cookie-bar-present .sticky-header {
    top: 40px !important;
}

/* Reduce main container margin when cookie bar is present */
body.cookie-bar-present .mt-7 {
    margin-top: 40px !important; /* Reduced from 70px to account for cookie bar */
}

.agree-btn {
	height: 20px;
	position: absolute;
	right: 0;
	margin-right: 15px;
	font-size: .8rem !important;
	line-height: 10px !important;
}

.credits-col {
	border-left: 1px solid #c4c4c4;
}

.hide-card {
	cursor:pointer;
}

.disclaimer {
	background: #FFC8BC !important;
	padding: 5px !important;
}
.credits {
    margin-top: 5px;
}

.routeBox {
    width: 70px;
}

.routeDiagramBtn {
    text-align: center;
}

/* Style page content */
.main {
    margin-left: 250px; /* Same as the width of the sidebar */
    padding: 0px 10px;
}

/* The sidebar menu */
.sidenav {
    height: 100%; /* Full-height: remove this if you want "auto" height */
    width: 250px; /* Set the width of the sidebar */
    position: fixed; /* Fixed Sidebar (stay in place on scroll) */
    z-index: 1; /* Stay on top */
    top: 0; /* Stay at the top */
    left: 0;
    background-color: #111; /* Black */
    overflow-x: hidden; /* Disable horizontal scroll */
    padding-top: 20px;
}

/* The navigation menu links */
.sidenav a {
    padding: 6px 8px 6px 16px;
    text-decoration: none;
    font-size: 11px;
    color: #818181;
    display: block;
}

/* When you mouse over the navigation links, change their color */
.sidenav a:hover {
    color: #f1f1f1;
}

.error_msg{
	border: 1px solid red;
	position: relative;
	margin: 0 auto;
	width: 40%;
	margin-bottom: 20px;
	padding: 10px;
	background: #ffc6c6;
}

#busCard {
	cursor: pointer;
	width: 55px;
}

.busCard-extend-small {
	width: 61px !important;
}

.busCard-extend-big {
	width: 76px !important;
}

.busCard-extend-xbig {
	width: 75px !important;
}

.front{
	z-index: 100;
	opacity: 1 !important;
}

.dot {
  height: 7px;
  width: 7px;
  background-color: blue;
  border-radius: 50%;
	border: 1px solid black;
  display: inline-block;
	vertical-align: top;
}

.lineConnector_down{
	border-left: 1px solid black;
	height: 30px;
	z-index: -10;
	float: left;
	margin-left: 50%;
	margin-top: -19px;
	margin-bottom: -10px;
}

.lineConnector_up{
	border-left: 1px solid black;
	height: 25px;
	z-index: -10;
	float: right;
	margin-top: -10px;
	margin-bottom: -10px;
	margin-right: 50%;
}

.dot_busStop {
	height: 7px;
	width: 7px;
	background-color: white;
	border-radius: 50%;
	border: 1px solid black;
	display: inline-block;
	vertical-align: top;
}

td{
	overflow: visible !important;
}

.curtailed {
	background-color: #ffa09b;
}

.routeDiagram {
	overflow: auto;
	overflow-y: hidden;
	white-space: nowrap;


    background: white;
}

.routeDiagram_header {
	border-style: solid;
	border-width: 1px 1px 0px 1px;
	border-color: black;
	background: #f7f7f7;
	width: 95%;
	margin: 0 auto;
	position: relative;
	padding: 10px;
	height: 20px;
}

.routeSettings {
    background: white;
	border: 1px solid black;
	position: relative;
	margin: 0 auto;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.maintenance-box {
	background: #00AAAA;
	border: 1px solid #0d1c29;
	position: relative;
	margin: 0 auto;
	width: 500px;
	padding: 5px;
	margin-bottom: 10px;
}

.refresh_button {
	text-decoration: none;
	color: green;
	font-size: 30px;
	font-weight: bold;
}

.route_table {
	table-layout: fixed;
	max-width: 1920px;
	margin: 0 auto;
	position: relative;
	border: 0;
	border-spacing: 2px;
	border-collapse: separate;
}

.va-b {
	vertical-align: bottom;
	padding-bottom: 7px;
}

.va-t {
	vertical-align: top;
	padding-top: 7px;
}

.ta-l {
	text-align: left;
}

.ta-c {
	text-align: center;
}

.vehicle-monitor {
	background-color: #75d13f !important;
}

.vehicle-curtailed {
	background-color: #ffa09b !important;
}

.vehicle-layover {
	background-color: #cccccc !important;
}

.bus_stop_cell {
	height: 80px;
	background: #ffff99;
	border: 1px solid black !important;
	font-size: 0.55vw;
	text-align: center;
}

.bus-stop-dblclick {
	cursor: pointer;
}

.bus_stop_monitor {
	background: #a8ffbf;
}

.stopMonitorInput {
	width: 80%;
	margin-left: 10px;
	height: 25px;
}

.bottom-row-table {
	text-align: center;
	font-size: 10px;
	padding: 2px;
}

.c-bt {
	border-top: 1px solid rgba(255, 0, 0, 0);
}

.red {
	color: red;
	font-weight: bold;
}

.auth_td {
	text-align: center;
}

.auth_logged_out {
	background: #ffeebf;
}

.auth_logged_in {
	background: #c7ffab;
}

/* PIN input styling */
input[type="password"] {
    font-size: 1.5rem;
    letter-spacing: 5px;
}

/* Toast notification styling */
.toast-error .toast-header {
    background-color: #f8d7da;
    border-bottom: 1px solid #f5c6cb;
}

.toast-error .toast-header .text-danger {
    color: #721c24 !important;
}

.toast-success .toast-header {
    background-color: #d4edda;
    border-bottom: 1px solid #c3e6cb;
}

.toast-success .toast-header .text-success {
    color: #155724 !important;
}

.toast {
    min-width: 300px;
    max-width: 400px;
    margin-bottom: 0.5rem;
    transition: all 0.4s ease;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.1);
}

/* Toast container for proper stacking - adjust for sticky header - Layer 5: Floating Elements */
#toast-container {
    position: fixed !important;
    top: 70px !important; /* Account for sticky header height (~50px) + padding */
    right: 20px !important;
    z-index: 1090 !important;
}

/* When cookie bar is present, adjust toast position further down */
body.cookie-bar-present #toast-container {
    top: 110px !important; /* Sticky header + cookie bar height + padding */
}

/* Toast animations */
.toast.toast-slide-in {
    animation: slideInFromRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.toast.toast-slide-out {
    animation: slideOutToRight 0.3s cubic-bezier(0.55, 0.06, 0.68, 0.19) forwards;
}

@keyframes slideInFromRight {
    0% {
        transform: translateX(100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToRight {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Auto-refresh progress bar styles */
.progress-bar-container {
    width: 100%;
    height: 1px;
    background-color: transparent;
    margin-top: 3px;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #007bff; /* Bootstrap blue */
    width: 0%;
    position: absolute;
    top: 0;
    left: 0; /* Start from left side */
    transition: width 0.2s ease-out; /* Smooth animation for width changes - matches update frequency */
}

/* Whoosh effect animation for auto-refresh setting changes */
@keyframes progressWhoosh {
    0% {
        width: var(--whoosh-start, 0%);
    }
    40% {
        width: calc(var(--whoosh-start, 0%) + (100% - var(--whoosh-start, 0%)) * 0.8);
    }
    80% {
        width: calc(var(--whoosh-start, 0%) + (100% - var(--whoosh-start, 0%)) * 0.95);
    }
    100% {
        width: 100%;
    }
}

.progress-bar-fill.whoosh-effect {
    animation: progressWhoosh 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: none; /* Disable normal transition during animation */
}

/* Blinking animation for countdown urgency */
@keyframes blink {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        opacity: 1;
    }
}

.countdown-blink {
    animation: blink 0.8s infinite;
}

/* Smooth Modal Fade Transitions - Works with Dynamic Content */
.modal {
    transition: opacity 0.15s linear !important;
}

.modal.fade {
    opacity: 0;
}

.modal.show {
    opacity: 1 !important;
}

.modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out !important;
}

.modal.fade .modal-dialog {
    transform: scale(0.7) translateY(-50px) !important;
    opacity: 0 !important;
}

.modal.show .modal-dialog {
    transform: scale(1) translateY(0) !important;
    opacity: 1 !important;
}

/* Smooth backdrop transitions */
.modal-backdrop {
    transition: opacity 0.3s ease-out !important;
}

.modal-backdrop.fade {
    opacity: 0 !important;
}

.modal-backdrop.show {
    opacity: 0.5 !important;
}

/* Content fade-in for dynamic loading */
.modal-body {
    transition: opacity 0.2s ease-out;
}

.modal-content-loading .modal-body {
    opacity: 0.7;
}

.modal-content-loaded .modal-body {
    opacity: 1;
}



.arrow {
  position: relative;
  display: inline-block;   /* keeps natural width */
  background: #fff;
  color: black;
  border: 1px solid black;
  font-size: 11px;
  font-family: Arial, sans-serif;
  padding: 0px;
  margin: 6px 0;
  line-height: 1.2;
  vertical-align: top;
  cursor: pointer;
  z-index: 1;
  white-space: normal;
}

td .arrow {
  display: table;          /* inline-block width, but forces stacking */
  margin: 4px auto;        /* keeps compact width, centers inside cell */
}

.arrow table {
  width: auto;             /* auto size instead of fixed */
  table-layout: auto;      /* grow/shrink based on content */
  border-collapse: collapse;
}

.arrow td {
  padding: 0 2px;
  font-size: 11px;
  white-space: nowrap;     /* don’t break inside cells */
}


.arrow.active {
  z-index: 10000; /* bring clicked arrow + dropdown above others */
}

.arrow.right {
  text-align: left;
  border-right: none;
  transform: translateX(-40%); /* relative to element’s own width */
  position: relative;
}

.arrow.left  { 
  text-align: right; 
  border-left: none;
}

/* dropdown toggle inside arrows */
.arrow .dropdown-toggle {
  position: absolute;
  top: 2px;
  font-size: 10px;
  padding: 0 4px;
  line-height: 1;
  cursor: pointer;
  color: black;
}

/* top-right for right arrows */
.arrow.right .dropdown-toggle { right: 2px; }
/* top-left for left arrows */
.arrow.left .dropdown-toggle { left: 2px; }

/* ensure dropdowns always appear above arrows */
.arrow .dropdown-menu {
  z-index: 99999 !important;
}

/* canvas arrowhead */
.arrowhead {
  position: absolute;
  top: 0;
  width: 20px;   /* default width, will be resized by JS */
  height: 100%;  /* match parent */
}
.arrow.right .arrowhead { right: -20px; }
.arrow.left .arrowhead  { left: -20px; transform: scaleX(-1); }

/* Fix stacking context */
.arrow,
.arrow .dropdown-menu {
  z-index: 1; /* normal arrows */
}

.arrow.active {
  z-index: 100; /* active arrow above others */
}

/* Ensure modal layers above arrows */
.modal-backdrop {
  z-index: 2000 !important; /* below modal but above arrows */
}

.modal {
  z-index: 2010 !important; /* above backdrop */
}
/* hide toggle unless ontop */
.arrow .dropdown-toggle {
  display: none !important;
}
.arrow.active .dropdown-toggle {
  display: inline-block !important;
}

/* hide toggle unless ontop */
.arrow .dropdown-toggle {
  display: none !important;
}
.arrow.active .dropdown-toggle {
  display: inline-block !important;
}

/* let Bootstrap handle the dropdown menu normally */
.arrow .dropdown-menu {
  display: none; /* hidden by Bootstrap until toggle click */
}
.arrow .dropdown-menu.show {
  display: block; /* Bootstrap adds .show on toggle */
}

/* Crosshatched background for cached vehicle data */
.arrow.cached,
.arrow_key.cached {
  background-image: 
    linear-gradient(45deg, transparent 40%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.1) 60%, transparent 60%),
    linear-gradient(-45deg, transparent 40%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.1) 60%, transparent 60%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}
/* Remove all bottom space after last bus in ETA modal */
.bus-stop-eta-area table {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}
.bus-stop-eta-area table tr:last-child td {
    border-bottom: none !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
.modal-body {
    padding-bottom: 0 !important;
}
.bus-stop-dropdown {
    display: none;
    position: absolute;
    background-color: white;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .25rem;
    padding: 0.5rem 0;
    text-align: left;
}

.bus-stop-dropdown.show {
    display: block;
}

.bus-stop-dropdown .dropdown-item {
    display: block;
    width: 100%;
    padding: .25rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    font-size: 0.9rem;
}

.bus-stop-dropdown .dropdown-item:hover,
.bus-stop-dropdown .dropdown-item:focus {
    color: #1e2125;
    background-color: #e9ecef;
    cursor: pointer;
}

.bus-stop-dropdown .dropdown-divider {
    height: 0;
    margin: .5rem 0;
    overflow: hidden;
    border-top: 1px solid rgba(0,0,0,.15);
}

.bus-stop-dropdown .dropdown-header {
    display: block;
    padding: .5rem 1rem;
    margin-bottom: 0;
    font-size: .875rem;
    color: #6c757d;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    cursor: default;
}

.bus_stop_cell {
    position: relative;
    cursor: pointer;
}

.bus_stop_cell .stop-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    color: black;
    text-decoration: none;
}

/* Bus Stop Schedule Modal Styles */
#busStopScheduleModal .accordion .card-header .btn {
    color: #495057;
    border: none;
    background: transparent;
    box-shadow: none;
}

#busStopScheduleModal .accordion .card-header .btn:hover,
#busStopScheduleModal .accordion .card-header .btn:focus {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
    box-shadow: none;
}

#busStopScheduleModal .accordion .card-header .btn:not(.collapsed) {
    background-color: #e9ecef;
    color: #495057;
}

#busStopScheduleModal .accordion-arrow {
    transition: transform 0.2s ease-in-out;
    font-size: 0.8rem;
}

#busStopScheduleModal .accordion-arrow.rotate-up {
    transform: rotate(180deg);
}

#busStopScheduleModal .card {
    border: 1px solid #dee2e6;
}

#busStopScheduleModal .schedule-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 0;
}

#busStopScheduleModal .schedule-times .badge {
    font-family: monospace;
    flex-shrink: 0;
    margin: 0;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
}

#busStopScheduleModal .card-body {
    padding: 1rem;
}

#busStopScheduleModal .accordion .card {
    margin-bottom: 0.5rem;
}

#busStopScheduleModal .accordion .card:last-child {
    margin-bottom: 0;
}
button[data-balloon] {
  overflow: visible; }

[data-balloon] {
  position: relative;
  cursor: pointer; }
  [data-balloon]:after {
    filter: alpha(opacity=0);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    -moz-opacity: 0;
    -khtml-opacity: 0;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: all 0.18s ease-out 0.18s;
    -moz-transition: all 0.18s ease-out 0.18s;
    -ms-transition: all 0.18s ease-out 0.18s;
    -o-transition: all 0.18s ease-out 0.18s;
    transition: all 0.18s ease-out 0.18s;
    font-family: sans-serif !important;
    font-weight: normal !important;
    font-style: normal !important;
    text-shadow: none !important;
    font-size: 12px !important;
    background: rgba(17, 17, 17, 0.9);
    border-radius: 4px;
    color: #fff;
    content: attr(data-balloon);
    padding: .5em 1em;
    position: absolute;
    white-space: nowrap;
    z-index: 10; }
  [data-balloon]:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%280%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 18px;
    height: 6px;
    filter: alpha(opacity=0);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    -moz-opacity: 0;
    -khtml-opacity: 0;
    opacity: 0;
    pointer-events: none;
    -webkit-transition: all 0.18s ease-out 0.18s;
    -moz-transition: all 0.18s ease-out 0.18s;
    -ms-transition: all 0.18s ease-out 0.18s;
    -o-transition: all 0.18s ease-out 0.18s;
    transition: all 0.18s ease-out 0.18s;
    content: '';
    position: absolute;
    z-index: 10; }
  [data-balloon]:hover:before, [data-balloon]:hover:after, [data-balloon][data-balloon-visible]:before, [data-balloon][data-balloon-visible]:after {
    filter: alpha(opacity=100);
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
    -moz-opacity: 1;
    -khtml-opacity: 1;
    opacity: 1;
    pointer-events: auto; }
  [data-balloon].font-awesome:after {
    font-family: FontAwesome; }
  [data-balloon][data-balloon-break]:after {
    white-space: pre; }
  [data-balloon][data-balloon-blunt]:before, [data-balloon][data-balloon-blunt]:after {
    -webkit-transition: none;
    -moz-transition: none;
    -ms-transition: none;
    -o-transition: none;
    transition: none; }
  [data-balloon][data-balloon-pos="up"]:after {
    bottom: 100%;
    left: 50%;
    margin-bottom: 11px;
    -webkit-transform: translate(-50%, 10px);
    -moz-transform: translate(-50%, 10px);
    -ms-transform: translate(-50%, 10px);
    transform: translate(-50%, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up"]:before {
    bottom: 100%;
    left: 50%;
    margin-bottom: 5px;
    -webkit-transform: translate(-50%, 10px);
    -moz-transform: translate(-50%, 10px);
    -ms-transform: translate(-50%, 10px);
    transform: translate(-50%, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up"]:hover:after, [data-balloon][data-balloon-pos="up"][data-balloon-visible]:after {
    -webkit-transform: translate(-50%, 0);
    -moz-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0); }
  [data-balloon][data-balloon-pos="up"]:hover:before, [data-balloon][data-balloon-pos="up"][data-balloon-visible]:before {
    -webkit-transform: translate(-50%, 0);
    -moz-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0); }
  [data-balloon][data-balloon-pos="up-left"]:after {
    bottom: 100%;
    left: 0;
    margin-bottom: 11px;
    -webkit-transform: translate(0, 10px);
    -moz-transform: translate(0, 10px);
    -ms-transform: translate(0, 10px);
    transform: translate(0, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up-left"]:before {
    bottom: 100%;
    left: 5px;
    margin-bottom: 5px;
    -webkit-transform: translate(0, 10px);
    -moz-transform: translate(0, 10px);
    -ms-transform: translate(0, 10px);
    transform: translate(0, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up-left"]:hover:after, [data-balloon][data-balloon-pos="up-left"][data-balloon-visible]:after {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos="up-left"]:hover:before, [data-balloon][data-balloon-pos="up-left"][data-balloon-visible]:before {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos="up-right"]:after {
    bottom: 100%;
    right: 0;
    margin-bottom: 11px;
    -webkit-transform: translate(0, 10px);
    -moz-transform: translate(0, 10px);
    -ms-transform: translate(0, 10px);
    transform: translate(0, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up-right"]:before {
    bottom: 100%;
    right: 5px;
    margin-bottom: 5px;
    -webkit-transform: translate(0, 10px);
    -moz-transform: translate(0, 10px);
    -ms-transform: translate(0, 10px);
    transform: translate(0, 10px);
    -webkit-transform-origin: top;
    -moz-transform-origin: top;
    -ms-transform-origin: top;
    transform-origin: top; }
  [data-balloon][data-balloon-pos="up-right"]:hover:after, [data-balloon][data-balloon-pos="up-right"][data-balloon-visible]:after {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos="up-right"]:hover:before, [data-balloon][data-balloon-pos="up-right"][data-balloon-visible]:before {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos='down']:after {
    left: 50%;
    margin-top: 11px;
    top: 100%;
    -webkit-transform: translate(-50%, -10px);
    -moz-transform: translate(-50%, -10px);
    -ms-transform: translate(-50%, -10px);
    transform: translate(-50%, -10px); }
  [data-balloon][data-balloon-pos='down']:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%28180 18 6%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 18px;
    height: 6px;
    left: 50%;
    margin-top: 5px;
    top: 100%;
    -webkit-transform: translate(-50%, -10px);
    -moz-transform: translate(-50%, -10px);
    -ms-transform: translate(-50%, -10px);
    transform: translate(-50%, -10px); }
  [data-balloon][data-balloon-pos='down']:hover:after, [data-balloon][data-balloon-pos='down'][data-balloon-visible]:after {
    -webkit-transform: translate(-50%, 0);
    -moz-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0); }
  [data-balloon][data-balloon-pos='down']:hover:before, [data-balloon][data-balloon-pos='down'][data-balloon-visible]:before {
    -webkit-transform: translate(-50%, 0);
    -moz-transform: translate(-50%, 0);
    -ms-transform: translate(-50%, 0);
    transform: translate(-50%, 0); }
  [data-balloon][data-balloon-pos='down-left']:after {
    left: 0;
    margin-top: 11px;
    top: 100%;
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    transform: translate(0, -10px); }
  [data-balloon][data-balloon-pos='down-left']:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%28180 18 6%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 18px;
    height: 6px;
    left: 5px;
    margin-top: 5px;
    top: 100%;
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    transform: translate(0, -10px); }
  [data-balloon][data-balloon-pos='down-left']:hover:after, [data-balloon][data-balloon-pos='down-left'][data-balloon-visible]:after {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos='down-left']:hover:before, [data-balloon][data-balloon-pos='down-left'][data-balloon-visible]:before {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos='down-right']:after {
    right: 0;
    margin-top: 11px;
    top: 100%;
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    transform: translate(0, -10px); }
  [data-balloon][data-balloon-pos='down-right']:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2236px%22%20height%3D%2212px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%28180 18 6%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 18px;
    height: 6px;
    right: 5px;
    margin-top: 5px;
    top: 100%;
    -webkit-transform: translate(0, -10px);
    -moz-transform: translate(0, -10px);
    -ms-transform: translate(0, -10px);
    transform: translate(0, -10px); }
  [data-balloon][data-balloon-pos='down-right']:hover:after, [data-balloon][data-balloon-pos='down-right'][data-balloon-visible]:after {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos='down-right']:hover:before, [data-balloon][data-balloon-pos='down-right'][data-balloon-visible]:before {
    -webkit-transform: translate(0, 0);
    -moz-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
    transform: translate(0, 0); }
  [data-balloon][data-balloon-pos='left']:after {
    margin-right: 11px;
    right: 100%;
    top: 50%;
    -webkit-transform: translate(10px, -50%);
    -moz-transform: translate(10px, -50%);
    -ms-transform: translate(10px, -50%);
    transform: translate(10px, -50%); }
  [data-balloon][data-balloon-pos='left']:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%28-90 18 18%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 6px;
    height: 18px;
    margin-right: 5px;
    right: 100%;
    top: 50%;
    -webkit-transform: translate(10px, -50%);
    -moz-transform: translate(10px, -50%);
    -ms-transform: translate(10px, -50%);
    transform: translate(10px, -50%); }
  [data-balloon][data-balloon-pos='left']:hover:after, [data-balloon][data-balloon-pos='left'][data-balloon-visible]:after {
    -webkit-transform: translate(0, -50%);
    -moz-transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
    transform: translate(0, -50%); }
  [data-balloon][data-balloon-pos='left']:hover:before, [data-balloon][data-balloon-pos='left'][data-balloon-visible]:before {
    -webkit-transform: translate(0, -50%);
    -moz-transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
    transform: translate(0, -50%); }
  [data-balloon][data-balloon-pos='right']:after {
    left: 100%;
    margin-left: 11px;
    top: 50%;
    -webkit-transform: translate(-10px, -50%);
    -moz-transform: translate(-10px, -50%);
    -ms-transform: translate(-10px, -50%);
    transform: translate(-10px, -50%); }
  [data-balloon][data-balloon-pos='right']:before {
    background: no-repeat url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http://www.w3.org/2000/svg%22%20width%3D%2212px%22%20height%3D%2236px%22%3E%3Cpath%20fill%3D%22rgba%2817, 17, 17, 0.9%29%22%20transform%3D%22rotate%2890 6 6%29%22%20d%3D%22M2.658,0.000%20C-13.615,0.000%2050.938,0.000%2034.662,0.000%20C28.662,0.000%2023.035,12.002%2018.660,12.002%20C14.285,12.002%208.594,0.000%202.658,0.000%20Z%22/%3E%3C/svg%3E");
    background-size: 100% auto;
    width: 6px;
    height: 18px;
    left: 100%;
    margin-left: 5px;
    top: 50%;
    -webkit-transform: translate(-10px, -50%);
    -moz-transform: translate(-10px, -50%);
    -ms-transform: translate(-10px, -50%);
    transform: translate(-10px, -50%); }
  [data-balloon][data-balloon-pos='right']:hover:after, [data-balloon][data-balloon-pos='right'][data-balloon-visible]:after {
    -webkit-transform: translate(0, -50%);
    -moz-transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
    transform: translate(0, -50%); }
  [data-balloon][data-balloon-pos='right']:hover:before, [data-balloon][data-balloon-pos='right'][data-balloon-visible]:before {
    -webkit-transform: translate(0, -50%);
    -moz-transform: translate(0, -50%);
    -ms-transform: translate(0, -50%);
    transform: translate(0, -50%); }
  [data-balloon][data-balloon-length='small']:after {
    white-space: normal;
    width: 80px; }
  [data-balloon][data-balloon-length='medium']:after {
    white-space: normal;
    width: 150px; }
  [data-balloon][data-balloon-length='large']:after {
    white-space: normal;
    width: 260px; }
  [data-balloon][data-balloon-length='xlarge']:after {
    white-space: normal;
    width: 380px; }
    @media screen and (max-width: 768px) {
      [data-balloon][data-balloon-length='xlarge']:after {
        white-space: normal;
        width: 90vw; } }
  [data-balloon][data-balloon-length='fit']:after {
    white-space: normal;
    width: 100%; }

/* Compact tooltip with better readability */
[data-balloon-compact]:after {
  font-size: 11px !important;
  line-height: 1.3;
}

.tooltip-text small {
  font-size: 11px;  /* only your instruction text shrinks */
  opacity: 0.8;
}
@-webkit-keyframes monitor_blink {
0%, 49% {
    background-color: rgb(117,209,63);
}
50%, 100% {
    background-color: #fff;
}
}

.arrow_box {
    background-color: #fff;
    border: 1px solid #080202;
    text-align: left;
    padding: 3px;
    font-size: 10px;
    margin-bottom: 10px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

.arrow_box:after, .arrow_box:before {
    left: 100%;
    top: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.arrow_box:after {
    border-color: rgba(255, 255, 255, 0);
    border-left-color: #000;
    border-width: 5px;
    margin-top: -5px;
}
.arrow_box:before {
    border-color: rgba(0, 0, 0, 0);
    border-left-color: #000000;
    border-width: 9px;
    margin-top: -9px;
}

.arrow_box_return {
    background-color: #fff;
    border: 1px solid #080202;
    text-align: left;
    padding: 3px;
    font-size: 10px;
    margin-top: 10px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

.arrow_box_return:after, .arrow_box_return:before {
    right: 100%;
    top: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.arrow_box_return:after {
    border-color: rgba(255, 255, 255, 0);
    border-right-color: #000;
    border-width: 5px;
    margin-top: -5px;
}
.arrow_box_return:before {
    border-color: rgba(0, 0, 0, 0);
    border-right-color: #000000;
    border-width: 9px;
    margin-top: -10px;
}

/* Data Recorder Modal Enhancements */
#dataRecorderModal .modal-xl {
    max-width: 1200px;
}

#dataRecorderModal .nav-pills .nav-link {
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
}

#dataRecorderModal .nav-pills .nav-link:hover {
    background-color: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

#dataRecorderModal .nav-pills .nav-link.active {
    background-color: #007bff;
    color: white;
}

#dataRecorderModal .nav-pills .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

#dataRecorderModal .list-group-item {
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.2s ease;
}

#dataRecorderModal .list-group-item:hover {
    background-color: #f8f9fa;
}

#dataRecorderModal .list-group-item:last-child {
    border-bottom: none;
}

#dataRecorderModal .progress {
    background-color: #e9ecef;
}

#dataRecorderModal .btn-group-vertical .btn {
    margin-bottom: 0.25rem;
}

#dataRecorderModal .btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #dataRecorderModal .modal-xl {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    #dataRecorderModal .row.no-gutters {
        flex-direction: column;
    }
    
    #dataRecorderModal .col-md-3,
    #dataRecorderModal .col-md-9 {
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    #dataRecorderModal .nav-pills {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
        padding: 1rem 1rem 0.5rem 1rem;
    }
    
    #dataRecorderModal .nav-pills .nav-link {
        margin-right: 0.5rem;
        margin-bottom: 0;
        white-space: nowrap;
    }
}

/* Status-specific styling */
.badge-danger {
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.progress-bar.bg-danger {
    background: linear-gradient(45deg, #dc3545, #c82333) !important;
}

/* Empty state styling */
.opacity-50 {
    opacity: 0.5;
}

/* Delete button styling */
.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
    transform: scale(1.05);
    transition: all 0.2s ease-in-out;
}

.btn-outline-danger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading animation for buttons */
.btn .fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade out animation for deleted items */
.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(-20px); }
}

/* Playback Timeline Styles */
.playback-controls {
    border: 2px solid #007bff !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.playback-controls .card-header {
    background: #007bff;
    color: white;
    border-bottom: 1px solid #0056b3;
}

#timeline-slider {
    background: #007bff;
    height: 8px;
    border-radius: 4px;
    outline: none;
}

#timeline-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#timeline-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.playback-controls .btn {
    transition: all 0.2s ease;
}

.playback-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#playback-tab-nav {
    animation: slideInFromLeft 0.3s ease;
}

@keyframes slideInFromLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Playback mode indicators */
.badge-playback {
    background: linear-gradient(45deg, #28a745, #20c997);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}
.btn-group-xs > .btn, .btn-xs {
  padding: .5rem .4rem;
  font-size: .75rem;
  line-height: .5;
  border-radius: .2rem;
}

/* Apply smaller font size to inputs and selects, but exclude user system */
body:not(.user-system) input, 
body:not(.user-system) select {
  font-size: .75rem !important;
}

.table_spacing {
  border-collapse: separate;
  border-spacing: 2px ;
}

.modalLg {
  padding: 0 !important; /* override inline padding-right added from js */
}
.modalLg .modalLg-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
}
.modalLg .modalLg-content {
  height: 100%;
  border: 0;
  border-radius: 0;
}
.modalLg .modalLg-body {
  overflow-y: auto;
}

/* Remove unwanted gap between tabs and card body */
.card-header-tabs {
    margin-bottom: -20px !important;
}

.tab-content {
    margin-top: 0 !important;
}

/**
 * Dark Mode CSS Variables and Styles
 * Comprehensive dark mode implementation for Headway Monitor
 */

/* CSS Custom Properties for Light Mode (Default) */
:root {
    /* Background Colors */
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f7f7f7;
    --bg-quaternary: #e9ecef;
    
    /* Text Colors */
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #6c757d;
    --text-inverse: #ffffff;
    
    /* Border Colors */
    --border-primary: #c4c4c4;
    --border-secondary: #dee2e6;
    --border-dark: #000000;
    
    /* Component Specific Colors */
    --sidebar-bg: #111111;
    --sidebar-text: #818181;
    --sidebar-text-hover: #f1f1f1;
    
    /* Bus Stop Colors */
    --bus-stop-bg: #ffff99;
    --bus-stop-monitor: #a8ffbf;
    
    /* Vehicle Status Colors - Keep original colors */
    --vehicle-monitor: #75d13f;
    --vehicle-curtailed: #ffa09b;
    --vehicle-layover: #cccccc;
    
    /* Auth Colors */
    --auth-logged-out: #ffeebf;
    --auth-logged-in: #c7ffab;
    
    /* Toast Colors */
    --toast-success-bg: #d4edda;
    --toast-success-border: #c3e6cb;
    --toast-success-text: #155724;
    --toast-error-bg: #f8d7da;
    --toast-error-border: #f5c6cb;
    --toast-error-text: #721c24;
    
    /* Shadow Colors */
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.25);
}

/* Dark Mode CSS Variables */
[data-theme="dark"] {
    /* Background Colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3d3d3d;
    --bg-quaternary: #4d4d4d;
    
    /* Text Colors */
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --text-inverse: #1a1a1a;
    
    /* Border Colors */
    --border-primary: #555555;
    --border-secondary: #444444;
    --border-dark: #666666;
    
    /* Component Specific Colors */
    --sidebar-bg: #0d1117;
    --sidebar-text: #7d8590;
    --sidebar-text-hover: #f0f6fc;
    
    /* Bus Stop Colors */
    --bus-stop-bg: #4a4a00;
    --bus-stop-monitor: #1a4d20;
    
    /* Vehicle Status Colors - Keep original colors for bus tags */
    --vehicle-monitor: #75d13f;      /* Original green */
    --vehicle-curtailed: #ffa09b;    /* Original red/pink */
    --vehicle-layover: #cccccc;      /* Original gray */
    
    /* Auth Colors */
    --auth-logged-out: #5d4a1f;
    --auth-logged-in: #2d4a1c;
    
    /* Toast Colors */
    --toast-success-bg: #1e3a20;
    --toast-success-border: #2d5016;
    --toast-success-text: #7fb069;
    --toast-error-bg: #3a1e1e;
    --toast-error-border: #5d2a28;
    --toast-error-text: #ff6b6b;
    
    /* Shadow Colors */
    --shadow-light: rgba(255, 255, 255, 0.05);
    --shadow-medium: rgba(255, 255, 255, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
}

/* Apply CSS Variables to Existing Elements */
body {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Route Diagram */
.routeDiagram {
    background: var(--bg-secondary);
}

.routeDiagram_header {
    background: var(--bg-tertiary);
    border-color: var(--border-dark);
}

.routeSettings {
    background: var(--bg-secondary);
    border-color: var(--border-dark);
}

/* Tables and Cards */
.bus_stop_cell {
    background: var(--bus-stop-bg);
    border: 1px solid black !important;
}

.bus_stop_monitor {
    background: var(--bus-stop-monitor);
}

/* Remove dark mode touch feedback - disabled */
/* [data-theme="dark"] .bus-stop-dblclick:active {
    background-color: rgba(255, 255, 255, 0.1);
} */

.vehicle-monitor {
    background-color: var(--vehicle-monitor) !important;
}

.vehicle-curtailed {
    background-color: var(--vehicle-curtailed) !important;
}

.vehicle-layover {
    background-color: var(--vehicle-layover) !important;
}

/* 
 * PRESERVE ORIGINAL BUS DIAGRAM COLORS IN DARK MODE 
 * The bus tags and route diagrams should keep their original colors
 * for proper route identification and contrast
 */

/* Preserve Bus Tag Original Colors - Don't override these in dark mode */
[data-theme="dark"] .arrow {
    /* Let bus tags keep their original background colors from PHP/data attributes */
    background: white !important; /* Default white background for bus tags */
    color: black !important; /* Keep black text in bus tags for contrast */
    border-color: black !important; /* Keep black borders */
}

/* Preserve bus tag vehicle status colors - KEEP ORIGINAL COLORS */
[data-theme="dark"] .arrow.vehicle-monitor {
    background-color: #75d13f !important; /* Original green */
    color: black !important;
}

[data-theme="dark"] .arrow.vehicle-curtailed {
    background-color: #ffa09b !important; /* Original red/pink */  
    color: black !important;
}

[data-theme="dark"] .arrow.vehicle-layover {
    background-color: #cccccc !important; /* Original gray */
    color: black !important;
}

/* Preserve arrow text colors regardless of status */
[data-theme="dark"] .arrow,
[data-theme="dark"] .arrow *,
[data-theme="dark"] .arrow table,
[data-theme="dark"] .arrow td,
[data-theme="dark"] .arrow span {
    color: black !important;
}

/* Preserve Bus Stop Diagram Colors with enhanced visibility */
[data-theme="dark"] .bus_stop_cell {
    background: #ffff99 !important; /* Keep original yellow */
    color: black !important; /* Keep black text for contrast */
    border-color: black !important; /* Keep black borders */
}

[data-theme="dark"] .bus_stop_monitor {
    background: #a8ffbf !important; /* Original light green */
    color: black !important;
}

[data-theme="dark"] .arrow_key {
    color: black !important;
}

/* Preserve dots and connectors original colors */
[data-theme="dark"] .dot {
    background-color: blue !important; /* Keep original blue */
    border-color: black !important; /* Keep black border */
}

[data-theme="dark"] .dot_busStop {
    background-color: white !important; /* Keep original white */
    border-color: black !important; /* Keep black border */
}

[data-theme="dark"] .lineConnector_down,
[data-theme="dark"] .lineConnector_up {
    border-left-color: rgb(255, 255, 255) !important; /* Keep original black lines */
}

/* Preserve route diagram background */
[data-theme="dark"] .routeDiagram {
    background: white !important; /* Keep original white background */
}

/* Preserve route diagram header */
[data-theme="dark"] .routeDiagram_header {
    background: #f7f7f7 !important; /* Keep original light gray */
    color: black !important;
    border-color: black !important;
}

/* Preserve any text inside the bus stop cells */
[data-theme="dark"] .bus_stop_cell,
[data-theme="dark"] .bus_stop_cell *,
[data-theme="dark"] .bus_stop_cell a {
    color: black !important;
}

[data-theme="dark"] .bus_stop_cell .dropdown-header {
    color: #fff !important; /* white text only for dropdown-header */
}

/* Dark theme disabled dropdown items */
[data-theme="dark"] .dropdown-item[class*="disable"] {
    color: #6c757d !important;   /* muted grey */
    cursor: not-allowed !important;
    pointer-events: none;         /* prevents clicks */
    opacity: 0.6;                 /* makes it look inactive */
}

/* Prevent hover highlight */
[data-theme="dark"] .dropdown-item[class*="disable"]:hover {
    background-color: transparent !important;
    color: #6c757d !important;
}


/* Make sure ETA times on the diagram remain visible */
[data-theme="dark"] .eta-time {
    color: #333 !important; /* Keep original dark text color for contrast against light backgrounds */
}

/* Preserve bus tag dropdown elements */
[data-theme="dark"] .arrow .dropdown-toggle {
    color: black !important;
    background: transparent !important;
}

/* Preserve any curtailed status styling */
[data-theme="dark"] .curtailed {
    background-color: #ffa09b !important;
    color: black !important;
}

/* Enhanced key/legend status indicators for dark mode */
[data-theme="dark"] .arrow_box {
    border-color: #666 !important; /* Lighter border for better visibility */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important; /* Add depth */
}

/* Override inline styles for key indicators in dark mode */
[data-theme="dark"] .arrow_box[style*="rgb(117,209,63)"],
[data-theme="dark"] .arrow_box[style*="background-color: rgb(117,209,63)"] {
    background-color: #85e355 !important; /* Brighter green for monitoring */
    color: black !important;
    font-weight: 600 !important;
    box-shadow: 0 0 8px rgba(133, 227, 85, 0.4) !important;
}

[data-theme="dark"] .arrow_box[style*="#ffa09b"],
[data-theme="dark"] .arrow_box[style*="background-color: #ffa09b"] {
    background-color: #ffb3ad !important; /* Brighter red/pink for curtailed */
    color: black !important;
    font-weight: 600 !important;
    box-shadow: 0 0 8px rgba(255, 179, 173, 0.4) !important;
}

[data-theme="dark"] .arrow_box[style*="#cccccc"],
[data-theme="dark"] .arrow_box[style*="background-color: #cccccc"] {
    background-color: #e0e0e0 !important; /* Brighter gray for layover */
    color: black !important;
    font-weight: 600 !important;
    box-shadow: 0 0 6px rgba(224, 224, 224, 0.3) !important;
}

/* Authentication Status */
.auth_logged_out {
    background: var(--auth-logged-out);
}

.auth_logged_in {
    background: var(--auth-logged-in);
}

/* Sidebar */
.sidenav {
    background-color: var(--sidebar-bg);
}

.sidenav a {
    color: var(--sidebar-text);
}

.sidenav a:hover {
    color: var(--sidebar-text-hover);
}

/* ETA Time */
.eta-time {
    color: var(--text-primary);
}

/* Dots and Connectors */
.dot {
    border-color: var(--border-dark);
}

.dot_busStop {
    background-color: var(--bg-secondary);
    border-color: var(--border-dark);
}

.lineConnector_down,
.lineConnector_up {
    border-left-color: var(--border-dark);
}

/* Toasts */
.toast-success .toast-header {
    background-color: var(--toast-success-bg);
    border-bottom-color: var(--toast-success-border);
    color: var(--text-primary);
}

.toast-success .toast-header .text-success {
    color: var(--toast-success-text) !important;
}

.toast-error .toast-header {
    background-color: var(--toast-error-bg);
    border-bottom-color: var(--toast-error-border);
    color: var(--text-primary);
}

.toast-error .toast-header .text-danger {
    color: var(--toast-error-text) !important;
}

[data-theme="dark"] .toast {
    box-shadow: 0 0.25rem 0.75rem var(--shadow-dark);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.toast-body {
    color: var(--text-primary);
}

/* Fix text colors that might be black in dark mode */
[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

/* Fix any elements with explicit black/white colors */
[data-theme="dark"] .text-black,
[data-theme="dark"] [style*="color: black"],
[data-theme="dark"] [style*="color:#000"],
[data-theme="dark"] [style*="color: #000"] {
    color: var(--text-primary) !important;
}

[data-theme="dark"] [style*="background: black"],
[data-theme="dark"] [style*="background-color: black"],
[data-theme="dark"] [style*="background:#000"],
[data-theme="dark"] [style*="background-color:#000"] {
    background-color: var(--bg-secondary) !important;
}

/* Ensure proper contrast for borders */
[data-theme="dark"] [style*="border: 1px solid #f7f7f7"],
[data-theme="dark"] [style*="border-color: #f7f7f7"] {
    border-color: var(--border-primary) !important;
}

/* Fix any other potential black text issues */
[data-theme="dark"] * {
    color: inherit;
}

[data-theme="dark"] .card-text,
[data-theme="dark"] .card-body,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-header {
    color: var(--text-primary);
}

/* Ensure icons inherit proper colors */
[data-theme="dark"] i {
    color: inherit;
}

/* Bootstrap Components Dark Mode Overrides */
[data-theme="dark"] .card {
    background-color: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
    box-shadow: 0 2px 4px var(--shadow-dark);
}

[data-theme="dark"] .card-header {
    background-color: var(--bg-tertiary);
    border-bottom-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .card-body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

/* Specific styling for the options card */
[data-theme="dark"] .options-card {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary);
}

/* Specific styling for the route diagram card, but preserve inner diagram colors */
[data-theme="dark"] .routeDiagram.card-body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary);
}

/* But ensure the route table inside keeps its original white background and colors */
[data-theme="dark"] .routeDiagram .route_table {
    background-color: transparent !important;
}

/* Make sure any text outside the actual route diagram (but inside the card) uses dark theme colors */
[data-theme="dark"] .routeDiagram > *:not(.route_table):not(table) {
    color: var(--text-primary);
}

[data-theme="dark"] .table {
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control {
    background-color: var(--bg-tertiary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

[data-theme="dark"] .btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

[data-theme="dark"] .btn-secondary {
    background-color: var(--bg-quaternary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background-color: #6ea8fe;
    border-color: #6ea8fe;
    color: var(--text-inverse);
}

[data-theme="dark"] .modal-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-secondary);
}

[data-theme="dark"] .modal-footer {
    border-top-color: var(--border-secondary);
}

[data-theme="dark"] .navbar-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .navbar-light .navbar-brand {
    color: var(--text-primary);
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .navbar-light .navbar-nav .nav-link:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .bg-light {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .alert-info {
    color: #6ea8fe;
    background-color: #031633;
    border-color: #084298;
}

[data-theme="dark"] .alert-success {
    color: var(--toast-success-text);
    background-color: var(--toast-success-bg);
    border-color: var(--toast-success-border);
}

[data-theme="dark"] .alert-danger {
    color: var(--toast-error-text);
    background-color: var(--toast-error-bg);
    border-color: var(--toast-error-border);
}

[data-theme="dark"] .alert i {
    color: inherit !important;
}

/* Dark Mode Toggle Button - Matches refresh/hide buttons */
.dark-mode-toggle {
    border: 1px solid #f7f7f7;
    width: 40px;
    padding-left: 15px;
    margin-top: -20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: var(--text-color);
    font-size: 16px;
    height: auto;
    vertical-align: top;
    margin-right: 5px;
    float: right;
}

.dark-mode-toggle:hover {
    transform: rotate(360deg);
    transition: transform 0.3s ease;
}

.dark-mode-toggle i {
    color: var(--text-color);
}

/* Dark mode specific styling */
[data-theme="dark"] .dark-mode-toggle {
    border: none !important;
    color: var(--text-primary);
}

[data-theme="dark"] .dark-mode-toggle i {
    color: var(--text-primary);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: var(--bg-tertiary);
}

/* Disclaimer */
.disclaimer {
    background: var(--toast-error-bg) !important;
    color: var(--text-primary) !important;
}

/* Credits */
.credits-col {
    border-left-color: var(--border-primary);
}

/* Error Messages */
.error_msg {
    border-color: var(--toast-error-border);
    background: var(--toast-error-bg);
    color: var(--text-primary);
}

/* Maintenance Box */
.maintenance-box {
    background: #1a4a4a;
    border-color: var(--border-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .maintenance-box {
    background: #0a2f2f;
}

/* Dropdown Menus */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: #ffffff !important; /* default white text */
}

[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: #ffffff !important; /* ensure each item text is white */
}

[data-theme="dark"] .fa-solid {
    color: #ffffff !important; /* ensure each item text is white */
}

[data-theme="dark"] .nav-tabs .nav-item.show .nav-link,
[data-theme="dark"] .nav-tabs .nav-link.active {
    
    background-color: transparent !important; /* no background */
    border-color: #dee2e6 #dee2e6 transparent;
}


[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu .dropdown-item:focus {
    background-color: #1e1d1d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .nav-tabs .nav-item.show .nav-link,
[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #ffffff; /* pure white text for emphasis */
    font-weight: 600; /* bolder */
    background-color: rgba(255, 255, 255, 0.05) !important; /* subtle highlight */
    border-color: transparent transparent #0d6efd; /* bright bottom border (Bootstrap blue) */
    border-width: 0 0 3px 0; /* thicker underline */
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--text-secondary); /* normal state */
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--text-primary) !important; /* stop it going blue */
    text-decoration: none !important;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #ffffff !important; /* standout active tab */
}



/* Smooth transitions for theme switching */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease !important;
}

/* Disable transitions during theme initialization to prevent flash */
.theme-transitioning * {
    transition: none !important;
}

/* User Dashboard Dark Mode Overrides */
[data-theme="dark"] .content-card .card {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 10px 25px var(--shadow-light);
}

[data-theme="dark"] .header-section {
    background: linear-gradient(135deg, #2d1b69 0%, #44237c 100%);
}

[data-theme="dark"] .stat-card {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .stat-card:hover {
    box-shadow: 0 8px 25px var(--shadow-light);
    border-color: var(--border-primary);
}

[data-theme="dark"] .welcome-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .welcome-card h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .btn-tile {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-tile:hover {
    background: var(--bg-tertiary);
    box-shadow: 0 4px 8px var(--shadow-light);
}

/* Keypad Dark Mode */
[data-theme="dark"] .keypad button,
[data-theme="dark"] .keypad input[type="submit"] {
    background: var(--bg-secondary);
    border-color: var(--border-secondary);
    color: var(--text-primary);
}

[data-theme="dark"] .keypad button:active,
[data-theme="dark"] .keypad input[type="submit"]:active {
    background-color: var(--bg-tertiary);
}

/* Custom scrollbar for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Print media - force light mode for printing */
@media print {
    [data-theme="dark"] {
        --bg-primary: #ffffff;
        --bg-secondary: #ffffff;
        --bg-tertiary: #f7f7f7;
        --bg-quaternary: #e9ecef;
        --text-primary: #000000;
        --text-secondary: #333333;
        --text-muted: #666666;
        --border-primary: #cccccc;
        --border-secondary: #dddddd;
        --border-dark: #000000;
    }
    
    .dark-mode-toggle {
        display: none;
    }
}
/**
 * Z-Index Override CSS
 * 
 * This file contains CSS overrides to standardize z-index values across
 * third-party components according to our z-index specification.
 * 
 * Layer 6: Third-party Components (1200-1299)
 */

/* DateTime picker components - standardized to Layer 6 */
.gj-modal {
    z-index: 1200 !important;
}

.gj-picker {
    z-index: 1200 !important;
}

.gj-resizable-handle {
    z-index: 1200 !important;
}

.gj-dialog-bootstrap,
.gj-dialog-bootstrap4,
.gj-dialog-bootstrap5,
.gj-dialog-md {
    z-index: 1200 !important;
}

.gj-dropdown-list-md {
    z-index: 1200 !important;
}

.gj-dropdown-list-bootstrap {
    z-index: 1200 !important;
}

.gj-slider [role=progress] {
    z-index: 1200 !important;
}

.gj-slider-md [role=handle],
.gj-slider-bootstrap [role=handle] {
    z-index: 1200 !important;
}

span.gj-grid-column-resizer {
    z-index: 1200 !important;
}

.gj-tree-drag-el {
    z-index: 1200 !important;
}

/* Additional third-party component overrides can be added here */
/* Keep all values within Layer 6: 1200-1299 range */

