/* AIRPORTS view: the original #airports-v inline layout. The detail panel keeps its inline styles in the ERB. */
#airports-v,
#spotter-v {
  padding: 15px;
}

#airports-v .split-container,
#spotter-v .split-container {
  display: flex;
  gap: 15px;
  height: calc(100vh - 190px - var(--header-extra));
  /* The height actually visible on a phone: 100vh counts the address bar too. */
  height: calc(100dvh - 190px - var(--header-extra));
  min-height: 480px;
}

#airports-v .split-left,
#spotter-v .split-left {
  width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--c-grey-050505);
  border: 1px solid var(--c-grey-222);
  border-radius: 4px;
  padding: 10px;
  flex-shrink: 0;
}

#airports-v .split-right,
#spotter-v .split-right {
  flex-grow: 1;
  background: var(--c-grey-050505);
  border: 1px solid var(--c-grey-222);
  border-radius: 4px;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#airport-search-input {
  background: var(--c-black);
  color: var(--c-amber);
  border: 1px solid var(--c-amber);
  font-family: monospace;
  padding: 8px;
  font-size: 0.85rem;
  border-radius: 3px;
  outline: none;
  margin-bottom: 10px;
  width: 100%;
}

#airports-side-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Items also carry the side-nav .nav-item class, as in the original, for its weight and uppercase text. */
#airports-side-list .airport-item {
  padding: 12px 15px;
  background: var(--c-black);
  border: 1px solid var(--c-grey-222);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 8px;
}

#airports-side-list .airport-item.is-selected {
  border-color: var(--c-amber);
  background: rgba(255, 176, 0, 0.05);
  box-shadow: 0 0 10px rgba(255, 176, 0, 0.1);
}

.airport-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.airport-item-head strong {
  color: var(--c-amber);
  font-size: 1rem;
}

.airport-item-head span {
  font-size: 0.75rem;
  color: var(--c-green);
  font-weight: bold;
}

.airport-item-name {
  font-size: 0.75rem;
  color: var(--c-grey-aaa);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.airport-dispatch-btn {
  background: var(--c-amber);
  color: var(--c-black);
  border: none;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  border-radius: 3px;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 0 8px rgba(255, 176, 0, 0.15);
}

.airport-dispatch-btn:hover {
  background: var(--c-gold);
  box-shadow: 0 0 12px rgba(255, 176, 0, 0.3);
}

.runway-switch-btn {
  background: transparent;
  border: none;
  color: var(--c-amber);
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 3px;
  transition: all 0.2s;
}

.runway-switch-btn:hover {
  background: var(--c-grey-222);
}

.webcam-card {
  border: 1px solid var(--c-grey-222);
  border-radius: 4px;
  background: var(--c-grey-050505);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.webcam-video-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--c-black);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0, 242, 255, 0.15);
}

.webcam-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@keyframes pulse-highlight {
  0% { opacity: 0.95; box-shadow: 0 0 5px #55ff00; }
  50% { opacity: 1; box-shadow: 0 0 15px #55ff00; }
  100% { opacity: 0.95; box-shadow: 0 0 5px #55ff00; }
}

@media (max-width: 768px) {
  #airports-v .split-container,
  #spotter-v .split-container {
    flex-direction: column;
    height: auto;
    min-height: auto;
  }

  #airports-v .split-left,
  #spotter-v .split-left {
    width: 100%;
    height: 250px;
    flex-shrink: 0;
    margin-bottom: 15px;
  }

  #airports-v .split-right,
  #spotter-v .split-right {
    width: 100%;
    min-height: 280px;
  }
}

/* The airport heading's facts: codes, where, how high, what time it is there, how far away. */
.apt-header-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--c-white);
}

.apt-header-label {
  color: var(--c-grey-aaa);
  font-size: 0.72rem;
  font-weight: normal;
  letter-spacing: 0.5px;
}

/* How old the weather reading is. A METAR is issued about every half hour, so anything past an hour is called out:
   before this, a report from a fortnight ago was drawn exactly like one from five minutes ago. */
.apt-metar-age {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--c-grey-aaa);
}

.apt-metar-age.is-stale {
  color: var(--c-amber);
  font-weight: bold;
}
