/* =========================
   COLORS & BRANDING
   ========================= */
.bg-blue-primary {
  background: linear-gradient(300deg, #134983 0%, #3b6ea5 100%) !important;
}
.text-blue-primary {
  color: #134983;
}
.icon-blue {
  color: rgb(2, 47, 92, 1);
}
.bg-secondary {
  background: #3b6ea5 !important;
  color: #fff !important;
}

/* =========================
   NAVBAR
   ========================= */
.navbar {
  background: #134983 !important;
}
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .nav-link:visited,
.navbar .nav-link:active {
  color: #ebeffd !important;
}
.navbar .nav-link:hover {
  color: #56c1f7 !important;
}
.navbar .bi {
  color: #ffffff !important;
}

/* =========================
   SIDEBAR & OFFCANVAS
   ========================= */
.sidebar, .offcanvas, .offcanvas-lg {
  box-shadow: none !important;
  padding: 0 !important;
}
.offcanvas, .offcanvas-lg, .offcanvas-start {
  background: none !important;
  color: rgb(232, 237, 237) !important;
}
.offcanvas .nav-link,
.offcanvas-lg .nav-link {
  color: rgb(232, 237, 237) !important;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  border-radius: 0.4rem;
  transition: background 0.2s, color 0.2s;
  text-shadow: 0 1px 2px rgba(59,110,165,0.15);
}
.offcanvas .nav-link.active,
.offcanvas .nav-link:hover,
.offcanvas-lg .nav-link.active,
.offcanvas-lg .nav-link:hover {
  background: #28527a !important;
  color: #eaf6fb !important;
}

/* Responsive sidebar/offcanvas backgrounds */
@media (max-width: 990px) {
  .offcanvas, .offcanvas-lg, .offcanvas-start {
    background: #134983 !important;
    color: #ebeffd !important;
  }
}
@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    box-shadow: none;
    padding: .5rem;
  }
  .main-content {
    margin-left: 0;
    padding: .5rem;
  }
}
@media (max-width: 600px) {
  .main-content {
    padding: 0.5rem;
  }
  .sidebar {
    padding: 0.5rem;
  }
}

/* =========================
   MAIN CONTENT
   ========================= */
.main-content {
  margin-left: 290px;
  padding: 2.5rem 2rem 2rem 2rem;
  min-height: 100vh;
}

/* =========================
   PAGE HEADER & BREADCRUMBS
   ========================= */
.page-header .text-muted,
.page-header label {
  color: rgb(120, 177, 217) !important;
}
.page-header h2,
.breadcrumb-item a,
.breadcrumb-item.active {
  color: rgb(232, 237, 237) !important;
}
.breadcrumb-item.active {
  font-weight: 600;
}

/* =========================
   TABLES
   ========================= */
.table {
  background: #f6fbff;
  border-radius: 0.7rem;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(59,110,165,0.04);
}
.table thead {
  background: #f6fbff;
}
.table tbody td {
  background: none;
  padding: .8rem;
}
.table tbody tr:nth-child(even) {
  background: #f6fbff !important;
}
.table tbody tr:hover a:not(.btn) {
  color: #56c1f7 !important;
}

/* =========================
   CARDS
   ========================= */
.card {
  border-radius: 0.5rem;
  box-shadow: 0 2px 16px rgba(59,110,165,0.07);
  background: #f6fbff;
  border: #134983 1px solid;
}

/* =========================
   BUTTONS
   ========================= */
.bg-primary, .btn-primary {
  background: #134983 !important;
  color: #fff !important;
}
.btn-primary {
  background:  #3b6ea5;
  border: none;
  font-weight: 600;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(59,110,165,0.08);
}
.btn-primary:hover {
  background: #28527a;
}
.btn-outline-secondary {
  border-radius: 0.4rem;
}

/* =========================
   FORMS
   ========================= */
.form-control, .form-select {
  border-radius: 0.5rem;
  border: 1px solid #b3c7d6;
  box-shadow: none;
  transition: border 0.2s;
  background: #f6fbff;
}
.form-control:focus, .form-select:focus {
  border-color: #3b6ea5;
  box-shadow: 0 0 0 2px rgba(59,110,165,0.08);
}
input[type="file"] {
  border: none;
  background: #eaf6fb;
  padding: 0.5rem;
  border-radius: 0.4rem;
}

