/* Общий стиль страницы */
body {
  margin: 0;
  padding: 0;
  background-color: #0f1326;
  color: #e0e0ff;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Основной контейнер всей страницы */
.page-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 20px;
  box-sizing: border-box;
}

/* Шапка сайта */
header {
  background-color: #1a213d;
  padding: 10px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.5em;
  color: #e0e0ff;
  border: 1px solid #2a3450;
}

/* Основной блок с двумя колонками */
.main-content {
  display: flex;
  flex: 1;
  gap: 24px;
}

/* Левая колонка — боковая панель */
.sidebar {
  width: 15%;
  background-color: #0f3460;
  padding: 16px;
  border-radius: 8px;
  flex-shrink: 0;
  border: 1px solid #2a3450;
}

/* Ссылки в левой колонке */
.sidebar a {
  display: block;
  color: #a9c6e5;
  text-decoration: none;
  padding: 9px 0;
  border-bottom: 1px solid #2a3450;
  transition: color 0.2s;
}

.sidebar a:hover {
  color: #d0e4ff;
  text-decoration: underline;
}

/* Блок с прогнозом прохождения */
.propagation-banner {
  display: block;
  margin-top: 20px;
  text-align: center;
}

.propagation-banner img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto 0;
  border-radius: 4px;
}

/* Правая колонка — основной контент */
.content {
  flex: 1;
  background-color: #16213d;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #2a3450;
}

/* Панель вкладок */
.tabs {
  display: flex;
  background-color: #0f3460;
  padding: 0;
  margin: 0;
  list-style: none;
  border-bottom: 1px solid #2a3450;
}

.tabs li {
  padding: 12px 24px;
  cursor: pointer;
  transition: background-color 0.2s;
  color: #a9c6e5;
}

.tabs li:hover {
  background-color: #1a213d;
  text-decoration: underline;
}

.tabs li.active {
  background-color: #0f1326;
  color: #d0e4ff;
  font-weight: bold;
}

/* Контейнер содержимого вкладок */
.tab-content {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 180px);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Отдельная панель вкладки */
.tab-panel {
  display: none;
  height: 100%;
}

.tab-panel.active {
  display: block;
}

/* Подвал сайта */
footer {
  margin-top: 20px;
  background-color: #1a213d;
  padding: 10px 20px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.9em;
  color: #8899b3;
  border: 1px solid #2a3450;
}

/* Контейнер для прокрутки таблицы */
.table-scroll-container {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-bottom: 1px solid #2a3450;
  border-radius: 0 0 8px 8px;
}

/* Стиль таблицы — фиксированная ширина столбцов */
.spots-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  table-layout: fixed;
}

.spots-table th,
.spots-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #2a3450;
  word-wrap: break-word;
}

.spots-table th {
  background-color: #0f3460;
  color: #a9c6e5;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10;
}

.spots-table tr:hover {
  background-color: rgba(26, 33, 61, 0.4);
}

/* Ширины столбцов */
.spots-table th:first-child,
.spots-table td:first-child { width: 18%; } /* Time (UTC) */
.spots-table th:nth-child(2),
.spots-table td:nth-child(2) { width: 12%; } /* Reporter */
.spots-table th:nth-child(3),
.spots-table td:nth-child(3) { width: 10%; } /* Loc */
.spots-table th:nth-child(4),
.spots-table td:nth-child(4) { width: 12%; } /* Freq, MHz */
.spots-table th:nth-child(5),
.spots-table td:nth-child(5) { width: 15%; } /* Pwr, dBm(Watt) */
.spots-table th:nth-child(6),
.spots-table td:nth-child(6) { width: 8%; }  /* SNR */
.spots-table th:nth-child(7),
.spots-table td:nth-child(7) { width: 8%; }  /* Drift */
.spots-table th:last-child,
.spots-table td:last-child { width: 10%; } /* Dist, km */

/* Заголовок с UTC временем */
.utc-time {
  color: #a9c6e5;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 12px;
  text-align: right;
  padding-right: 20px;
}

/* Ссылки в таблице спотов — как в левой панели */
.spots-table a {
  color: #a9c6e5;
  text-decoration: none;
  transition: color 0.2s;
}

.spots-table a:hover {
  color: #d0e4ff;
  text-decoration: underline;
}

/* Легенда диапазонов под картой */
.band-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 10px;
  background-color: #0f3460;
  border: 1px solid #2a3450;
  border-radius: 6px;
  font-size: 13px;
  color: #a9c6e5;
}

.band-legend div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.band-legend span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #000;
}

/* === ПОЛЕ ВВОДА ПОЗЫВНОГО === */
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background-color: #16213d;
  border: 1px solid #2a3450;
  border-radius: 6px;
  margin-bottom: 16px;
}

.header-row .callsign-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-row .callsign-input-group label {
  font-size: 14px;
  color: #a9c6e5;
}

.header-row .callsign-input-group input {
  width: 130px;
  padding: 6px;
  border: 1px solid #2a3450;
  background-color: #0f1326;
  color: #e0e0ff;
  border-radius: 4px;
  text-transform: uppercase;
}

.header-row .callsign-input-group button {
  padding: 6px 12px;
  background-color: #0f3460;
  color: #a9c6e5;
  border: 1px solid #2a3450;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.header-row .callsign-input-group button:hover {
  background-color: #1a213d;
  text-decoration: underline;
}

/* Горизонтальная легенда */
.band-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  background-color: #0f3460;
  border: 1px solid #2a3450;
  border-radius: 6px;
  font-size: 13px;
  color: #a9c6e5;
}

.band-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.band-legend .legend-item span {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #000;
}

/* Адаптивность */
@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
  }
  .callsign-control {
    flex-direction: column;
    align-items: flex-start;
  }
  .callsign-control input {
    width: 100%;
    max-width: 200px;
  }
}