:root{
  --accent:#02A0FF;
  --text:#e6eef9;
  --muted:#9fb3d1;
  --btn:#1f2a4a;
  --btn-hover:#28345a;
  --input-border:rgba(255,255,255,.3);
}

*{
  box-sizing:border-box;
}

body{
  min-height: 100vh;
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: linear-gradient(180deg, #140027 0%, #1f003e 10%, #1f2d5a 50%, #1b4c3c 100%);
  color:var(--text);
  padding-bottom: 70px;
  scroll-behavior: auto;
  overscroll-behavior: none;
}
/* do not underline <a> */
a{
    color:var(--accent);
    text-decoration: none;
}
a:hover{
    text-decoration: none;
}
.header{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 30px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg, rgba(0,0,0,.2), rgba(0,0,0,0));
  position:sticky;top:0;backdrop-filter: blur(6px);
  z-index: 10;
}
.header h1{
  font-size:24px;
  margin:0;
  color:var(--text);
  letter-spacing:.3px;
  text-align: center;
}
.brand{display:flex;align-items:center;gap:12px}
.nav{
  display:flex;
  gap:10px;
  align-items:center;
  justify-self: end;
}
.nav-panel {
  text-align: center;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgb(30, 30, 30);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 8px 10px;
  z-index: 10;
}

.image-nav a {
  position: absolute; 
  top: 50%; 
  transform: translate(-50%, -50%);
}

.image-nav img {
  height: 30px;
  width:  30px;
  filter: invert(1);
}
/* used for home, info, settings pages */
.container{
  max-width:980px;
  margin:28px auto;
  padding:0 16px;
  width: 100%;
  overflow-x: hidden;
}

/* Ensure the first location button has enough top spacing to clear the sticky header */
#locationBox {
  margin-top: 2px;
}
.container::-webkit-scrollbar{
  display: none;
  width:0px;
}

.panel{
  background:linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.05));
  border:1px solid rgba(255,255,255,.08); border-radius:16px;
  padding:18px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  margin-bottom: 18px;
  transition: transform 0s ease-in-out, box-shadow 0s ease-in-out;
}

/* Modal-specific panel that overrides transparent background */
.panel.modal-panel {
  background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
  border: 1px solid #444;
}

/* === KV GRID STYLES === */
.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;/*repeat(auto-fit, minmax(180px, 2fr));*/
  gap: 3px;
  margin-bottom: 3px;
}
.kv-item {
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  padding: 6px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  height: 100%;
  transition: transform 0s ease-in-out, box-shadow 0s ease-in-out, border-color 0s ease-in-out;
}
.kv-item strong {
  display: block;
  color: var(--accent);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1px;
}

.kv-item span {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.v-item {
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  padding: 6px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  height: 100%;
  transition: transform 0s ease-in-out, box-shadow 0s ease-in-out, border-color 0s ease-in-out;
  display: flex;
  flex-direction: column;   /* stack children vertically */
  gap: 4px;                 /* optional spacing between lines */
  align-items: center;
  margin-bottom: 4px; /* add 4px gap under v-item */
}
.v-item .location-icon {
  height: 12px;
  width: 12px;
  vertical-align: text-top;
  transform: translateY(-6px);
  margin-left: 2px;
  filter: invert(48%) sepia(93%) saturate(1915%) hue-rotate(171deg) brightness(102%) contrast(102%);
  display: none; /* Hidden by default */
}
.v-item .location-icon.visible {
  display: inline-block;
}
/* Invisible placeholder to maintain alignment of text */
#location-icon2 {
  display: inline-block;    /* allow width to take effect */
  width: 12px;              /* adjustable horizontal size */
  height: 1px;              /* minimal height so it doesn't affect line-height */
  visibility: hidden;       /* invisible but still occupies layout space */
}
/* location name */
.v-item .large{
  font-size: 30px;
  font-weight: 500;
  color: var(--accent); /* lime; */
}
/* distance and time */
.v-item .small {
  font-size: 16px;
  color: var(--text);
}

/* UNIFIED HOVER EFFECT */
.kv-item-link:hover .kv-item,
.v-item:hover,
a.section-header-link:hover .section-header-container {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 12px 35px rgba(0,0,0,.4);
}

/* === LINK WRAPPER STYLES === */
a.section-header-link {
  text-decoration: none;
  display: block;
  color: inherit;
  cursor: pointer;
}

/* === SECTION HEADER STYLES === */
.multiline{
  white-space: pre-line;
}

.section-header-container {
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.05));
  border: 1px solid rgba(255,255,255,.08);
  padding: 6px 6px;
  border-radius: 16px 16px 0 0;
  margin: -2px -2px 8px;
  transition: all 0s ease-in-out;
}
.section-header-container h3 {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent); /* #4c6995; */
  margin: 0;
}
/* =============================== */
.wrap{
  border-radius:16px;
  border:2px solid rgba(255,255,255,.08);
  margin: 16px 0 8px;
}

