html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: 'Manrope', sans-serif;
  background: #000;
  /* Completely disable zooming */
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Manrope', sans-serif;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
  color: #fff;
  overflow: hidden;
}

/* Prevent zoom on calendar and controls */
#controls, #dateSelect, .pika-single, #sliderContainer {
  touch-action: manipulation; /* Prevents double-tap zoom */
}

/* Prevent pinch zoom on calendar */
.pika-single {
  touch-action: pan-x pan-y; /* Only allow pan, no pinch */
}

/* Allow map zooming while preventing website zooming */
#cesiumContainer {
  touch-action: auto; /* Allow map to handle touch gestures */
}

html,
body,
#cesiumContainer {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Manrope', sans-serif;
}
#controls {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 4px rgba(255, 255, 255, 0.4),
  0 0 14px rgba(86, 141, 209, 0.3),
  0 0 28px rgba(86, 141, 209, 0.2),
  inset 0 0 30px rgba(86, 141, 209, 0.7);
  padding: 15px 15px 0px 0px;
  z-index: 1000;
  color: #f3f3f3;
  border-radius: 16px;
  max-height: 364px;
  max-width: 228px;
  transition: max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
  opacity: 1;
}

#controls h2 {
  margin-top: 0;
  font-size: 26px;
  color: #f3f3f3;
  margin-left: 15px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-row label {
  font-size: 13px;
  color: #f3f3f3;
  min-width: 40px;
  display: inline-block;
}

.control-row select {
  flex-grow: 1;
  padding: 3px 4px;
  border: 1px solid #444;
  border-radius: 4px;
  font-size: 13px;
  background-color: #23272b;
  color: #f3f3f3;
  width: 86px;
}

#sliderContainer {
  position: fixed;
  top: calc(100vh - 288px); /* Position from top instead of bottom */
  right: 10px;
  /* transform: translate(-50%, -50%); */
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 14px rgba(86, 141, 209, 0.3),
              0 0 28px rgba(86, 141, 209, 0.2),
              inset 0 0 30px rgba(86, 141, 209, 0.7);
  border-radius: 16px;
  padding: 15px;
  z-index: 1100;
  color: #f3f3f3;
  width: 213px;
  min-height: unset;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: -8px;
  margin-top: -5px;
}

#hourValue {
  font-size: 25px;
  font-weight: 100;
  letter-spacing: 0.08em;
  color: #f3f3f3;
  margin-bottom: 3px;
  display: block;
  position: relative;
  width: 100%;
  border-top: 2.5px solid rgba(134, 148, 155, 0.718);
  padding-top: 8px;
  margin-top: -3px;
  cursor: grab;
  user-select: none;
  text-align: center;
  text-shadow:
    0 0 3px #568dd1,
    0 0 6px #568dd1,
    0 0 9px #568dd1;
}

#hourTextWrap {
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
}

#hourHour {
  min-width: 1.5em;
  margin-left: -10px;
  text-align: right;
  display: inline-block;
}

#hourRest {
  display: inline-block;
  min-width: 7.5em; /* reduced from 7.5em */
  text-align: left;
}

#hourSlider,
#filterSlider {
  width: 100%;
  margin: 5px 0;
  cursor: pointer;
}

#varSelect {
  cursor: pointer;
}

.button-row {
  display: flex;
  gap: 5px;
  margin-bottom: 1px;
}

/* Make play/pause button full width if it's the only button in .button-row */
#playPauseBtn {
  all: unset;
}

#dataStats {
  background: rgba(30, 32, 36, 0.85);
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
  padding: 10px 0;
  margin-top: 16px;
  text-align: center;
}

.view-toggle-btn {
  position: absolute;
  top: 60px;
  left: 10px;
  padding: 12px 36px;
  font-size: 1.2em;
  font-weight: 450;
  background: #ffffff;
  color: #222;
  border: 1px solid #bbb;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  z-index: 1100;
  display: block;
}

