*,
*::before,
*::after {
  box-sizing: border-box;
}


html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

#topbar {
  position: absolute;
  top: 10px;
  left: 20%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0);
  color: #000;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  gap: 15px;
  align-items: center;
  z-index: 999;
  flex-wrap: wrap;
}
#map {
  height: 100vh;
  width: 100vw;
}
.vessel-label {
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.map-controls {
  position: absolute;
  top:10px;
  right: 15px;
  z-index: 9999 !important;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 800;
  }

  .map-controls label, .map-controls select {
  font-size: 13px;
  }
  .map-controls select {
  width: 180px;
  padding: 4px;
  }
  .view-controls {
  position: absolute;
  top:130px;
  right: 15px;
  z-index: 9999 !important;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: sans-serif;
  font-size: 14px;
  font-weight: 800;
}
#logo {
  height: 80px;
}
/* ================================
   AIS Vessel Tooltip (Dark Theme)
   ================================ */
.vessel-tooltip {
    background: transparent;
    border: none;
    box-shadow: none;
    color: #000;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 0 0 3px #fff;
}
.leaflet-tooltip.ais-tooltip {
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

/* Remove arrow background */
.leaflet-tooltip.ais-tooltip::before {
    border-top-color: rgba(0, 0, 0, 0.75) !important;
}

/* Unknown vessel style (optional visual cue) */
.leaflet-tooltip.ais-tooltip.unknown {
    color: #ffcc66 !important;
    font-style: italic;
}
/* ---- Leaflet tooltip fix ---- */
.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.85) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4) !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 500;
    white-space: nowrap;
}

/* Tooltip arrow color */
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
    border-color: rgba(0, 0, 0, 0.85) !important;
}
/* Shift the zoom controls down to avoid the topbar */
.leaflet-top.leaflet-left {
    margin-top: 100px !important;
}

/* --- View Controls (Race / Trails / Stats) --- */
  .view-controls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    left: auto;
    top: auto;

    font-size: 12px;
    padding: 6px;
    gap: 6px;
  }

  /* --- Replay Controls --- */
  #replayControls {
    position: fixed;
    bottom: 60px;
    left: 10px;
    right: 10px;

    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 6px;

    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  #replayControls input,
  #replayControls select,
  #replayControls button {
    font-size: 12px;
    padding: 4px 6px;
  }

  /* --- Tooltips --- */
  .leaflet-tooltip {
    font-size: 11px !important;
    padding: 3px 6px !important;
  }

  /* --- Stats text --- */
  #stats {
    font-size: 11px;
  }


#boatTableContainer {
  max-height: 50vh;
  overflow-y: auto;
  background: #0b1c2d;
  border-top: 1px solid #1f3b57;
}

#boatTable {
  margin-left: auto;
  margin-right: auto;
  width: 90%;
  border-collapse: collapse;
  font-size: 12px;
  color: #e0e6ed;
}

#boatTable thead {
  position: sticky;
  top: 0;
  background: #12263a;
  z-index: 2;
}

#boatTable th,
#boatTable td {
  padding: 6px 8px;
  border-bottom: 1px solid #1f3b57;
  text-align: center;
  background: #12263a;
}

#boatTable tr:hover {
  background: #1f3b57;
  cursor: pointer;
}

.boat-live {
  color: #4caf50;
  font-weight: bold;
}

.boat-stale {
  color: #ff9800;
}

  /* ---Scroll down button --- */

#scrollDownBtn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(20, 40, 70, 0.9);
  color: #ffffff;
  border: none;
  font-size: 26px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

#scrollDownBtn:hover {
  background: rgba(40, 90, 160, 0.95);
  transform: scale(1.05);
}

@media (max-width: 768px) {
  #scrollDownBtn {
    width: 44px;
    height: 44px;
    font-size: 24px;
    bottom: 12px;
    right: 12px;
  }
}


#replayTableWrapper {
  max-height: 50vh;
  overflow-y: auto;
  background: #0b1c2d;
  border-top: 1px solid #1f3b57;
}

#replayTable {
  margin-left: auto;
  margin-right: auto;
  width: 90%;
  border-collapse: collapse;
  font-size: 12px;
  color: #e0e6ed;
}

#replayTable thead {
  position: sticky;
  top: 0;
  background: #12263a;
  z-index: 2;
}

#replayTable th,
#replayTable td {
  padding: 6px 8px;
  border-bottom: 1px solid #1f3b57;
  text-align: center;
}

#replayTable tr:hover {
  background: #1f3b57;
  cursor: pointer;
}
#Heading{
    font-family: sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #e0e6ed;
}
/* =========================
   Replay Selector Table FIX
========================= */

.replay-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff;
  color: #000000;
}

.replay-table th {
  background-color: #f0f0f0;
  color: #000000;
  padding: 8px;
  border: 1px solid #ccc;
  text-align: left;
}

.replay-table td {
  background-color: #ffffff;
  color: #000000;
  padding: 6px;
  border: 1px solid #ccc;
}

/* Zebra rows */
.replay-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Hover highlight */
.replay-table tbody tr:hover {
  background-color: #e6f2ff;
}

/* Checkbox alignment */
.replay-table input[type="checkbox"] {
  transform: scale(1.1);
}
