/* ============================================================
   VODIČ — TABOVI, TABELE, SVG DIJAGRAMI
   Additive layer iznad guide.css + legal.css.
   Koristi iste tokene (tokens.css), bez novih boja.
   ============================================================ */

/* --- TAB NAVIGACIJA (pill scroller) --- */
.tabs {
  margin: 24px 0 36px;
}

.tabs__nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 32px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tabs__nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition),
              box-shadow var(--transition);
}

.tab-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.tab-btn[aria-selected="true"] {
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tab-panel {
  animation: fadeUp 500ms var(--ease) both;
}

.tab-panel[hidden] {
  display: none;
}

/* --- TABELA KAZNI / BODOVA --- */
.guide-table-wrap {
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  -webkit-overflow-scrolling: touch;
}

.guide-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 14px;
}

.guide-table thead th {
  position: sticky;
  top: 0;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.guide-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  line-height: 1.5;
  vertical-align: top;
}

.guide-table tbody tr:last-child td {
  border-bottom: none;
}

.guide-table tbody tr:hover {
  background: var(--surface-hover);
}

.guide-table td:first-child {
  color: var(--text);
  font-weight: 500;
}

.guide-table .km {
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 13px;
  white-space: nowrap;
}

.guide-table .muted {
  color: var(--text-subtle);
}

/* Naglašeni red (obijesna vožnja) */
.guide-table tr.is-severe td {
  background: color-mix(in srgb, #ff453a 9%, transparent);
}
.guide-table tr.is-severe:hover td {
  background: color-mix(in srgb, #ff453a 14%, transparent);
}

/* --- SVG DIJAGRAMI (kružni tok) --- */
.guide-figure {
  margin: 28px 0;
}

.guide-figure svg {
  display: block;
  width: 100%;
  height: auto;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.guide-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-subtle);
  text-align: center;
}

/* SVG tekstualne oznake — naslijede temu */
.guide-figure svg text {
  font-family: var(--font-mono);
  font-size: 12px;
  fill: var(--text-muted);
}

.guide-figure svg .road {
  fill: var(--surface-elev);
  stroke: var(--border-strong);
  stroke-width: 1;
}

.guide-figure svg .island {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.5;
}

.guide-figure svg .lane {
  fill: none;
  stroke: var(--text-subtle);
  stroke-width: 1.5;
  stroke-dasharray: 6 7;
}

.guide-figure svg .flow {
  fill: var(--accent);
}

.guide-figure svg .car {
  fill: var(--accent);
}

.guide-figure svg .car-alt {
  fill: var(--success);
}

.guide-figure svg .yield {
  fill: none;
  stroke: #ff9f0a;
  stroke-width: 2;
}

.guide-figure svg .conflict {
  stroke: #ff453a;
  stroke-width: 3;
  stroke-linecap: round;
}

.guide-figure svg .conflict-fill {
  fill: #ff453a;
}

/* Mini-legenda ispod dijagrama */
.figure-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  margin-top: 12px;
}

.figure-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
}

.figure-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.figure-legend i.lg-flow { background: var(--accent); }
.figure-legend i.lg-alt { background: var(--success); }
.figure-legend i.lg-conflict { background: #ff453a; }
.figure-legend i.lg-yield { background: #ff9f0a; }

/* --- DISCLAIMER --- */
.guide-disclaimer {
  margin: 40px 0 0;
  padding: 18px 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-subtle);
}

.guide-disclaimer strong {
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .tab-panel { animation: none !important; }
}