.view-toggle-btn:hover {
  background: #e0e0e0;
  transform: scale(1.04);
}

#legend {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 70px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 4px rgba(255, 255, 255, 0.4),
  0 0 14px rgba(86, 141, 209, 0.3),
  0 0 28px rgba(86, 141, 209, 0.2),
  inset 0 0 30px rgba(86, 141, 209, 0.5);
  border-radius: 16px;
  padding: 10px 8px 8px 8px;
  z-index: 1100;
  text-align: center;
  color: #f3f3f3;
}

/* Dynamic gradient will be set via JavaScript */
.legend-gradient {
  height: 120px;
  width: 30px;
  margin: 0 auto;
  margin-left: 18.5px;
  border: 1px solid rgba(134, 148, 155, 1);
  border-radius: 2px;
  position: relative;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 14px rgba(86, 141, 209, 0.3),
              0 0 28px rgba(86, 141, 209, 0.2);
}

.legend-label {
  font-size: 11px;
  color: #f3f3f3;
  margin: 0 0 2px 0;
}

.legend-label-max {
  margin-bottom: 2px;
}

.legend-label-min {
  margin-top: 2px;
}

.legend-title {
  font-size: 12px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  color: #f3f3f3;
}

#chevronIcon {
  display: block;
  margin-top: -2px;
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scaleX(1.4);
}

#chevronIcon.rotated {
  transform: rotate(180deg) scaleX(1.4);
}

#controls.collapsed {
  max-height: 46px;
  max-width: 228px;
}

#controls.collapsed > *:not(:first-child) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s;
}
#controls > *:not(:first-child) {
  opacity: 1;
  transition: opacity 0.6s;
}

.first-control-row {
  margin-top: -7px;
  margin-bottom: 0;
}

.play-pause-label {
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
  font-weight: 300;
  font-size: 1.1em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: inline-block;
  line-height: 1;
}

body, h2, label, select, .legend-title, .legend-label, .cesium-label, #controls, #hourValue, #filterLabel, .button-row, .slider-container, .play-pause-label {
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif !important;
}

/* --- Pikaday dark mode --- */
.pika-single,
.pika-single.pika-dark {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.12) 100%) !important;
  backdrop-filter: blur(12px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.4) !important;
  border: 1.5px solid rgba(255,255,255,0.45) !important;
  box-shadow: 0 0 2px rgba(255,255,255,0.6),
              0 0 4px rgba(255,255,255,0.4),
              0 0 14px rgba(86,141,209,0.3),
              0 0 28px rgba(86,141,209,0.2),
              inset 0 0 30px rgba(86,141,209,0.6) !important;
  border-radius: 16px !important;
  color: #f3f3f3 !important;
  margin-top: 6px !important;
}
.pika-single .pika-label,
.pika-single .pika-title,
.pika-single .pika-table th,
.pika-single .pika-table td,
.pika-single .pika-button {
  background: transparent !important;
  color: #f3f3f3 !important;
  border-radius: 8px !important;
}
.pika-single .pika-button:hover,
.pika-single .pika-button:focus {
  background: rgba(86,141,209,0.18) !important;
  color: #fff !important;
}

/* Red tint styling for available dates */
.pika-single .pika-button[style*="background-color: rgba(213, 0, 0, 0.6)"] {
  box-shadow: 0 0 4px rgba(213, 0, 0, 0.4) !important;
  border: 1px solid rgba(213, 0, 0, 0.3) !important;
}

.pika-single .pika-button[style*="background-color: rgba(213, 0, 0, 0.6)"]:hover {
  background: rgba(213, 0, 0, 0.8) !important;
  box-shadow: 0 0 8px rgba(213, 0, 0, 0.6) !important;
  transform: scale(1.05);
}

/* Available date styling using CSS class */
.pika-single .pika-button.available-date {
  background-color: rgba(213, 0, 0, 0.6) !important;
  color: #fff !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 0 4px rgba(213, 0, 0, 0.4) !important;
  border: 1px solid rgba(213, 0, 0, 0.3) !important;
}