/* =========================
   LINKS
   ========================= */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

/* =========================
   MISC
   ========================= */
hr {
  border-top: 1px solid #b3c7d6;
}
::-webkit-scrollbar {
  width: 8px;
  background: #eaf6fb;
}
::-webkit-scrollbar-thumb {
  background: #b3c7d6;
  border-radius: 4px;
}

/* Circle background highlight (centered behind the wrapped text) */
.hl-circle {
  position: relative;
  display: inline-block;       /* key: size to text width */
  vertical-align: middle;
  line-height: 1;              /* avoid extra height from line box */
  z-index: 0;
}
.hl-circle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--hl-size, 2.2em);
  height: var(--hl-size, 2.2em);
  background: var(--hl-color, #ffe69c);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Optional ring-only */
.hl-circle-ring::before {
  background: transparent;
  box-shadow: inset 0 0 0 3px var(--hl-color, #ffe69c);
}

.stat-row .stat-ico {
  width: 25px;           /* narrow icon column */
  flex: 0 0 25px;
  font-size: 1.5rem;     /* compact, readable */
  line-height: 1;
  text-align: center;
}

.time-fixed {
  /* keep width constant for HH:MM:SS (8 chars) */
  display: inline-block;
  width: 8ch;           /* or min-width: 8ch; */
  text-align: right;

  /* prevent proportional digit widths */
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;

  /* fallback to monospace if tabular-nums unsupported */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* =========================
   MAP
   ========================= */
#map {
  width: 100%;
  height: 650px;
}

/* =========================
   DROPDOWN MENU
   ========================= */
.dropdown-menu {
  position: fixed !important;
  z-index: 9999 !important;
}

/* =========================
   CONTAINER WIDTHS
   ========================= */
@media (min-width:1400px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    max-width: 1400px;
  }
}

/* =========================
   CENTER MENU (NAVBAR)
   ========================= */
@media (min-width: 992px) {
  #centerMenu {
    display: none !important;
  }
}

/* =========================
   TRACK CONTROLS
   ========================= */
#controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap !important;
  width: 100%;
}
#timebar {
  flex-grow: 1;
  min-width: 0;
  max-width: 100%;
}

/* =========================
   TOASTS STYLES
   ========================= */
.toast-container {
  z-index: 9999;
}

.toast {
  background: rgba(19, 73, 131, 0.92); /* semi-transparent blue */
  color: #eaf6fb;
  border-radius: 0.6rem;
  box-shadow: 0 2px 16px rgba(59,110,165,0.15);
  border: 1px solid #3b6ea5;
  backdrop-filter: blur(2px);
}

.toast-header {
  background: rgba(59, 110, 165, 0.85); /* lighter blue, semi-transparent */
  color: #eaf6fb;
  border-bottom: 1px solid #b3c7d6;
  border-radius: 0.6rem 0.6rem 0 0;
  font-weight: 600;
}

.toast .btn-close {
  filter: invert(1) brightness(1.5);
  opacity: 0.7;
}

