:root {
  --content-bg-color: rgba(227, 227, 255, 0.95);
  --header-background: linear-gradient(to bottom, #555, #aaa);
  --footer-background: linear-gradient(to top, #555, #aaa);
  --footer-height: 24px;
  --header-height: 24px;
  --header-padding: 2px;
  --nav-color: rgb(87, 234, 154);
  --nav-inactive: #bcbcbc;
  --preview-background-color: #f3e9d6;
  --cookie-foreground-color: PaleGreen;
  --copyright-foreground-color: PowderBlue;
  --ymin-background: #8da9ea;
  --ymin-foreground: blue;
  --yyyy-background: cyan;
  --yyyy-foreground: gray;
  --ymax-background: #8da9ea;
  --ymax-foreground: blue;
  --dim-background: rgba(150, 150, 150, 0.25);
  --tt-aux-color: #adecec;
  --weak-code-color: gray;
  --weak-date-color: gray;
  --normal-date-color: darkblue;
  --strong-date-color: dodgerblue;
  --link-color: blue;
  --text-color: black;
  --time-color: darkcyan;
  --days-color: slateblue;
}

html {
  background-image: url(/assets/img/plane.png);
  background-repeat: repeat;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  margin: 0px;
  padding-left: 8px;
  padding-right: 8px;
  padding-top: var(--header-height);
  padding-bottom: var(--footer-height);
  background-color: var(--content-bg-color);
  min-height: calc(100vh - var(--footer-height) - var(--header-height));
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: var(--header-padding);
  display: flex;
  justify-content: space-between;
  background: var(--header-background);
  height: var(--header-height);
  z-index: 1000;
}

nav {
  display: flex;
  gap: 12px;
  font-size: 11pt;
  font-weight: bold;
  padding-right: 16px;
  align-self: center;

  a {
    color: var(--nav-color);
    font-family: Arial, Helvetica;
    &:hover { color: color-mix(in srgb, var(--nav-color), white 40%); }
  }
}

a {
  text-decoration: none;
  color: var(--link-color);
}

.antia {
  background-color: dodgerblue;
  padding: 3px;
  text-decoration: none;
  color: white;
  border-radius: 4px;
}

p {
  text-align: justify;
}

li {
  line-height: 1.6;
}

td, th {
  padding-top: 2px;
  padding-bottom: 2px;
}

input, button {
  font-size: 14pt;
}

.nav-inactive {
  color: var(--nav-inactive) !important;
  cursor: default;
  pointer-events: none;
}

/* Footer styles */
footer {
  padding: 0px 2px 0px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  font-size: 16px;
  background: var(--footer-background);
  position: fixed;
  bottom: 0;
  left: 0;
  height: var(--footer-height);
  z-index: 1000;
  font-size: 10pt;
}

.copyright-notice, .cookie-notice {
  color: var(--copyright-foreground-color);
}

.cookie-notice {
  margin-right: 12px;
}

.pane {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.hello {
  color: #6555c6;
  font-size: 16px;
}

/* Индексные страницы */
.index {
  min-height: 90vh;
  max-width: 900px;
  display: grid;
  align-content: center;
  gap: 16px;
  margin: 0 auto;
}

/* Контейнер элемента, который будет иметь тултип */
.tooltip-container {
  position: relative; /* Важно! Чтобы тултип позиционировался относительно этого элемента */
  display: inline-block;
  cursor: pointer;
}

/* Сам тултип (скрыт по умолчанию) */
.tooltip-text, .tooltip-lang {
  visibility: hidden;
  background-color: lightblue;
  color: Black;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  padding: 8px;
  border-radius: 5px;
  z-index: 2000;
  position: absolute;
  transition: opacity 0.2s, visibility 0.2s;
}

.tooltip-text {
  bottom: 105%;
  left: 0%;
  transform: translateX(-16px);
}

.tooltip-lang {
  white-space: nowrap;
  right: 100%;
  transform: translate(-8px, -75%);
}

/* Модификаторы для краёв экрана */
.tooltip-text.align-right {
  left: auto;
  right: 0;
  transform: none;
}

.tooltip-text.align-right::after {
  left: 20px;
  transform: none;
}

.tooltip-text.align-left {
  left: 0;
  right: auto;
  transform: none;
}

.tooltip-text.align-left::after {
  left: auto;
  right: 20px;
  transform: none;
}

/* Показываем тултип при наведении на контейнер */
.tooltip-container:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-container:hover .tooltip-lang {
  visibility: visible;
  opacity: 1;
}

/* Специализация */

.small-flag {
  width: 24px;
  height: 16px;
}

.medium-flag {
  width: 32px;
  height: 22px;
}

.large-flag {
  width: 48px;
  height: 32px;
}

/* Для таблиц */
.shrink {
  width: 0.1%;
  white-space: nowrap;
}

/* Стили для кодов АП и АК. */
.code-font {
  font-family: monospace;
  font-weight: 700;
  text-align: center;
}

.tt-header, .pane {
  border: outset 1px;
  border-radius: 5px;
  padding: 10px;
  margin: 6px 0px 6px 0px;
  background: var(--dim-background);
}

.tt-header {
  display: grid;
  grid-template-columns: auto auto repeat(7, 1fr) 3fr;
  min-width: 90vw;
  font-size: 14pt;
  gap: 2px;
  align-items: baseline;
}

/* Ячейка грида с флагом страны в шапке расписания */
.tt-ter {
  grid-column: 1;
  grid-row-start: 1;
  grid-row-end: 3;
  align-self: center;
  padding-right: 5px;
}

.weak-code, .tt-codes {
  color: var(--weak-code-color);
  font-family: monospace;
  font-weight: bold;
}

/* Ячейка грида с кодами аэропорта в шапке расписания */
.tt-codes {
  grid-column: 2;
  grid-row: 1;
  padding-right: 5px;
}

/* Ячейка грида с названием аэропорта в шапке расписания */
.tt-name {
  grid-column-start: 3;
  grid-column-end: 10;
  grid-row: 1;
  font-weight: bold;
  font-size: 18pt;
  color: var(--text-color);
}

.ymin-link, .yyyy-label, .ymax-link {
  align-content: center;
  text-align: center;
  font-weight: bold;
  font-size: 14pt;
  padding-left: 8px;
  padding-right: 8px;
}

/* Ячейка грида со ссылкой на предыдущий год в шапке расписания */
.ymin-link {
  background: var(--ymin-background);
  color: var(--ymin-foreground);
  border-radius: 12px 0px 0px 12px;
}

/* Ячейка грида с текущим годом в шапке расписания */
.yyyy-label {
  background: var(--yyyy-background);
  color: var(--yyyy-foreground);;
}

/* Ячейка грида со ссылкой на следующий год в шапке расписания */
.ymax-link {
  background: var(--ymax-background);
  color: var(--ymax-foreground);
  border-radius: 0px 12px 12px 0px;
}

.tt-timeline {
  grid-column: 10;
  grid-row: 1;
  display: flex;
  justify-content: end;
}

.tt-localtime, .tt-flights, .tt-destinations, .tt-inter, .tt-direction {
  background: #71a4e2;
  grid-row: 2;
  text-align: center;
  font-size: 11pt;
  align-content: center;
  color: var(--tt-aux-color);
}

/* Ячейка грида с текстом "TIME IS LOCAL" */
.tt-localtime {
  grid-column-start: 2;
  grid-column-end: 4;
  grid-row: 2;
  border-radius: 12px 0px 0px 12px;
  font-weight: bold;
}

.tt-flights {
  grid-column-start: 4;
  grid-column-end: 6;
}

/* Количество направлений в шапке расписания */
.tt-destinations {
  grid-column-start: 6;
  grid-column-end: 8;
}

/* Количество международных направлений в шапке расписания */
.tt-inter {
  grid-column-start: 8;
  grid-column-end: 10;
}

/* Ссылка на вылет/прилёт в расписаниях */
.tt-direction {
  white-space: nowrap;
  grid-column: 10;
  border-radius: 0px 12px 12px 0px;
  text-align: end;
  font-weight: bold;

  a {
    color: white;
    padding: 0px 12px 0px 6px;
  }
}

/* Стиль дива с оборудованием */
.qbox {
  display: block;
  gap: 24px;
}

/* Стиль спана с наименованием оборудования */
.equipment {
  background-color: blueviolet;
  color: whitesmoke;
  font-size: 9pt;
  font-family: monospace;
  border-radius: 4px;
  padding: 0px 2px 0px 2px;
}

/* Тултип оператора в расписании */
.tt-oper-tooltip {
  display: flex;
  align-content: baseline;
  gap: 4px;
  font-size: 11pt;
  font-weight: bold;
  white-space: nowrap;
}

/* Таблица вылета/прилёта */
.timetable {
  width: 90vw;
  margin: 0 auto;
  border-spacing: 0px;
  font-size: 12pt;
  align-items: baseline;

  td:nth-child(1) { text-align: end; }

  td:nth-child(6), td:nth-child(7), td:nth-child(9), td:nth-child(10),
  th:nth-child(4), th:nth-child(6), th:nth-child(7) {
    background: var(--dim-background);
  }

  td:nth-child(6) {  color: var(--time-color); font-weight: bold; }
  td:nth-child(7) {  color: var(--days-color); }
  td, th { padding: 2px 4px 2px 4px; }
}

.normal-date {
  color: var(--normal-date-color);
}

.weak-date {
  color: var(--weak-date-color);
}

.strong-date {
  color: var(--strong-date-color);
  font-weight: bold;
}

/* Карточка аэропорта при поиске */
.airport-card {
  background: var(--dim-background);
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 4px;
}

.days {
  text-align: end;
  padding-right: 12px;
}

/* Стиль метки UTC для аэропортов */
.timezone {
  background: #71a4e2;
}

.timezone, .iata, .icao, .lid, .wlid {
  align-content: center;
  text-align: center;
  color: white;
  font-size: 11pt;
  border-radius: 5px;
  padding: 0px 6px 0px 6px;
}

.airport-loc {
  color: brown;
}

.iata, .icao {
  background-color: mediumseagreen;
}

.lid, .wlid {
  background-color: violet;
}

.alive, .dead {
  font-size: 11pt;
  border-radius: 5px;
  padding: 0px 6px 0px 6px;
}

.alive {
  background-color: olivedrab;
  color: white;
}

.dead {
  background-color: gray;
  color: white;
}