.pika-single .pika-button.available-date:hover {
  background-color: rgba(213, 0, 0, 0.8) !important;
  box-shadow: 0 0 8px rgba(213, 0, 0, 0.6) !important;
  transform: scale(1.05) !important;
}

/* Hover effects for latency-tinted dates */
.pika-single .pika-button[style*="background-color"]:hover {
  transform: scale(1.05) !important;
  box-shadow: 0 0 8px currentColor !important;
  filter: brightness(1.2) !important;
  /* Don't change the background color on hover - keep the gradient */
  background-color: inherit !important;
}

/* Override any solid color hover effects */
.pika-single .pika-button:hover {
  /* Only apply the default hover effect if no custom background is set */
  background: rgba(86,141,209,0.18) !important;
}

/* But don't override our custom latency tints */
.pika-single .pika-button[style*="background-color"]:hover {
  background-color: inherit !important;
}

/* Ensure disabled dates remain properly styled */
.pika-single .pika-button.is-disabled {
  opacity: 0.3 !important;
  color: rgba(243, 243, 243, 0.5) !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

/* Override hover for disabled dates */
.pika-single .pika-button.is-disabled:hover {
  background: transparent !important;
  color: rgba(243, 243, 243, 0.5) !important;
  transform: none !important;
  box-shadow: none !important;
}
.pika-single .pika-prev,
.pika-single .pika-next {
  background: transparent !important;
  color: #fff !important;
  border-radius: 8px !important;
  opacity: 1 !important;
  font-size: 0 !important;
  min-width: 32px;
  min-height: 32px;
  width: 32px;
  height: 32px;
  position: relative;
}
.pika-single .pika-prev::before,
.pika-single .pika-next::before {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}
.pika-single .pika-prev::before {
  background-image: url("data:image/svg+xml;utf8,<svg width='18' height='18' xmlns='http://www.w3.org/2000/svg'><polyline points='12,4 6,9 12,14' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.pika-single .pika-next::before {
  background-image: url("data:image/svg+xml;utf8,<svg width='18' height='18' xmlns='http://www.w3.org/2000/svg'><polyline points='6,4 12,9 6,14' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.pika-single .pika-prev:hover,
.pika-single .pika-next:hover,
.pika-single .pika-prev:focus,
.pika-single .pika-next:focus {
  background: rgba(86,141,209,0.18) !important;
  color: #fff !important;
}

#dateSelect {
  margin-top: 5px;
  margin-left: 15px;
  text-indent: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%) !important;
  color: #f3f3f3 !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  border-radius: 8px;
  padding: 2.6px 4px;
  font-size: 14px;
  width: 202.5px;
  font-family: inherit;
  outline: none;
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 3px rgba(255, 255, 255, 0.4),
  0 0 7px rgba(86, 141, 209, 0.3),
  0 0 11px rgba(86, 141, 209, 0.2);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
#dateSelect:focus,
#dateSelect:hover {
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%) !important;
  color: #fff !important;
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 3px rgba(255, 255, 255, 0.4),
  0 0 7px rgba(86, 141, 209, 0.3),
  0 0 11px rgba(86, 141, 209, 0.2),
  inset 0 0 15px rgba(86, 141, 209, 0.6);
}

#forecastBtn {
  font-weight: 350;
  box-shadow: 0 1px 4px rgba(30, 30, 40, 0.18);
  background: linear-gradient(90deg, #313743 0%, #444b5a 100%);
  transition: transform 0.1s, box-shadow 0.2s;
  outline: none;
  color: #f3f3f3;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  padding: 3px 65px;
  font-family: inherit;
  transition: border 0.2s;
  letter-spacing: 0.15em;
  cursor: pointer;
}

#forecastBtn:hover {
  font-weight: 350;
  transform: scale(1.01);
  box-shadow: 0 2px 8px rgba(30, 30, 40, 0.22);
  background: linear-gradient(90deg, #23272b 0%, #2c313a 100%);
}

#forecastBtn.active {
  font-weight: 350;
  background: #f3f3f3;
  color: #23272b;
  border: none;
  cursor: default !important;
}

