/* =============================================================
   FRC Contesting Dashboard — Central Stylesheet
   static/css/style.css
   ============================================================= */


/* -------------------------------------------------------------
   1. BASE RESET (all templates)
   ------------------------------------------------------------- */

html, body {
  margin: 0;
  padding: 0;
  font-family: courier;
}


/* -------------------------------------------------------------
   2. SCROLLBAR — neon blue (both.html only)
   ------------------------------------------------------------- */

/* both.html adds width/height/background/overflow/scroll to html,body */
.scroll-page {
  width: 100%;
  height: 100%;
  background: #ffffff;
  overflow-y: scroll;
  scroll-behavior: smooth;
}

/* Slim neon blue scrollbar (WebKit) */
::-webkit-scrollbar {
  width: 15px;
}

::-webkit-scrollbar-track {
  background: #0b0b0b;
}

::-webkit-scrollbar-thumb {
  background: #00aaff;
  border-radius: 10px;
  box-shadow: 0 0 8px #00aaff;
}

::-webkit-scrollbar-thumb:hover {
  background: #33ccff;
  box-shadow: 0 0 12px #33ccff;
}

/* Firefox scrollbar */
html {
  scrollbar-width: thin;
  scrollbar-color: #00aaff #0b0b0b;
}


/* -------------------------------------------------------------
   3. LAYOUT UTILITIES (both.html)
   ------------------------------------------------------------- */

.fullFrame {
  width: 100%;
  height: 100vh;
  border: none;
  display: block;
}

#divider {
  width: 100%;
  height: 15px;
  background: black;
}


/* -------------------------------------------------------------
   4. MAP LAYOUT (index_ft.html, index_wcount.html)
   ------------------------------------------------------------- */

.map-page {
  height: 100%;
  width: 100%;
}

#map {
  height: calc(100% - 130px);
  background-color: #a8d5e8; /* ocean blue for offline basemap */
}

#spots {
  width: 45px;
}

#lastInterval {
  width: 45px;
}


/* -------------------------------------------------------------
   5. LEAFLET WIDGETS (index_ft.html, index_wcount.html)
   ------------------------------------------------------------- */

.info-box {
  background: white;
  padding: 8px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  font-size: 14px;
}

.leaflet-bottom.leaflet-right .spot-counter {
  background: white;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 5px;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
  font-family: courier;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.4;
}

.cq-zone-label {
  color: rgb(66, 53, 53);
  font-size: 20px;
  text-shadow: 1px 1px 2px white;
  pointer-events: none;
}

.itu-zone-label {
  color: rgb(53, 53, 100);
  font-size: 20px;
  text-shadow: 1px 1px 2px white;
  pointer-events: none;
}


/* -------------------------------------------------------------
   6. CONNECTION STATUS (index_ft.html, table_ft.html)
   ------------------------------------------------------------- */

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 4px;
}

.status-checking     { background: #f0a500; }
.status-connected    { background: #22c55e; }
.status-dberror      { background: #f97316; }
.status-disconnected { background: #ef4444; }


/* -------------------------------------------------------------
   7. PAGE HEADER UTILITIES (index_ft.html, table_ft.html)
   ------------------------------------------------------------- */

.page-title {
  text-align: center;
}

.status-bar {
  text-align: center;
  font-size: 13px;
  margin: 2px 0 6px 0;
  font-family: courier;
}

.controls-center {
  text-align: center;
  margin-bottom: 10px;
}


/* -------------------------------------------------------------
   8. TABLE STYLES (table_ft.html)
   ------------------------------------------------------------- */

#controls {
  text-align: center;
  margin: 10px;
}

table {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 14px;
  table-layout: fixed;
  width: 1000px;
}

th, td {
  border: 1px solid #000;
  text-align: center;
  padding: 6px 8px;
  width: 60px;
  height: 28px;
}

.band-header   { background-color: #1f497d; color: white; font-weight: bold; }
.region-header { background-color: #f2a900; font-weight: bold; }
.value         { background-color: #4caf50; color: white; font-weight: bold; }


/* -------------------------------------------------------------
   9. TABLE UTILITY CLASSES (table_ft.html)
   ------------------------------------------------------------- */

.narrow-input {
  width: 60px;
}

.total-display {
  text-align: center;
  margin-top: 10px;
  font-size: 18px;
  font-weight: bold;
}

.spots-table-container {
  margin-top: 20px;
}


/* -------------------------------------------------------------
   10. HAMBURGER NAV — button + slide-out panel (all pages)
   ------------------------------------------------------------- */

#hamburger-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #00aaff;
  color: #00aaff;
  font-size: 20px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  padding: 0;
}

#hamburger-btn:hover {
  background: rgba(0, 170, 255, 0.15);
}

#nav-panel {
  position: fixed;
  top: 0;
  left: -220px;
  width: 200px;
  height: 100%;
  background: #0b0b0b;
  border-right: 1px solid #00aaff;
  z-index: 9998;
  transition: left 0.25s ease;
  padding-top: 60px;
  box-sizing: border-box;
}

#nav-panel.open {
  left: 0;
}

#nav-panel a {
  display: block;
  padding: 14px 20px;
  color: #00aaff;
  text-decoration: none;
  font-family: courier;
  font-size: 16px;
  border-bottom: 1px solid #1a1a1a;
}

#nav-panel a:hover {
  background: #1a1a1a;
}

#nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9997;
}

#nav-overlay.open {
  display: block;
}


/* -------------------------------------------------------------
   11. PREDICTION PAGE
   ------------------------------------------------------------- */

.pred-page {
  font-family: courier;
  padding: 20px 40px;
}

.pred-page h1 {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 30px;
}

.pred-tabs {
  display: flex;
  justify-content: center;
  border-bottom: 2px solid #00aaff;
  margin-top: 60px;
  margin-bottom: 0;
}

.pred-tab-btn {
  padding: 10px 24px;
  cursor: pointer;
  font-family: courier;
  font-size: 15px;
  color: #000;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.pred-tab-btn.active {
  color: #00aaff;
  border-bottom-color: #00aaff;
}

.pred-tab-btn:hover {
  color: #00aaff;
}


/* -------------------------------------------------------------
   12. PREDICTION FORM (prediction_p2p.html)
   ------------------------------------------------------------- */

.pred-form {
  max-width: 860px;
  margin: 30px auto 0 auto;
  font-family: courier;
  font-size: 14px;
}

.pred-form h2 {
  font-size: 15px;
  color: #00aaff;
  border-bottom: 1px solid #00aaff;
  padding-bottom: 4px;
  margin: 22px 0 10px 0;
}

.pred-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 30px;
}

.pred-form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px 30px;
}

.pred-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pred-field label {
  font-size: 12px;
  color: #000;
}

.pred-field input,
.pred-field select {
  font-family: courier;
  font-size: 14px;
  padding: 5px 7px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  color: #000;
}

.pred-field input:focus,
.pred-field select:focus {
  outline: none;
  border-color: #00aaff;
}

/* Frequency toggle buttons */
.freq-toggle-group {
  display: flex;
  gap: 8px;
  margin: 10px 0 6px 0;
}

.freq-toggle-btn {
  padding: 6px 16px;
  font-family: courier;
  font-size: 13px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  color: #333;
}

.freq-toggle-btn.active {
  border-color: #00aaff;
  color: #00aaff;
  background: rgba(0, 170, 255, 0.07);
}

.freq-toggle-btn:hover {
  border-color: #00aaff;
  color: #00aaff;
}

/* Contest band labels */
.contest-band-labels {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.contest-band-labels.visible {
  display: flex;
}

.band-label {
  padding: 3px 10px;
  border: 1px solid #00aaff;
  border-radius: 12px;
  font-size: 12px;
  color: #00aaff;
  background: rgba(0, 170, 255, 0.07);
  cursor: pointer;
}

.band-label.inactive {
  border-color: #aaa;
  color: #aaa;
  background: transparent;
}

/* Output options checklist */
.output-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 6px;
}

.output-checklist label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
}

/* Error display */
.pred-error {
  display: none;
  color: #ef4444;
  font-size: 13px;
  margin: 10px 0 4px 0;
}

.pred-error.visible {
  display: block;
}

/* Run button */
.run-btn {
  margin-top: 16px;
  padding: 9px 28px;
  font-family: courier;
  font-size: 15px;
  background: #fff;
  border: 1px solid #00aaff;
  color: #00aaff;
  border-radius: 4px;
  cursor: pointer;
}

