/* === General Page and Map Styles === */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* temporarily hide any overflow */
}

#map {
  position: absolute;
  top: 0;     /* will be dynamically adjusted by JS if alert bar is shown */
  left: 0;
  width: 100%;
  bottom: 0;  /* ensures attribution stays visible */
}

/* Alert Bar */
#alert-bar {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 100%;
  box-sizing: border-box;
  z-index: 5000;
  padding: 8px;
  background-color: #ffcc00;
  color: #000;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Menu and Logo */
#menu-button, #logo {
  position: absolute;
  z-index: 5001;
}

#sidebar.hidden {
  transform: translateX(-100%);
}

/* Leaflet Tooltip Styles */
.leaflet-tooltip.stop-label {
  font-weight: bold;
}
.leaflet-tooltip.nowrap-label {
  white-space: nowrap;
}
.leaflet-tooltip.wrap-label {
  white-space: normal;
  max-width: 160px;
  line-height: 1.3;
  text-align: center;
}
#sidebar label {
  font-size: 2em;
}
.leaflet-tooltip.stop-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: black;
}
.leaflet-popup-pane {
  z-index: 9999 !important;
}
.leaflet-popup-content {
  font-family: 'Roboto', sans-serif;
}
.leaflet-tooltip:before {
  display: none !important;
}
.leaflet-control-zoom {
  bottom: 20px !important;
  right: 10px !important;
  z-index: 9999;
}
select {
  padding: 0;
  vertical-align: middle;
}

/* Checkbox Styles */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid black;
  background-color: black;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 3px;
  display: inline-block;
  font-family: sans-serif;
  text-align: center;
}
input[type="checkbox"]:checked::before {
  content: "\2714\FE0E";
  color: white;
  -webkit-text-fill-color: white;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -58%);
  font-size: 18px;
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Top-right logo */
#top-right-logo {
  position: fixed;
  top: 5px;
  right: 10px;
  z-index: 5000;
}
#top-right-logo img {
  height: 100px;
  width: auto;
  cursor: pointer;
}

/* Loader Overlay */
#loader-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease;
}
#loader-video {
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  object-position: left center;
}
.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#fog-overlay {
  position: absolute;
  inset: 0;
  background: rgb(204, 204, 204);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  z-index: 1001;
}
#loader-overlay.fogged #fog-overlay {
  opacity: 1;
}
#loader-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
.leaflet-control-attribution {
  bottom: 30px !important;
}

/* Sidebar Toggle Button */
#sidebar-toggle-button {
  position: fixed;
  font-size: 1em;
  top: 15px;
  left: 20px;
  z-index: 1100;
  display: none;
  padding: 9px 15px;
  background-color: #D6393C;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 6px #4b4a49;
  font-family: Roboto, sans-serif;
}

/* Sidebar Panel */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 240px;
  background: #fff;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0,0,0,0.3);
  padding: 10px;
  z-index: 1000;
}
#toggle-sidebar {
  position: absolute;
  font-size: 16px;
  top: 15px;
  right: 20px;
  z-index: 1001;
  padding: 9px 15px;
  background-color: #D6393C;
  color: rgb(255, 255, 255);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 6px #4b4a49;
  font-family: 'Roboto', sans-serif;
}

/* Trip Planner Styles */
#trip-planner h3 {
  font-family: 'Just Another Hand', cursive;
  font-size: 22px;
  text-transform: uppercase;
  color: #000000;
  margin-top: 20px;
  margin-bottom: 2px;
  text-shadow: -1.5px 1px #ffffff;
  text-decoration: underline;
}
#trip-planner p {
  font-family: Roboto, sans-serif;
  font-size: 12px;
  margin: 0 0 10px 0;
  color: #333;
}
#destination-select {
  width: 80%;
  padding: 4px 6px;
  padding-left: 10px;
  font-size: 16px;
  font-family: 'Just Another Hand', cursive;
  text-transform: uppercase;
  background-color: white;
  color: #000000;
  border: 2px solid #e10e0e;
  border-radius: 6px;
  text-shadow: -1.5px 1px #ffffff;
  appearance: none;
  -webkit-appearance: none;
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  margin: 6px 0 10px 10px;
  display: block;
}
#trip-results {
  margin-top: 0px;
  font-family: 'Roboto', sans-serif;
  font-size: 24px;
  line-height: 1.2;
  text-shadow: -1.5px 1px #ffffff;
  color: black;
}

/* More Info Section */
h2 {
  font-family: 'Just Another Hand', cursive;
  font-size: 22px;
  text-transform: uppercase;
  color: #000000;
  margin-top: 20px;
  margin-bottom: 8px;
  text-shadow: -1.5px 1px #ffffff;
  text-decoration: underline;
}
a.info-box {
  width: 93%;
  display: block;
  padding: 6px 8px;
  margin-top: 6px;
  font-size: 18px;
  font-family: 'Just Another Hand', cursive;
  text-transform: uppercase;
  background-color: #FCB62D;
  color: #000000;
  border: 2px solid #000000;
  border-radius: 6px;
  text-shadow: -1.5px 1px #ffffff;
  text-decoration: none;
  text-align: center;
}