#forecastBtn.active:hover {
  background: #f3f3f3;
  color: #23272b;
  transform: none;
  cursor: default !important;
}

.mini-play-btn,
.mini-play-btn * {
  cursor: pointer !important;
}

.mini-play-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(90deg, #313743 0%, #444b5a 100%);
  color: #e0e0e0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3em;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(30, 30, 40, 0.18),
              0 0 0 1px rgba(255, 255, 255, 0.1),
              0 0 0 2px rgba(255, 255, 255, 0.05),
              0 0 0 3px rgba(255, 255, 255, 0.02);
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  margin-right: 4px;
  outline: none;
}
.mini-play-btn:hover {
  background: linear-gradient(90deg, #23272b 0%, #2c313a 100%);
  color: #fff;
  transform: scale(1.07);
  box-shadow: 0 1px 4px rgba(30, 30, 40, 0.18),
              0 0 0 1px rgba(255, 255, 255, 0.2),
              0 0 0 2px rgba(255, 255, 255, 0.1),
              0 0 0 3px rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.mini-play-btn:active {
  background: #23272b;
  color: #fff;
  box-shadow: 0 1px 4px rgba(30, 30, 40, 0.18),
              0 0 0 1px rgba(255, 255, 255, 0.1),
              0 0 0 2px rgba(255, 255, 255, 0.05),
              0 0 0 3px rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

#dateSelect::placeholder {
  color: #fff !important;
  opacity: 1;
}

#companyChecklist {
  margin-top: 0;
  margin-left: 20px;
  max-height: 60vh;
  overflow-y: hidden;
  margin-bottom: -5px;
  max-width: 100%;
}

#companyForm {
  margin-bottom: 3px;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}

.company-entry {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 7px;
  min-width: 0;
  padding-right: 2px;
  margin-top: 5px;
  width: 100%;
  box-sizing: border-box;
}

.company-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
}

#companyForm div {
  margin-bottom: 0;
  min-width: 0;
  padding-right: 0;
}

#companyForm label {
  margin-left: 7px;
  font-size: 0.9em;
  color: #e0e6ed;
  cursor: pointer;
}

#companyForm input[type="checkbox"] {
  accent-color: inherit;
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  margin-right: 6px;
}

#companyBtnRow {
  display: flex;
  margin-top: 10px;
  margin-bottom: 6px;
  padding: 5px 0px 5px 5px;
}

#selectAllBtn, #removeAllBtn {
  min-width: 99.5px;
  font-size: 1em;
  border-radius: 10px;
  color: #fff;
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
  font-weight: 350;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 10px 0;
  margin-left: 9px;
  margin-bottom: 3px;
}

#selectAllBtn:hover, #removeAllBtn:hover {
  color: #fff;
}