.toast-body {
  color: #eaf6fb;
  font-size: 1.05em;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* =========================
   Boat Popups
   ========================= */
.leaflet-popup-content-wrapper { box-shadow: 0 2px 16px rgba(59,110,165,0.15); border-radius: 0; padding: .1rem; }
.leaflet-popup-content .boat-popup { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; min-width: 220px; }
.boat-popup .bp-header { display:flex; align-items:center; gap:.6rem; }
.boat-popup .bp-avatar { width:36px; height:36px; border-radius:50%; background:#134983; color:#2b6cb0; display:flex; align-items:center; justify-content:center; font-size:1.1rem; }
.boat-popup .bp-title { flex:1; min-width:0; }
.boat-popup .bp-name { font-weight:700; letter-spacing:.3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.boat-popup .bp-sub { font-size:.8rem; color:#6c757d; }
.boat-popup .bp-close { border:none; background:transparent; font-size:1.2rem; line-height:1; color:#999; cursor:pointer; }
.boat-popup .bp-tags { margin:.4rem 0 .2rem; display:flex; gap:.5rem; }
.boat-popup .bp-dot { width:12px; height:12px; border-radius:50%; display:inline-block; opacity:.85; }
.boat-popup .bp-grid { display:grid; grid-template-columns: 1fr 1fr 1fr; gap:.6rem; margin-top:.4rem;}
.boat-popup .bp-metric { background:#f8f9fa; padding:.5rem .5rem;}
.boat-popup .bp-label { font-size:.75rem; color:#6c757d; }
.boat-popup .bp-value { font-weight:700; font-size:.75rem; }
.boat-popup .bp-footer { margin-top:.4rem; }

/* Selected boat row highlight */
#resultsTableBody .selected-boat { background: #eef5ff; }

/* =========================
   Boat Telemetry Instruments
   ========================= */
.telemetry-grid { align-items: stretch; justify-content: space-between; flex-wrap: nowrap; }

.wind-instr, .boat-instr {
  position: relative;
  width: 150px; height: 150px;
  border: 5px solid #646464;
  border-bottom: 15px solid #646464;
  border-radius: .5rem;
  background: radial-gradient(circle at 50% 50%, #e6e6e6 0%, #dadada 70%, #cbcbcb 100%);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.05);
  overflow: hidden;
}

/* Wind instrument visuals */
.wind-instr .boat {
  position: absolute; left: 50%; top: 50%;
  width: 28px; height: 70px; transform: translate(-50%, -50%);
  opacity: .9; pointer-events: none; user-select: none;
}
.wind-instr .needle {
  position: absolute; left: 50%; top: 50%;
  width: 2px; height: 58px; background: #dc3545;
  transform-origin: 50% 100%; transform: translate(-50%, -100%) rotate(0deg);
  border-radius: 1px; box-shadow: 0 0 3px rgba(220,53,69,.5);
}
.wind-instr .ring {
  pointer-events: none; position: absolute; left: 50%; top: 50%;
  width: 110px; height: 110px; transform: translate(-50%, -50%);
  border-radius: 50%; border: 1px dashed #989898;
}

/* Readouts positioning */
.boat-instr .readout.top { position: absolute; top: 6px; left: 6px; right: 6px; }
.boat-instr .readout.bottom { position: absolute; bottom: 8px; left: 6px; right: 6px; }
.wind-instr .readout.bottom { position: absolute; bottom: 6px; left: 6px; right: 6px; }

/* Unified value sizing */
.readout { font-weight: 600; }
.readout .value { font-size: 1.4rem; line-height: 1; }
.readout .unit { font-size: .8rem; font-weight: 500; color: #6c757d; }
.boat-instr .readout.bottom .line { display: flex; align-items: center; justify-content: center; gap: .25rem; line-height: 1; }


:root{
  /* brand colors (fallbacks if not already defined) */
  --brand-bg: #134983;
  --brand-text: #ffffff;
  --brand-text-muted: rgba(255,255,255,.72);
  --brand-border: rgba(255,255,255,.15);
  --brand-chip: rgba(255,255,255,.08);
  --brand-chip-hover: rgba(255,255,255,.16);
}

/* Footer (brand theme) */
.site-footer {
  background: var(--brand-bg);
  color: var(--brand-text);
  border-top: 1px solid var(--brand-border) !important;
}
.site-footer .footer-links a{
  color: var(--brand-text-muted);
  text-decoration: none;
  margin-right: 12px;
  display: inline-block;
  margin-bottom: 6px;
}
.site-footer .footer-links a:hover{
  color: var(--brand-text);
  text-decoration: underline;
}
.site-footer .footer-icon{
  color: var(--brand-text);
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-chip);
}
.site-footer .footer-icon:hover{
  background: var(--brand-chip-hover);
  color: var(--brand-text);
  text-decoration: none;
}
.site-footer .text-footer-muted{
  color: var(--brand-text-muted) !important;
}
