:root{
  --gate-size: clamp(72px, 8vw, 110px);
  --lamp-size-w: 42px;
  --lamp-size-h: 14px;
}

.gate {
  width: var(--gate-size);
  height: var(--gate-size);
  background: #075985;
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
  position: relative;
  place-items: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.gate-timer {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  z-index: 2;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot--success { background: var(--status-success); }
.dot--error { background: var(--status-error); }
.dot--info { background: var(--status-info); }

.gates-main {
  width: 100%;
  padding: 2rem 1rem;
}

.gates-columns {
  display: grid;
  grid-template-columns: 0.85fr auto; /* Lewa: 1fr (stacja prawdziwa), prawa: auto (5 demo) */
  gap: 3rem;
  max-width: 1600px;
  margin: 0 auto;
  align-items: flex-start;
}

.gates-column-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
  min-width: 0; /* Zapobiega overflow */
}

.gates-column-right {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0; /* Zapobiega overflow */
  position: relative;
}

.gates-column-right:after {
    content: '';
    width: 108%;
    height: 1px;
    background: var(--grey);
    position: absolute;
    bottom: 5rem;
    margin: auto;
    right: -4%;
    z-index: -1;
}

.gates-column-left:after {
    content: '';
    width: 26%;
    height: 1px;
    background: var(--grey);
    position: absolute;
    bottom: 9.5rem;
    margin: auto;
    z-index: -1;
}

.gates-demo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.gate-column {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.column-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.column-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.column-badge--real {
  background: var(--status-success);
  color: white;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}

.column-badge--demo {
  background: var(--panel-bg);
  color: var(--color-text);
  border: 1px solid var(--border-soft);
}

.column-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  text-align: center;
}

.lamp {
  width: var(--lamp-size-w);
  height: var(--lamp-size-h);
  border-radius: 0.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.lamp-light {
  width: 100%;
  height: 100%;
  border-radius: 0.125rem;
  transition: background-color 0.3s ease;
}

.lamp-light[data-lamp-color="green"] {
  background: var(--status-success);
  box-shadow: 0 0 8px rgba(0, 128, 0, 0.6);
}

.lamp-light[data-lamp-color="red"] {
  background: var(--status-error);
  box-shadow: 0 0 8px rgba(200, 0, 0, 0.6);
}

.lamp-light[data-lamp-color="yellow"] {
  background: var(--status-info);
  box-shadow: 0 0 10px rgba(230, 175, 46, 0.8);
  animation: lampBlink 0.6s ease-in-out infinite;
}

.lamp-light:not([data-lamp-color]) {
  background: #52525b;
}


@keyframes lampPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

@keyframes lampBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.truck {
  height: 14rem;
  width: auto;
  pointer-events: none;
  user-select: none;
  transition: opacity 0.3s ease;
}

.truck--top {
  margin-bottom: 0.5rem;
}

.gate-wrapper {
  position: relative;
  width: var(--gate-size);
  height: var(--gate-size);
}

.guidance-lines {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 1;
}

.guidance-lines--top {
  bottom: 100%;
  margin-bottom: -0.25rem;
}

.guidance-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
}

.guidance-rail {
  display: block;
  width: 2px;
  height: 14rem;
  background: var(--status-success);
  box-shadow: 0 0 10px rgba(0, 255, 120, 0.6);
}

.hover-info {
  background: var(--panel-bg);
  height: 64px;
  display: grid;
  align-items: center;
  transition: opacity .15s ease, filter .15s ease, border-color .15s ease, background-color .15s ease;
  opacity: 1;
}

.hover-info--hidden {
  opacity: 0;
  background-color: transparent !important;
  border-color: transparent !important;
  pointer-events: none;
  filter: blur(0.2px);
}

.info-chip {
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-strong);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.18);
}

.chip--free { background: var(--status-success); }
.chip--busy { background: var(--status-error); }
.chip--check { background: var(--status-info); }

.gates-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  width: 92%;
  margin: auto;
}

.legend-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-soft);
  background: var(--panel-bg);
  font-size: 0.875rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.last-update {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}

.last-update span {
  font-weight: 600;
  color: var(--color-text);
}

.hover-info {
  margin-top: 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-soft);
  background: var(--panel-bg);
  padding: 0.75rem;
}

.hover-info-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}

.hover-info-text {
  min-width: 0;
  flex: 1;
}

.hover-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.hover-info-main {
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-info-sub {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gate-number {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  font-size: clamp(1.05rem, 2.8vw, 1.4rem);
  text-align: center;
}

.presentation-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
  margin-top: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

@media (max-width: 1024px) {
  .gates-columns {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .gates-demo-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 kolumny na mobile */
  }
}

@media (max-width: 768px) {
  .gates-demo-grid {
    grid-template-columns: 1fr; /* 1 kolumna na maÃ…â€šych ekranach */
  }
}