.glassy-btn {
  color: #e0e6ed;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 3px rgba(255, 255, 255, 0.4),
  0 0 7px rgba(86, 141, 209, 0.3),
  0 0 11px rgba(86, 141, 209, 0.2);
  border-radius: 10px;
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
  font-size: 1.1em;
  font-weight: 350;
  letter-spacing: 0.12em;
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  cursor: pointer;
  padding: 10px 0;
  opacity: 0.92;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.glassy-btn:hover {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow:     0 0 2px rgba(255, 255, 255, 0.6),
  0 0 3px rgba(255, 255, 255, 0.4),
  0 0 7px rgba(86, 141, 209, 0.3),
  0 0 11px rgba(86, 141, 209, 0.2),
  inset 0 0 15px rgba(86, 141, 209, 0.6);
  border-radius: 8px;
  opacity: 1;
}

.pika-single .is-selected .pika-button:hover,
.pika-single .is-selected .pika-button {
  background: #fff !important;
  color: #568dd1 !important;
  border-radius: 8px !important;
}

.hour-status-dot {
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 0.15em;
  vertical-align: middle;
  box-shadow: 0 0 8px 2px currentColor;
  margin-top: 0.18em;
}
.hour-status-dot.forecast {
  color: #ff3333;
  filter: drop-shadow(0 0 8px #ff3333cc);
  /* animation: blink-forecast 1s steps(2, start) infinite; */
  /* No animation, JS will control opacity. */
}
.hour-status-dot.historical {
  color: #0088ff;
  box-shadow: 0 0 12px 4px #0088ff, 0 0 24px 8px #0088ff66;
  animation: none;
}

#hourSlider:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#hourStatusIcon {
  position: absolute;
  right: 0.1em;
  top: 50%;
  transform: translateY(-60%);
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0;
  margin-left: -7px;
  margin-top: -1.5px;
}

.latency-bar-container {
  width: 180px;
  height: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 3px;
  margin-bottom: 20px;
  margin-left: 28px;
  min-width: 0;
}
.latency-bar-bg {
  width: 100%;
  max-width: 100%;
  height: 100%;
  /* background: rgba(255,255,255,0.3); */
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  border-radius: 3px;
  overflow: hidden;
  margin-right: 5px;
  position: relative;
}
.latency-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2dc937, #e7b416, #cc3232);
  transition: width 0.2s cubic-bezier(.4,0,.2,1);
  border-radius: 3px;
}
.latency-bar-label {
  position: static;
  font-size: 0.75em;
  color: #f3f3f3;
  font-weight: 150;
  letter-spacing: 0.01em;
  white-space: nowrap;
  margin-left: 5px;
}

/* Histogram Styles */
.histogram-container {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 14px rgba(86, 141, 209, 0.3),
              0 0 28px rgba(86, 141, 209, 0.2),
              inset 0 0 30px rgba(86, 141, 209, 0.7);
  border-radius: 16px;
  padding: 15px;
  width: 300px;
  min-height: 150px;
  color: white;
  font-family: 'Manrope', sans-serif;
  z-index: 1000;
  display: none; /* Hidden by default */
}

.histogram-title {
  font-size: 16px;
  font-weight: 150;
  margin-bottom: 2px;
  text-align: center;
  color: #f3f3f3;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.histogram-bars {
  display: flex;
  gap: 4px;
  height: 100px;
  align-items: end;
  position: relative;
  margin-bottom: 8px;
}