.imgwrap{
  position: relative;  
}
.imgwrap img{
  display:block;
  width:100%;
  height:auto;
  cursor:pointer;
}

.image-container {
  overflow: hidden;
  position: relative; /* All children will be positioned relative to this */
  display: block;
  width: 100%;
  height: auto;
}

.base-image { /* for the map */
  /* margin-top: -50px; Trying to crop off the top of the image. */
  display: block;
  width: 100%;
  height: auto;
  z-index: 1;
}

.overlay-image { /* for the marker */
  position: absolute;
  height: 10px; /* size of marker image */
  width: 10px;
  z-index: 2;   /* Make sure the overlay is on top */
  transform: translate(-50%, -50%); /* Add this line */
}

.iframe-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 800 / 1000;
  margin-bottom: 12px;
}

.iframe-help {
  position: absolute;
  left: 95%; 
  height: 5%; 
  width: 5%;
  filter: invert(1);
  z-index: 5;  /* above the iframe */
}

iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  border: none;
  width: 850px;
  height: 1100px;
  transform: translate(-50%, -50%) scale(var(--scale-factor, 1));
}

.formgrid{display:grid;gap:12px}
.formgrid label{font-size:12px;color:var(--muted);display:block;margin-bottom:6px}
.input, select, .seg{
  width:100%;
  background:rgba(255,255,255,.0);
  border:1px solid rgba(255,255,255,.0);
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  outline:none;
}
#fixed-loc-search, #fixed-loc-search-settings {
  font-size: 18px;
}
#fixed-loc-search-settings.active {
  border-color: var(--accent);
  background: var(--btn);
}

.formgrid .row {
  align-items: center;   /* vertical alignment of title + controls */
  gap: 3px;             /* horizontal spacing between items */
}

/* ensure consistent vertical spacing between rows in the Settings page
   so titles like "Distance Units" line up with spacing in the Alert Settings panel */
#settings-page .formgrid > .row {
  margin-top: 12px; /* adjust value to match the Alert Settings spacing */
}
/* avoid adding extra gap before the very first row */
#settings-page .formgrid > .row:first-child {
  margin-top: 0;
}

.input{
  border: 1px solid var(--input-border);
}

.input::placeholder{color:#c7d3ea80}
.input:disabled, .input[readonly] {
  background: rgba(0,0,0,.1); 
  color: var(--muted); 
  opacity: 0.7; 
}
.row{
  display:grid;
  grid-template-columns:1fr;
  gap:12px
}
@media (max-width:720px){ .row{grid-template-columns:1fr} }
.seg{
  display:flex;
  gap:8px;
  padding:0px
}
.seg input{
  display:none
}
.seg label{
  flex:1;
  padding:10px 12px;
  border-radius:8px;
  text-align:center;
  border:1px solid var(--input-border);
  cursor:pointer;
}
.seg input:checked + label{
  background:var(--btn-hover);
  border-color:var(--accent)
}

.small{
  font-size:12px;
  color:var(--muted)
}

.top-nav-icon-btn {
  background: rgba(30, 30, 30, 0);
  border: none;
  padding: 4px;
  line-height: 0;
  cursor: pointer;
  border-radius: 50%;
}
.top-nav-icon-btn img.nav-icon {
  height: 40px;
  width: 40px;
  margin: 0;
  vertical-align: middle;
  opacity: 0.8;
  transition: opacity 0s ease;
  filter: invert(1);
}

.top-nav-icon-btn:hover img.nav-icon {
  opacity: 1.0;
}

.icon-in-text {
  height:16px; 
  vertical-align: middle;
  filter: invert(1);
}

/* Keep marker  icon in original color */
img[src*="marker.png"].icon-in-text {
  filter: none;
}
/* Keep location icon in accent color */
img[src*="location.svg"].icon-in-text {
  filter: invert(48%) sepia(93%) saturate(1915%) hue-rotate(171deg) brightness(102%) contrast(102%);
}

.disabled-feature {
  opacity: 0.5;
  color: var(--muted);
}
.disabled-feature button,
.disabled-feature .input,
.disabled-feature .seg label {
  cursor: not-allowed;
  pointer-events: none;
}
.disabled-feature .seg input:checked + label {
  background: var(--btn);
  border-color: rgba(255,255,255,.1);
}
#info-page p {
  font-size: 17px;      /* base text */
  line-height: 1.3;  /* comfortable line spacing */
  color: rgba(255, 255, 255, 0.8); /* slightly muted */
}

.panel-overlay-wrapper {
  position: relative;
}
.panel-overlay-blocker {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(20, 26, 51, 0.5);
  backdrop-filter: blur(0.25px);
  display: none;
  align-items: top;
  justify-content: center;
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
  z-index: 5;
  border-radius: 16px;
}
.alert-disabled .panel-overlay-content {
  opacity: 0.5;
  pointer-events: none;
}
.alert-disabled .panel-overlay-blocker {
  display: flex;
}

