
/* ── Globālie stili ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
    padding: 20px;
}

h1 {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #7ecfff;
    letter-spacing: 1px;
}

/* ── Krustojumu izvēles josla ── */
.controls {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.controls form {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #16213e;
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #2a4a7f;
}

.controls label {
    font-size: .9rem;
    color: #7ecfff;
}

.controls select {
    padding: 6px 12px;
    border-radius: 5px;
    border: 1px solid #2a4a7f;
    background: #0f3460;
    color: #fff;
    font-size: .9rem;
    min-width: 280px;
    cursor: pointer;
}

/* Krustojumi AR datiem - izcelti spilgti zaļā krāsā */
.controls select option.has-data {
    color: #2ecc71;
    font-weight: bold;
}

/* Krustojumi BEZ datiem - pelēcīgi */
.controls select option.no-data {
    color: #8899aa;
}

.controls button {
    padding: 7px 18px;
    background: #2980b9;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: .9rem;
    transition: background .2s;
}

.controls button:hover {
    background: #1a6fa3;
}

/* ── Signālu tabulas apvalks ── */
.table-outer {
    background: #16213e;
    border-radius: 10px;
    border: 1px solid #2a4a7f;
    overflow: auto;
    max-width: 100%;
}

/* ── Pati signālu tabula ── */
table.signal-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
}

/* Krustojuma nosaukums tabulas augšā */
.header-intersection {
    background: #1565c0;
    color: #fff;
    font-weight: bold;
    text-align: center;
    font-size: 1rem;
    padding: 10px;
    letter-spacing: .5px;
}

/* Laika ass (skaitļi virs tabulas) */
.time-axis th {
    background: #1e3a5f;
    color: #7ecfff;
    font-size: .7rem;
    font-weight: normal;
    text-align: right;
    padding: 2px 3px;
    min-width: 16px;
    border-right: 1px solid #2a4a7f;
    white-space: nowrap;
}

.time-axis th.label-cell {
    text-align: center;
    font-weight: bold;
    color: #7ecfff;
    min-width: 60px;
    background: #1a3050;
}

/* Virziena nosaukuma kolona (V1, GP4, ...) */
td.dir-label {
    background: #1a3050;
    color: #7ecfff;
    font-size: .75rem;
    font-weight: bold;
    text-align: center;
    padding: 2px 6px;
    min-width: 60px;
    border-right: 2px solid #2a4a7f;
    white-space: nowrap;
    border-bottom: 1px solid #1e3a5f;
}

/* ── Signālu rūtiņas ── */
td.cell {
    width: 16px;
    height: 20px;
    border-right: 1px solid rgba(0, 0, 0, .15);
    border-bottom: 1px solid rgba(0, 0, 0, .12);
    padding: 0;
}

/* Zilā vertikālā līnija - fāžu atdalītājs */
td.cell.phase-sep {
    border-left: 2px solid #5b9bd5;
}

/* Zaļš - transportam braukt / gājējiem iet */
td.cell.green {
    background: #27ae60;
}

/* Sarkans - stāvēt */
td.cell.red {
    background: #c0392b;
}

/* Dzeltens - bremzēt (pēc zaļā) */
td.cell.amber {
    background: #f1c40f;
}

/* Sarkans + Dzeltens - gatavoties braukt (pirms zaļā)
   Horizontāls sadalījums: augša sarkana, apakša dzeltena */
td.cell.red_amber {
    background: linear-gradient(to bottom, #c0392b 50%, #f1c40f 50%);
}

/* Mirgojošais zaļš - gājēju pāreja beidzas
   Vertikāls sadalījums: kreisā puse balta, labā zaļa */
td.cell.flash {
    background: linear-gradient(to right, #ffffff 50%, #27ae60 50%);
}

/* Tukša rūtiņa - nav datu */
td.cell.empty {
    background: #1a2a40;
}

/* ── Informācijas josla virs tabulas ── */
.meta-bar {
    display: flex;
    gap: 24px;
    align-items: center;
    padding: 10px 16px;
    background: #0d2137;
    border-bottom: 1px solid #2a4a7f;
    flex-wrap: wrap;
}

.meta-bar span {
    font-size: .8rem;
    color: #aac8e8;
}

.meta-bar strong {
    color: #7ecfff;
}

/* ── Nav datu ziņojums ── */
.no-program-msg {
    text-align: center;
    padding: 30px;
    color: #5a7a9a;
    font-size: .9rem;
    font-style: italic;
}