.histogram-bar {
  flex: 1;
  background: linear-gradient(to top, #2dc937, #e7b416, #cc3232);
  border-radius: 1px 1px 0 0;
  position: relative;
  min-height: 2px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.histogram-bar:hover {
  opacity: 0.8;
}

.histogram-bar.current-hour {
  box-shadow:     0 0 1px rgba(255, 255, 255, 0.6),
  0 0 3px rgba(255, 255, 255, 0.4),
  0 0 6px rgba(86, 141, 209, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.65);
}

/* Playing state styles for histogram */
.histogram-container.playing .histogram-bar {
  cursor: default;
  opacity: 0.8;
  filter: brightness(0.7);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.histogram-container:not(.playing) .histogram-bar {
  cursor: pointer;
  opacity: 1;
  filter: brightness(1);
}

.histogram-container:not(.playing) .histogram-bar:hover {
  transform: scaleY(1.05);
  box-shadow: 0 0 8px rgba(86, 141, 209, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.histogram-labels {
  position: relative;
  height: 20px;
  font-size: 10px;
  color: #ccc;
}

.trading-start-line,
.trading-end-line {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  border-radius: 1px;
}

.trading-start-line {
  left: 37.5%; /* 9:30 AM EDT = 13:30 UTC = 9/24 = 37.5% */
}

.trading-end-line {
  left: 83.33%; /* 4:00 PM EDT = 20:00 UTC = 20/24 = 83.33% */
}

.trading-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #999;
  white-space: nowrap;
}

/* Forecast Histogram Styles */
.forecast_histogram-container {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 14px rgba(86, 141, 209, 0.3),
              0 0 28px rgba(86, 141, 209, 0.2),
              inset 0 0 30px rgba(86, 141, 209, 0.7);
  border-radius: 16px;
  padding: 15px;
  width: 225px;
  min-height: 150px;
  color: white;
  font-family: 'Manrope', sans-serif;
  z-index: 1000;
  display: block; /* Hidden by default */
}

.forecast_histogram-title {
  font-size: 16px;
  font-weight: 150;
  margin-bottom: 2px;
  text-align: center;
  color: #f3f3f3;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

.forecast_histogram-bars {
  display: flex;
  gap: 4px;
  height: 100px;
  align-items: end;
  position: relative;
  margin-bottom: 8px;
}

.forecast_histogram-bar {
  flex: 1;
  background: linear-gradient(to top, #2dc937, #e7b416, #cc3232);
  border-radius: 1px 1px 0 0;
  position: relative;
  min-height: 2px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.forecast_histogram-bar:hover {
  opacity: 0.8;
}

.forecast_histogram-bar.current-hour {
  box-shadow:     0 0 1px rgba(255, 255, 255, 0.4),
  0 0 3px rgba(255, 255, 255, 0.35),
  0 0 6px rgba(86, 141, 209, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

/* Playing state styles for forecast histogram */
.forecast_histogram-container.playing .forecast_histogram-bar {
  cursor: default;
  opacity: 0.8;
  filter: brightness(0.7);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.forecast_histogram-container:not(.playing) .forecast_histogram-bar {
  cursor: pointer;
  opacity: 1;
  filter: brightness(1);
}

.forecast_histogram-container:not(.playing) .forecast_histogram-bar:hover {
  transform: scaleY(1.05);
  box-shadow: 0 0 8px rgba(86, 141, 209, 0.6);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.forecast_histogram-labels {
  position: relative;
  height: 20px;
  font-size: 10px;
  color: #ccc;
}

.forecast_trading-start-line,
.forecast_trading-end-line {
  position: absolute;
  top: 0;
  width: 2px;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 10;
  border-radius: 1px;
  display: none; /* Hide the vertical lines */
}

.forecast_trading-start-line {
  left: 37.5%; /* 9:30 AM EDT = 13:30 UTC = 9/24 = 37.5% */
}

.forecast_trading-end-line {
  left: 83.33%; /* 4:00 PM EDT = 20:00 UTC = 20/24 = 83.33% */
}

.forecast_trading-label {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: #999;
  white-space: nowrap;
  content: "18 Hour Forecast from Local Time."; /* Placeholder text */
}

.forecast_histogram-tooltip {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  white-space: nowrap;
  min-width: 80px;
}

.histogram-tooltip {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
  white-space: nowrap;
  min-width: 80px;
}

/* Basemap Selector Styles */
#basemapSelector {
  position: absolute;
  top: 215px;
  right: 10px;
  width: 88px;
  z-index: 1100;
}

.basemap-select {
  width: 100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  color: #f3f3f3;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 16px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: 'Manrope', sans-serif;
  outline: none;
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 3px rgba(255, 255, 255, 0.4),
              0 0 7px rgba(86, 141, 209, 0.3),
              0 0 11px rgba(86, 141, 209, 0.2),
              inset 0 0 15px rgba(86, 141, 209, 0.6);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  text-align: center;
  padding-right: 20px; /* Make room for chevron */
  padding-left: 10px;
}

.basemap-select:focus,
.basemap-select:hover {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  color: #fff;
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 3px rgba(255, 255, 255, 0.4),
              0 0 7px rgba(86, 141, 209, 0.3),
              0 0 11px rgba(86, 141, 209, 0.2),
              inset 0 0 15px rgba(86, 141, 209, 0.6);
}

/* Add chevron after the select */
#basemapSelector::after {
  content: '▼';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #f3f3f3;
  font-size: 8px;
  pointer-events: none;
  transition: color 0.2s;
}

#basemapSelector:hover::after {
  color: #fff;
}

/* Welcome Popup Styles */
.welcome-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(4px);
}

/* HFT Title - No underline */
.hft-title-gradient {
  position: relative;
  display: inline-block;
}

/* Custom timing for smoother keyframe transitions */
.hft-title-gradient::before {
  animation: pulse-move 2s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

.welcome-popup.show {
  display: flex;
}

.welcome-popup-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 14px rgba(86, 141, 209, 0.3),
              0 0 28px rgba(86, 141, 209, 0.2),
              inset 0 0 30px rgba(86, 141, 209, 0.7);
  border-radius: 16px;
  padding: 0;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.welcome-popup-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  padding: 20px 25px 15px 25px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.welcome-popup-header h2 {
  color: #f3f3f3;
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
  text-shadow: 0 0 3px #568dd1,
               0 0 6px #568dd1,
               0 0 9px #568dd1;
}

.welcome-popup-close {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #f3f3f3;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  line-height: 1;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 7px rgba(86, 141, 209, 0.3),
              0 0 11px rgba(86, 141, 209, 0.2);
}

.welcome-popup-close:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  cursor: pointer;
  transform: scale(1.1);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 4px rgba(255, 255, 255, 0.4),
              0 0 7px rgba(86, 141, 209, 0.3),
              0 0 11px rgba(86, 141, 209, 0.2),
              inset 0 0 15px rgba(86, 141, 209, 0.6);
}

.welcome-popup-body {
  padding: 25px;
  color: #f3f3f3;
  line-height: 1.6;
  font-family: 'Manrope', 'Segoe UI', Arial, sans-serif;
}

.welcome-popup-body p {
  margin: 0 0 0 0;
  font-size: 14px;
  color: #e0e6ed;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .welcome-popup-content {
    width: 95%;
    margin: 20px;
  }
  
  .welcome-popup-header {
    padding: 15px 20px 10px 20px;
  }
  
  .welcome-popup-header h2 {
    font-size: 22px;
  }
  
  .welcome-popup-body {
    padding: 20px;
  }
  
  .welcome-popup-body p {
    font-size: 13px;
  }
}

/* Hide Cesium Ion attribution */
.cesium-viewer-bottom {
  display: none !important;
}

/* Alternative selectors if the above doesn't work */
.cesium-viewer-bottom,
.cesium-viewer-cesium-ion,
.cesium-viewer-attribution {
  display: none !important;
}

/* Help Button */
.help-button {
  position: fixed;
  bottom: 10px;
  left: 10px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.6),
              0 0 3px rgba(255, 255, 255, 0.4),
              0 0 7px rgba(86, 141, 209, 0.3),
              0 0 11px rgba(86, 141, 209, 0.2),
              inset 0 0 15px rgba(86, 141, 209, 0.6); /* persistent blue inner glow */
  transition: background 0.2s, color 0.2s, border 0.2s, box-shadow 0.2s;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

/* Keep container glow constant; only text glows on hover */
.help-button:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0, 0, 0, 0.12) 100%);
  backdrop-filter: blur(12px) saturate(1);
  -webkit-backdrop-filter: blur(12px) saturate(1);
  border: 1px solid rgba(255, 255, 255, 0.45);
  opacity: 1;
}

.help-icon {
  color: #e0e6ed;
  font-size: 22px;
  font-weight: 600;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

/* Match hour text glow style on hover */
.help-button:hover .help-icon {
  color: #fff;
  text-shadow:
    0 0 3px #568dd1,
    0 0 6px #568dd1,
    0 0 9px #568dd1;
}