/* Noņem noklusējuma malas un uzstāda lapas pamata fontu un fonu */
html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f5f7fb;
}

/* Stils krustojuma virsrakstam kas parāda izvēlētā krustojuma nosaukumu */
.intersection-title {
  background: linear-gradient(90deg,#0d47a1,#1976d2);
  color: white;
  font-size: 24px;
  font-weight: 600;
  padding: 18px;
  text-align: center;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Konteiners kurā tiek attēlots signālplāns */
#plan {
  width: 100%;
  overflow-x: auto;
  padding: 15px;
}

/* Wrapper elements kas ļauj tabulai horizontāli ritināties */
.timeline-wrapper {
  width: 100%;
  overflow-x: auto;
}

/* Tabulas pamatstils signālplāna attēlošanai */
.timeline {
  border-collapse: collapse;
  table-layout: fixed;
  width: max-content;
  background: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
}

/* Kolonna kas attēlo signāla virziena kodu */
.timeline th.dir-col {
  background: linear-gradient(180deg,#1976d2,#1565c0);
  color: white;
  padding: 10px;
  min-width: 160px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  position: sticky;
  left: 0;
  z-index: 3;
  border-right: 2px solid #0d47a1;
}

/* Maina krāsu kad pele atrodas virs virziena kolonnas */
.timeline th.dir-col:hover {
  background: linear-gradient(180deg,#1e88e5,#1565c0);
}

/* Tabulas šūnu pamatstils kas attēlo signāla stāvokli sekundēs */
.timeline td {
  width: 22px;
  height: 22px;
  border: 1px solid #d0d0d0;
  transition: transform 0.1s;
}

/* Palielina šūnu kad pele atrodas virs tās */
.timeline td:hover {
  transform: scale(1.15);
  z-index: 2;
}

/* Galvenes stils kas attēlo laika intervālus */
.time-header {
  background: #e3f2fd;
  font-size: 11px;
  text-align: center;
  font-weight: 600;
  color: #0d47a1;
  border-bottom: 2px solid #90caf9;
}

/* Stils sarkanajam signālam */
.red {
  background: #e53935;
}

/* Stils zaļajam signālam */
.green {
  background: #00c853;
}

/* Stils dzeltenajam signālam */
.yellow {
  background: #ffd600;
}

/* Stils sarkani dzeltenajam signālam */
.red-yellow {
  background: linear-gradient(45deg,#e53935 50%,#ffd600 50%);
}

/* Stils mirgojošajam signālam */
.blink {
  background: linear-gradient(45deg,#00c853 50%,white 50%);
}