/*
Theme Name: Niagara Transit Theme
Description: This is a custom child theme for Salient
Theme URI:   https://themeforest.net/item/salient-responsive-multipurpose-theme/4363266
Author: ThemeNectar
Author URI:  https://themeforest.net/user/themenectar
Template: salient
Version: 1.0
*/

/* Timetable Styles */

.timetable-page {
  margin-left: 1rem;
  margin-right: 1rem;
}

@media (min-width: 640px) {
  .timetable-page {
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .timetable-page {
    max-width: 768px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 1024px) {
  .timetable-page {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .timetable-page {
    max-width: 1280px;
  }
}

@media (min-width: 1536px) {
  .timetable-page {
    max-width: 1536px;
  }
}

.timetable-page h1 {
  font-size: 1.5rem;
  line-height: 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 0.5rem;
  display: flex;
  align-items: center;
}

@media (min-width: 768px) {
  .timetable-page h1 {
    font-size: 2rem;
    line-height: 2rem;
  }
}

.timetable-page h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

@media (min-width: 768px) {
  .timetable-page h2 {
    font-size: 1.5rem;
  }
}

.timetable-page h3 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timetable-page .effective-date {
  margin-top: 0.5rem;
  color: rgb(75 85 99);
}

.timetable-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.timetable-page .hidden {
  display: none;
}

.timetable-page .timetable .timetable-label {
  margin-bottom: 0.5rem;
}

.timetable-page .timetable .timetable-footer {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.25rem;
}

@media (min-width: 768px) {
  .timetable-page .timetable .timetable-footer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* Menu Styles */

.timetable-page .timetable-simple-menu {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.timetable-page .timetable-jump-menu {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .timetable-page .timetable-jump-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.timetable-page .timetable-jump-menu a {
  width: 100%;
  margin-bottom: 0.5rem;
}

.timetable-page .timetable-radio-menu {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .timetable-page .timetable-radio-menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.timetable-page .timetable-radio-menu label {
  width: 100%;
  margin-bottom: 0.5rem;
}

.timetable-page .menu-type-radio .timetable {
  display: none;
}

.timetable-page .btn-blue {
  color: rgb(255 255 255);
  padding: 0.75rem 1.5rem;
  background-color: rgb(37 99 235);
  border-radius: 0.375rem;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  cursor: pointer;
  text-decoration: none;
}

.timetable-page .btn-blue span {
  color: rgb(255 255 255);
}

.timetable-page .btn-blue:hover {
  background-color: rgb(29 78 216);
  text-decoration: none;
}

.timetable-page .btn-gray {
  color: rgb(75 85 99);
  padding: 0.75rem 1.5rem;
  background-color: rgb(209 213 219);
  border-radius: 0.375rem;
  justify-content: center;
  align-items: center;
  display: inline-flex;
  cursor: pointer;
  text-decoration: none;
}

.timetable-page .btn-gray:hover {
  background-color: rgb(201, 206, 213);
  text-decoration: none;
}

.timetable-page .btn-sm {
  padding: 0.25rem 1rem;
  border-radius: 0.25rem;
}

.timetable-page .timetable {
  margin-bottom: 2.5rem;
}

.timetable-page .timetable .table-vertical .stop-header {
  text-align: center;
  line-height: 1.15;
  font-size: 0.875rem;
}

.timetable-page .timetable .table-horizontal th {
  line-height: 1.15;
}

.timetable-page .timetable .trip-header {
  text-align: center;
}

.timetable-page .timetable .trip-name {
  display: inline-block;
}

.timetable-page .timetable .run-footer {
  text-align: center;
}

.timetable-page .timetable .run-footer .continues-as-route {
  font-weight: bold;
}

.timetable-page .timetable .stop-code {
  font-weight: normal;
  padding-top: 0.25rem;
}

.timetable-page .timetable .stop-time {
  text-align: center;
}

.timetable-page .timetable .stop-time.pm {
  font-weight: bold;
}

.timetable-page .timetable a.symbol {
  padding-left: 4px;
  color: #212529;
  text-decoration: none;
}

.timetable-page .timetable .trip-frequency {
  text-align: center;
  font-weight: bold;
}

.timetable-page .timetable .city-row {
  font-size: 1.5rem;
  color: #415d86;
}

.timetable-page .timetable th.city-column {
  font-size: 1.5rem;
  text-align: center;
}

/* Updated table container styles with improved scrolling - FOR SINGLE ROUTE TIMETABLES ONLY */
.timetable-page .timetable:not(.timetable-overview) .table-container {
  position: relative;
  margin: 20px 0;
  height: 800px; /* Fixed height as requested */
}

/* Create separate scrolling containers - FOR SINGLE ROUTE TIMETABLES ONLY */
.timetable-page .timetable:not(.timetable-overview) .horizontal-scroll-container {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.timetable-page .timetable:not(.timetable-overview) .vertical-scroll-container {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 800px;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Sticky first column styles for horizontal tables */
.timetable-page .timetable .table-horizontal tbody tr th.stop-name-container {
  position: sticky;
  left: 0;
  z-index: 2; /* Higher than regular cells but lower than header */
  background-color: inherit; /* Inherit from row for zebra striping */
  min-width: 175px;
  box-shadow: 2px 0 5px -2px rgba(0, 0, 0, 0.1);
}

/* Ensure sticky cells maintain proper background color */
.timetable-page .timetable table > tbody > tr:nth-of-type(odd) th.stop-name-container {
  background-color: #f9f9f9;
}

.timetable-page .timetable table > tbody > tr:nth-of-type(even) th.stop-name-container {
  background-color: #ffffff;
}

.timetable-page .timetable table > tbody > tr.highlighted th.stop-name-container {
  background-color: #f8f8b9;
}

@media screen and (min-width: 768px) {
  .timetable-page .table-horizontal tbody tr th.stop-name-container {
    min-width: 250px;
  }
}

/* Scrollbar styles */
.timetable-page .timetable .horizontal-scroll-container::-webkit-scrollbar,
.timetable-page .timetable .vertical-scroll-container::-webkit-scrollbar {
  -webkit-appearance: none;
  height: 8px;
  width: 8px;
}

.timetable-page .timetable .horizontal-scroll-container::-webkit-scrollbar-track,
.timetable-page .timetable .vertical-scroll-container::-webkit-scrollbar-track {
  background-color: rgba(57, 57, 57, 0.2);
  border-radius: 4px;
}

.timetable-page .timetable .horizontal-scroll-container::-webkit-scrollbar-thumb,
.timetable-page .timetable .vertical-scroll-container::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(156, 156, 156, 0.8);
}

.timetable-page .timetable .table-container table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

.timetable-page .timetable thead tr {
  background-color: rgb(224, 230, 245);
}

.timetable-page .timetable thead tr,
.timetable-page .timetable thead tr a {
  color: #222222;
}

.timetable-page .timetable th {
  text-align: left;
  font-size: 0.8rem;
}

.timetable-page .timetable td,
.timetable-page .timetable th {
  padding: 0;
}

.timetable-page .timetable table > thead > tr > th,
.timetable-page .timetable table > tbody > tr > th,
.timetable-page .timetable table > tfoot > tr > th,
.timetable-page .timetable table > thead > tr > td,
.timetable-page .timetable table > tbody > tr > td,
.timetable-page .timetable table > tfoot > tr > td {
  padding: 8px;
  line-height: 1.4;
  vertical-align: top;
  border: 1px solid #dddddd;
}

.timetable-page .timetable table > thead > tr > th {
  vertical-align: top;
  border-bottom: 2px solid #dddddd;
}

.timetable-page .timetable table > tbody + tbody {
  border-top: 2px solid #dddddd;
}

.timetable-page .timetable table > thead > tr > th,
.timetable-page .timetable table > thead > tr > td {
  border-bottom-width: 2px;
}

.timetable-page .timetable table > tbody > tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}

.timetable-page .timetable table > tbody > tr.highlighted,
.timetable-page .timetable table > tbody > tr.highlighted > th,
.timetable-page .timetable table > tbody .stop-time.highlighted,
.timetable-page .timetable table > thead .stop-header.highlighted {
  background-color: #f8f8b9;
}

.timetable-page .table-hourly {
  width: auto;
}

.timetable-page .timetable .table-vertical .trip-row .trip-notes {
  white-space: nowrap;
}

.timetable-page .route-color-swatch {
  min-width: 29px;
  height: 29px;
  border-radius: 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: -0.5px;
  padding: 0 2px;
  flex-shrink: 0;
  font-weight: bold;
  color: white;
}

.timetable-page .route-color-swatch-large {
  min-width: 46px;
  height: 46px;
  border-radius: 8px !important;
  text-align: center;
  line-height: 46px;
  font-size: 30px !important;
  font-weight: bold;
  letter-spacing: 0px !important;
  padding: 0 15px !important;
  flex: none;
  flex-shrink: 0;
  margin-right: 10px !important;
}

/* Map Styles */

.timetable-page .map-container {
  position: relative;
}

.timetable-page .map {
  min-height: 350px;
}

@media screen and (min-width: 768px) {
  .timetable-page .map {
    min-height: 450px;
  }
}

.timetable-page .map .mapboxgl-popup-content .popup-title {
  margin: 0 20px 5px 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.timetable-page .map .mapboxgl-popup-content .popup-label {
  border-bottom: 1px solid #e0e0e0;
  padding-top: 0.5rem;
}

.timetable-page .map .mapboxgl-popup-content .route-list {
  margin-bottom: 1rem;
  margin-top: 0.25rem;
}

.timetable-page .map .mapboxgl-popup-content .map-route-item {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.timetable-page .map .mapboxgl-popup-content .map-route-item:hover {
  text-decoration: none;
}

.timetable-page .map .mapboxgl-popup-content .mapboxgl-popup-close-button {
  padding: 0 5px;
}

/* Print Styles */

@media print {
  body {
    -webkit-print-color-adjust: exact;
    width: 100%;
    margin: 0 auto;
    font-size: 0.8rem;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  p {
    page-break-inside: avoid;
    orphans: 3;
    widows: 3;
  }

  img,
  table {
    max-width: 100%;
  }

  .timetable-page h1 {
    padding-top: 0;
    font-size: 1.5rem;
  }

  .timetable-page .timetable:not(:first-of-type) {
    page-break-before: always;
  }

  .timetable-page .timetable .table-container {
    overflow: auto;
    margin-bottom: 0;
    height: auto; /* Reset fixed height for printing */
  }
  
  .timetable-page .timetable .horizontal-scroll-container,
  .timetable-page .timetable .vertical-scroll-container {
    overflow: visible;
    height: auto;
  }

  .timetable-page .timetable table > thead > tr > th,
  .timetable-page .timetable table > tbody > tr > th,
  .timetable-page .timetable table > tfoot > tr > th {
    padding: 3px 5px;
    line-height: 1.3;
    position: relative; /* Reset sticky position for printing */
    left: auto;
  }

  .timetable-page .timetable table > thead > tr > td,
  .timetable-page .timetable table > tbody > tr > td,
  .timetable-page .timetable table > tfoot > tr > td {
    padding: 3px 5px;
    line-height: 1;
  }

  .timetable .table-container {
    overflow: hidden;
  }

  .timetable table {
    page-break-after: auto;
  }

  .timetable tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  .timetable td {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  .timetable thead {
    display: table-header-group;
  }

  .timetable tfoot {
    display: table-footer-group;
  }

  .timetable-page .map-legend {
    display: none;
  }
}

/* Overview styles */

.timetable-overview {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .timetable-overview {
    display: flex;
    flex-direction: row;
    height: 100vh;
  }
}

/* Headings */
.timetable-overview h1,
.timetable-overview h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  margin-left: 1rem;
  margin-right: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .timetable-overview h1,
  .timetable-overview h2 {
    font-size: 1.5rem;
    line-height: 2rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* Accordion group container */
.timetable-overview .route-group {
  min-width: 300px;
}

/* Accordion trigger button */
.timetable-overview .route-group-title {
  width: 100%;
  text-align: left;
  padding: 15px 20px;
  background: none;
  border: none;
  font-size: 1.2em;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  min-height: 60px; /* Larger touch target */
}

@media (min-width: 768px) {
  .timetable-overview .route-group-title {
    font-size: 1.5em;
    min-height: auto;
    padding: 15px;
  }
}

.timetable-overview .route-group-title:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.timetable-overview .route-group-title:focus {
  outline: 2px solid #4A90E2;
  outline-offset: -2px;
}

/* Accordion icon rotation */
.timetable-overview .indicator {
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 1.2em;
  transition: transform 0.3s ease;
  display: inline-block;
  margin-left: 10px;
}

@media (min-width: 768px) {
  .timetable-overview .indicator {
    width: auto;
    height: auto;
    background-color: transparent;
  }
}

.timetable-overview .route-group-title[aria-expanded="true"] .indicator {
  transform: rotate(45deg);
}

/* Accordion content wrapper */
.timetable-overview .route-group-routes {
  overflow: hidden;
  transition: height 0.3s ease-out;
}

/* Original route link styles for desktop and non-system-map pages */
.timetable-overview a.timetable-page-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgb(226 232 240);
  text-decoration: none;
  padding: 12px 15px;
  min-height: 50px;
}

.timetable-overview a.timetable-page-link:hover {
  background-color: rgb(241 245 249);
}

.timetable-overview a.timetable-page-link .timetable-page-label {
  font-size: 1.25rem;
  line-height: 1;
  color: rgb(30 41 59);
}

/* Route items dual tap functionality - Mobile mode - PROPERLY SCOPED */
.timetable-overview .route-item {
  position: relative;
  display: flex;
  border-bottom: 1px solid rgb(226 232 240);
  min-height: 50px;
}

/* Route link area - left side for info/navigation - PROPERLY SCOPED */
.timetable-overview .route-item .route-link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 15px;
  text-decoration: none;
  gap: 0.5rem;
  color: rgb(30 41 59);
  min-width: 0; /* Ensure text truncating works */
}

.timetable-overview .route-item .route-link:hover {
  background-color: rgba(241, 245, 249, 0.5);
}

.timetable-overview .route-item .route-info {
  flex: 1;
  min-width: 0; /* Ensure text truncating works */
}

.timetable-overview .route-item .route-name {
  font-size: 1.25rem;
  line-height: 1.2;
  color: rgb(30 41 59);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timetable-overview .route-item .route-desc {
  font-size: 0.875rem;
  color: rgb(75 85 99);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Map highlight button - right side - PROPERLY SCOPED */
.timetable-overview .route-item .map-highlight-button {
  width: 60px;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(241, 245, 249, 0.7);
  border: none;
  border-left: 1px solid rgb(226 232 240);
  cursor: pointer;
  padding: 0;
}

.timetable-overview .route-item .map-highlight-button:hover,
.timetable-overview .route-item .map-highlight-button:focus {
  background-color: rgba(229, 231, 235, 0.9);
}

.timetable-overview .route-item .map-highlight-button.active {
  background-color: rgba(37, 99, 235, 0.1);
}

.timetable-overview .route-item .map-icon {
  font-size: 1.5rem;
  color: rgb(59, 130, 246);
}

/* Desktop mode - keep original behavior */
@media (min-width: 768px) {
  .timetable-overview .route-item .map-highlight-button {
    display: none; /* Hide the separate button on desktop */
  }

  .timetable-overview .route-item {
    border-bottom: none; /* Reset to match original style */
  }

  .timetable-overview .route-item .route-link {
    width: 100%; /* Ensure full width for hover highlight functionality */
    border-bottom: 1px solid rgb(226 232 240);
  }
}

/* Swatches and badges */
.timetable-overview .route-color-swatch {
  min-width: 29px;
  height: 29px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: -0.5px;
  padding: 0 2px;
  flex-shrink: 0;
  font-weight: bold;
  color: white;
}

.timetable-overview .route-color-swatch-large {
  min-width: 84px;
  height: 46px;
  border-radius: 8px !important;
  text-align: center;
  line-height: 46px;
  font-size: 30px !important;
  font-weight: bold;
  letter-spacing: 0px !important;
  padding: 0 15px !important;
  flex: none;
  flex-shrink: 0;
  margin-right: 10px !important;
}

.timetable-overview .btn-blue {
  color: rgb(255 255 255);
  padding: 0.75rem 1.5rem;
  background-color: rgb(37 99 235);
  border-radius: 0.375rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.timetable-overview .btn-blue:hover {
  background-color: rgb(29 78 216);
}

.timetable-overview .btn-sm {
  padding: 0.25rem 1rem;
  border-radius: 0.25rem;
}

.timetable-overview .badge-gray {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1;
  font-weight: 700;
  color: rgb(30 41 59);
  background-color: rgb(226 232 240);
  border-radius: 9999px;
}

/* Mobile System Map Layout */
.timetable-overview .overview-map {
  order: 1;
  height: 50vh; /* 50% viewport height on mobile */
  width: 100%;
  position: relative;
  z-index: 1;
}

.timetable-overview .overview-list {
  order: 2;
  width: 100%;
  max-height: 50vh;
  overflow-y: auto;
  border-top: 3px solid #e0e6f5;
  background-color: #fff;
  z-index: 2;
  padding-bottom: 80px; /* Extra padding at bottom for scrolling */
}

/* Desktop System Map Layout */
@media (min-width: 768px) {
  .timetable-overview .overview-map {
    order: 2;
    height: auto;
    flex: 1 1 auto;
  }
  
  .timetable-overview .overview-list {
    order: 1;
    flex: 0 0 24rem;
    max-height: 100vh;
    border-top: none;
    border-right: 1px solid #e0e6f5;
    padding-bottom: 20px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
  }
}

/* Enhance map controls for touch */
.timetable-overview .mapboxgl-ctrl-group button {
  width: 40px;
  height: 40px;
}

@media (min-width: 768px) {
  .timetable-overview .mapboxgl-ctrl-group button {
    width: auto;
    height: auto;
  }
}

/* Overview Map Styles */
.overview-map {
  height: 100%;
  width: 100%;
}

.overview-map .mapboxgl-popup-content .popup-title {
  margin: 0 20px 5px 0;
  font-size: 16px;
  font-weight: bold;
}

.overview-map .mapboxgl-popup-content .popup-label {
  border-bottom: 1px solid #e0e0e0;
  padding-top: 0.5rem;
}

.overview-map .mapboxgl-popup-content .route-list {
  margin-bottom: 1rem;
  margin-top: 0.25rem;
}

.overview-map .mapboxgl-popup-content .map-route-item {
  display: flex;
  align-items: center;
  font-size: 0.75rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.overview-map .mapboxgl-popup-content .map-route-item:hover {
  text-decoration: none;
}

.overview-map .mapboxgl-popup-content a.map-route-item .underline-hover:hover {
  text-decoration: underline;
}

.overview-map .mapboxgl-popup-content .mapboxgl-popup-close-button {
  padding: 0 5px;
}

/* Improved system map sizing */
#system_map {
  height: 100%;
  width: 100%;
}

/* Make stop markers more tap-friendly */
.mapboxgl-map .mapbox-gl-draw_point {
  min-width: 12px;
  min-height: 12px;
}

/* Improved popup styles for mobile */
.mapboxgl-popup-content {
  padding: 15px;
  max-width: 280px;
}

.mapboxgl-popup-content .popup-title {
  font-size: 16px;
  margin-bottom: 10px;
}

/* Back to top button for mobile */
.back-to-top {
  display: block;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: rgba(37, 99, 235, 0.8);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 50px;
  font-size: 20px;
  z-index: 1000;
  display: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  .back-to-top {
    display: none !important;
  }
}

/* Mobile-friendly enhancements for vehicle markers on map */
.vehicle-marker {
  cursor: pointer;
  width: 30px !important; /* Larger touch target on mobile */
  height: 30px !important;
}

.vehicle-marker-arrow {
  width: 100%;
  height: 100%;
  position: relative;
}

/* Enhance GTFS-RT pop-ups for mobile */
.vehicle-popup .mapboxgl-popup-content {
  min-width: 250px;
  max-width: 90vw;
  padding: 15px;
}

@media (min-width: 768px) {
  .vehicle-marker {
    width: 20px !important; /* Return to original size on desktop */
    height: 20px !important;
  }
}

/* Mobile optimized map legend */
.map-legend {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 5px;
  padding: 5px 10px;
  font-size: 12px;
  max-width: 200px;
}

/* Enhanced visibility for map markers on mobile */
.mapboxgl-canvas-container .mapboxgl-marker svg {
  stroke-width: 2px; /* More visible on small screens */
}

/* Fallback for regular timetable container if enhanced scrolling isn't applied */
.timetable-page .timetable:not(.timetable-overview) .table-container:not(:has(.vertical-scroll-container)) {
  overflow: auto; /* Revert to standard overflow for both directions */
}