.time-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0px;
}

.time-wrapper input[type="time"] {
  padding: 10px 2px;
}

#geodgp-container {
  aspect-ratio: 18 / 16;
  padding-top: 4px;
  background: transparent;
}
#geodgp-container img {
  height: 118%;
  scale: 105%;
  object-fit: contain;
}
#home-page, #home-um, #settings-page, #info-page, #subPanel {
  scroll-margin-top: 80px;
}
[id^="faq-"] {
  scroll-margin-top: 80px;
  margin-bottom: 12px;
  color: var(--text);
}
[id^="faq-"] p {
  margin: 4px 0 0; 
  color: var(--muted);
}

/* === NEW LOCATION MODAL STYLES === */
.location-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.location-modal {
  width: 100%;
  max-width: 420px;
  background:linear-gradient(180deg, rgba(40,52,90,.9), rgba(30,39,74,.9));
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
}
/* Location button */
.location-btn {
  width: 100%;
  margin-bottom: 16px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
}
.location-btn:hover {
  background: var(--btn-hover);
}
.location-btn.active {
  border-color: var(--accent);
  background: var(--btn);
  box-shadow: 0 8px 22px rgba(2, 160, 255, 0.18);
  transform: translateY(-1px);
}

#search-results {
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
}
.result-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 14px;
}
.result-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}
.location-modal-section-title {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin: 20px 0 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

/* Keep */
#geodgp-container .polar-cover-overlay {
  position: absolute;
  top: 10.5%;
  left: 25.5%;
  width: 40%; 
  height: 80%;
  z-index: 2;
  pointer-events: none;
  cursor: default;
  scale: 2.04;
}
/* Add the arrow icon after the external link */
a[href^="http"]:not(.top-nav-icon-btn)::after {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 2px;
  vertical-align: text-top;
  background-image: url("assets/diagonalarrow.png");
  /* convert black to accent color */
  filter: invert(48%) sepia(93%) saturate(1915%) hue-rotate(171deg) brightness(90%) contrast(102%);
  background-size: contain;
  background-repeat: no-repeat;
}

#noaaImg {
  filter: brightness(0.75); /* tweak 0.0–1.0 for more/less dark */
  padding: 2%;
}

/* START: New Styles for Settings Page Location Finder */

/* Styles the search results container on the settings page */
#search-results-settings {
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
}

/* === NEW CLOUD MODAL STYLES === */
.cloud-modal-title {
  text-align: center;
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--muted);
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
  touch-action: none;
}

.chart-tooltip {
  position: absolute;
  background: rgba(40, 52, 90, 0.9);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0s ease;
  z-index: 10;
  top: -40px; /* Position above the chart */
  text-align: center;
  font-size: 14px;
}

#tooltip-value {
  font-weight: 600;
  margin-top: 4px;
}

.chart-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--accent);
  pointer-events: none;
  z-index: 9;
}

/* === TIME SLIDER STYLES === */
.time-slider-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 8px 16px 8px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 0 0 16px 16px;
  width: 100%;
}

.time-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin: 0px 0;
  padding: 5px 0px 0px 0px;
  box-sizing: border-box;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(90deg, 
    rgba(255,255,255,.1) 0%, 
    rgba(2, 160, 255, 0.3) 50%, 
    rgba(255,255,255,.1) 100%);
  outline: none;
  transition: all 0s ease;
  border: none;
}

.time-slider:hover {
  background: linear-gradient(90deg, 
    rgba(255,255,255,.3) 0%, 
    rgba(2, 160, 255, 0.7) 50%, 
    rgba(255,255,255,.3) 100%);
}

.time-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0185cc);
  cursor: pointer;
  border: 2px solid #015088;
  box-shadow: 0 2px 10px rgba(2, 160, 255, 0.3);
  transition: all 0s ease;
}

.time-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(2, 158, 255, 0.7);
}

.time-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0185cc);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 10px rgba(2, 160, 255, 0.3);
  transition: all 0s ease;
}

.time-slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(2, 160, 255, 0.7);
}

.time-slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 26px;
}

.time-slider-tick {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  opacity: 0.7;
}

#comparisonTable {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
#comparisonTable th {
  background-color: lime;
  color: black;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  border: 1px solid rgba(255,255,255,.1);
}
#comparisonTable td {
  padding: 8px;
  border: 1px solid #444;
  text-align: center;
  background-color: rgb(30, 30, 30);
}
#comparisonTable td.lime {
  background-color: rgb(0, 40, 0);
  color: lime; 
}
#comparisonTable td.yellow {
  background-color: rgb(40, 40, 0);
  color: yellow; 
}