.run-btn:hover {
  background: rgba(0, 170, 255, 0.1);
}

.run-btn.loading {
  background: #f0a500;
  border-color: #f0a500;
  color: #fff;
  cursor: not-allowed;
}

/* Results area */
.pred-results {
  margin-top: 30px;
  margin-bottom: 40px;
}

.pred-results pre {
  background: #d8d8d8;
  color: #1a1a1a;
  font-family: courier;
  font-size: 13px;
  padding: 16px;
  border-radius: 4px;
  border: 1px solid #bbb;
  overflow-x: auto;
  max-height: 520px;
  overflow-y: auto;
  white-space: pre;
}

.results-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

/* =================== Section 13: Prediction Page Map Row =================== */
.pred-map-row {
  display: flex;
  gap: 20px;
  margin: 20px 0 30px 0;
}

#pred-map {
  flex: 1;
  height: 360px;
  background-color: #a8d5e8;
  border: 1px solid #333;
  border-radius: 4px;
}

.pred-coming-soon {
  flex: 1;
  height: 360px;
  background: #111;
  border: 1px solid #333;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #444;
  font-size: 18px;
  letter-spacing: 0.1em;
}

.pred-map-legend {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 10px;
  font-family: courier;
  font-size: 12px;
  color: #ccc;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.pred-map-legend .legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}

.legend-dot.tx-dot { background: #ef4444; }
.legend-dot.rx-dot { background: #3b82f6; }

/* =================== Section 13b: Area Map =================== */
#area-map-row {
  display: flex;
  gap: 12px;
  margin: 20px 0 30px 0;
}

.area-info-box {
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 5px 10px;
  font-family: courier;
  font-size: 12px;
  color: #fff;
  pointer-events: none;
  min-width: 110px;
  white-space: nowrap;
}

#area-map {
  flex: 1;
  height: 500px;
  background-color: #a8d5e8;
  border: 1px solid #333;
  border-radius: 4px;
}

#area-legend-wrapper {
  display: none;        /* shown by JS after first prediction */
  flex-shrink: 0;
  align-self: center;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px 8px;
}

/* =================== Section 14: BCR/MUF Chart Panel =================== */
.pred-chart-canvas {
  flex: 1;
  height: 360px;
  background: #d8d8d8;
  border: 1px solid #bbb;
  border-radius: 4px;
  display: block;
}

@media (max-width: 900px) {
  .pred-map-row {
    flex-direction: column;
  }
  #pred-map,
  .pred-chart-canvas {
    flex: none;
    width: 100%;
    height: 300px;
  }
}

.pred-chart-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin: 8px 0 6px 0;
}

.pred-muf-toggle,
.pred-metric-toggle {
  display: flex;
  gap: 12px;
}

.muf-toggle-btn {
  padding: 5px 20px;
  font-family: courier;
  font-size: 13px;
  border: 1px solid #333;
  border-radius: 3px;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.muf-toggle-btn.active {
  border-color: #00aaff;
  color: #00aaff;
  background: rgba(0, 170, 255, 0.07);
}

.muf-toggle-btn:hover {
  border-color: #00aaff;
  color: #00aaff;
}


/* =================== Section 15: Area Chart Controls =================== */
.area-chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 10px 0;
  flex-wrap: wrap;
  gap: 10px;
}

.area-time-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-arrow-btn {
  padding: 5px 14px;
  font-family: courier;
  font-size: 15px;
  border: 1px solid #555;
  border-radius: 3px;
  background: #fff;
  color: #555;
  cursor: pointer;
}

.time-arrow-btn:hover {
  border-color: #00aaff;
  color: #00aaff;
}

#area-hour-display {
  font-family: courier;
  font-size: 13px;
  min-width: 58px;
  text-align: center;
  color: #333;
}

.area-overlay-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.area-overlay-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: courier;
  font-size: 12px;
  color: #555;
}

.area-overlay-field input[type="number"] {
  font-family: courier;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 60px;
}

.area-overlay-field select {
  font-family: courier;
  font-size: 13px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.area-overlay-field input:focus,
.area-overlay-field select:focus {
  outline: none;
  border-color: #00aaff;
}

