
/* ── Google Fonts ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Pamata mainīgie ────────────────────────── */
:root {
  --bg:           #eef2f7;
  --surface:      #ffffff;
  --border:       #d0dce8;
  --accent:       #2563eb;
  --accent-light: #dbeafe;
  --header-blue:  #7ec8e3;
  --header-blue2: #cce8f4;
  --text:         #1e293b;
  --text-dim:     #64748b;

  /* Signālu krāsas */
  --clr-green:    #4ade80;
  --clr-yellow:   #facc15;
  --clr-red:      #f43f5e;
  --clr-white:    #f8fafc;
}

/* ── Reset & base ──────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
}

/* ── Lapas galvene ─────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.site-header .header-icon {
  font-size: 2rem;
  line-height: 1;
}

.site-header h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.site-header p {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 1px;
}

/* ── Galvenais saturs ──────────────────────── */
.main-content {
  max-width: 1400px;
  margin: 32px auto;
  padding: 0 24px 48px;
}

/* ── Izvēles josla ─────────────────────────── */
.selector-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.selector-bar label {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.selector-bar select {
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  min-width: 280px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}

.selector-bar select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

/* ── Tabulas karte ─────────────────────────── */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  padding: 20px 20px 16px;
}

/* ── Signālu tabula ────────────────────────── */
.signal-table {
  border-collapse: collapse;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 12px;
  table-layout: fixed;
}

/* Zilais virsraksts */
.title-row td {
  background: var(--header-blue);
  color: #0f2a3f;
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  padding: 9px 6px;
  border: 1px solid #59b8d6;
  letter-spacing: 0.02em;
}

/* Laika ass galvene */
.header-row th {
  background: var(--header-blue2);
  border: 1px solid #99cce0;
  padding: 4px 0 3px 0;
  text-align: right;
  font-weight: 600;
  font-size: 10.5px;
  color: #1a3a5c;
  white-space: nowrap;
  vertical-align: bottom;
}

th.dir-header {
  text-align: left;
  padding: 4px 10px;
  width: 60px;
  min-width: 60px;
}

/* 1 sekunde = 10px šūna */
th.tick {
  width: 10px;
  min-width: 10px;
  padding: 4px 1px 3px 0;
  border-left-color: transparent;
  border-right-color: transparent;
}

th.tick-5 {
  border-left: 1px solid #88b8cc !important;
}

/* Virzienu rindas – etiķete */
.dir-row td.dir-label {
  background: var(--header-blue2);
  border: 1px solid #99cce0;
  padding: 0 10px;
  font-weight: 600;
  font-size: 11.5px;
  color: #1a3a5c;
  white-space: nowrap;
  vertical-align: middle;
  text-align: left;
  width: 60px;
  min-width: 60px;
  height: 28px;
}

/* Fāzes šūna */
.dir-row td.cell {
  width: 10px;
  min-width: 10px;
  height: 28px;
  padding: 0;
  border-top:    1px solid rgba(0,0,0,0.12);
  border-bottom: 1px solid rgba(0,0,0,0.12);
  border-left:   1px solid rgba(0,0,0,0.08);
  border-right:  1px solid rgba(0,0,0,0.08);
}

/* Vertikāls sadalītājs ik pēc 5 sekundēm */
td.cell.sep5 {
  border-left: 1px solid rgba(0,0,0,0.28) !important;
}

/* ── Fāžu krāsas ───────────────────────────── */

/* Zaļš – braukt atļauts */
.c-green  { background: var(--clr-green); }

/* Dzeltens – uzmanību */
.c-yellow { background: var(--clr-yellow); }

/* Sarkans – stāt */
.c-red    { background: var(--clr-red); }

/*
 * Amber – horizontāls sadalījums:
 *   kreisā puse = sarkana, labā puse = dzeltena
 *   Norāda pārejas fāzi starp sarkanu un zaļu
 */
.c-amber {
  background: linear-gradient(
    to right,
    var(--clr-red)    50%,
    var(--clr-yellow) 50%
  );
}

/*
 * Flash (mirgošana) – gājēju signāls:
 *   vertikālas baltas un zaļas svītras
 *   Norāda gājēju zaļās fāzes beigas (iet drīkst, bet drīz beigsies)
 */
.c-flash {
  background: repeating-linear-gradient(
    to right,
    var(--clr-white)  0px, var(--clr-white)  4px,
    var(--clr-green)  4px, var(--clr-green)  8px
  );
}

/* ── Tukša tabula ──────────────────────────── */
.empty-row td {
  padding: 14px 10px;
  color: var(--text-dim);
  font-style: italic;
  border: 1px solid var(--border);
  background: #f8fafc;
  text-align: center;
}

/* ── Placeholder (nav izvēlēts) ────────────── */
.placeholder {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 72px 24px;
  text-align: center;
  color: var(--text-dim);
}

.placeholder .ph-icon {
  font-size: 3.5rem;
  opacity: 0.35;
  margin-bottom: 12px;
}

.placeholder p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Lapas kājene ──────────────────────────── */
.site-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  padding-bottom: 24px;
}

/* ── Responsivitāte ────────────────────────── */
@media (max-width: 600px) {
  .site-header { padding: 14px 16px; }
  .main-content { padding: 0 12px 40px; }
  .selector-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .selector-bar select { min-width: 100%; }
}
