/* Odwołanie */
body {
  filter: grayscale(90%);
}

#cancelNotice {
  color: #000000;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  padding: 15px;
  margin-top: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Podpis tabeli */
/* .schedule-table caption.schedule-caption {
  caption-side: top;
  display: table-caption;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px;
  color: #000000;
  background-color: var(--color-hover);
  border: 1px solid var(--color-border);
  margin-top: 8px;
} */

/* Zmienne globalne (kolory, cienie) */
:root {
  --color-bg: #f4f4f4;
  --color-surface: #ffffff;
  --color-primary: #003366;
  --color-secondary: #d00000;
  --color-accent: #004080;
  --color-hover: #eef4ff;
  --color-text: #002244;
  --color-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
  --color-error-bg: #ffe5e5;
  --color-error-border: #ff0000;
  --color-error-text: #800000;
  --color-border: #cccccc;
  --sticky-header-top: calc(var(--topbar-height, 60px) + var(--weatherbar-height, 0px));
}

/* Reset, style bazowe */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
}

/* Pasek górny (topbar) */
#topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(to right, #cce5ff, var(--color-surface));
  color: var(--color-primary);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  min-height: 60px;
}

#topbar .left {
  flex: 0 0 auto;
}

#topbar .center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 15px;
}

#topbar .center a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

#topbar .center a:hover {
  color: var(--color-secondary);
  text-decoration: underline;
}

#topbar .right {
  margin-left: auto;
  font-size: 0.9em;
  display: flex;
  gap: 20px;
  align-items: center;
  color: var(--color-primary);
  flex: 0 0 auto;
}

#topbar .right span {
  font-weight: 600;
  color: var(--color-primary);
}

/* Logo */
.logo-composite {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.logo-icon {
  height: 32px;
  width: auto;
}

.logo-text {
  display: flex;
  align-items: baseline;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: 1.4em;
  gap: 8px;
  flex-wrap: wrap;
}

.logo-text .airshow {
  color: var(--color-primary);
  letter-spacing: -1px;
}

.logo-text .airshow .show {
  color: var(--color-secondary);
}

.logo-text .city,
.logo-text .year {
  color: var(--color-primary);
}

/* Pasek pogodowy */
#weatherBar {
  position: sticky;
  top: var(--topbar-height, 60px);
  z-index: 100;
  overflow: hidden;
  white-space: nowrap;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--color-accent);
}

.weather-info {
  display: inline-block;
  padding-left: 100%;
  animation: scrollWeather 20s linear infinite;
}

.weather-info span {
  margin-right: 15px;
  font-weight: 600;
}

.weather-info b {
  color: var(--color-accent);
}

.weather-info .weather-value {
  color: #000000;
  font-weight: normal;
}

@keyframes scrollWeather {
  from { transform: translateX(0%); }
  to   { transform: translateX(-100%); }
}

/* Badge z datą pliku JSON */
#scheduleDateBadge {
  margin-left: 16px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  white-space: nowrap;
}

/* Przycisk Handbook */
.handbook-button {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  background: linear-gradient(to bottom, #ffffff, #e8f0f8);
  color: #013458 !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 0.95rem;
  border: 1px solid #b0c4d6;
  box-shadow: none;
  line-height: 1.4;
}

.handbook-button:hover {
  background: linear-gradient(to bottom, #f0f7ff, #d9e6f2);
  transform: translateY(-1px);
}

.handbook-button:active {
  transform: scale(0.97);
}

/* Tabela harmonogramu */
.schedule-wrapper {
  overflow-x: auto;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.schedule-table {
  width: 100%;
  min-width: 600px;
  margin: 20px auto;
  border-collapse: collapse;
  background-color: var(--color-surface);
  box-shadow: var(--color-shadow);
  font-size: 1rem;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid var(--color-border);
  padding: 12px;
  text-align: center;
  color: var(--color-text);
}

.schedule-table th {
  background-color: var(--color-hover);
  color: var(--color-primary);
  font-weight: bold;
}

.schedule-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Szare tło dla zakończonych lotów (done) – ale nie dla aktywnego 
.schedule-table tbody tr.done-flight:not(.active-flight) {
  background-color: #e0e0e0 !important;
  color: #666 !important;
}*/
.schedule-table tbody tr.done-flight:not(.active-flight) {
  opacity: 0.2;
  transition: opacity 0.25s;
}

/* Aktywny lot */
.schedule-table tbody tr.active-flight {
  background-color: #cde7ff;
  border-left: 5px solid #007acc;
  font-weight: bold;
  transition: background-color 0.5s, border-left 0.5s;
}

/* Ikonki tak/nie */
.yes-icon,
.no-icon {
  vertical-align: middle;
}

/* Komunikat o błędzie */
.schedule-error {
  background-color: var(--color-error-bg);
  color: var(--color-error-text);
  padding: 1rem;
  border: 1px solid var(--color-error-border);
  border-radius: 6px;
  font-weight: bold;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

/* Iframe harmonogramu (ptl.htm) */
#iframeContainer {
  overflow-x: auto;
  text-align: center;
  margin-top: 20px;
}

#refreshingIframe {
  display: inline-block;
  border: none;
  height: 100vw;
  min-width: 100vw;
}

.country-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.country-flag {
  width: 20px;
  height: 14px; 
  object-fit: cover; 
  display: inline-block;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

#clockHMS {
  font-weight: 600;
  color: var(--color-primary);
  opacity: 0.9;
}

.date-badge-select {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.2;
}

/* Przycisk Handbook */
.pilot-date-controls select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none; 
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  background: linear-gradient(to bottom, #ffffff, #e8f0f8);
  color: #013458 !important;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: 0.95rem;
  border: 1px solid #b0c4d6;
  box-shadow: none;
  line-height: 1.4;
}

.pilot-date-controls select:hover {
  background: linear-gradient(to bottom, #f0f7ff, #d9e6f2);
  transform: translateY(-1px);
}

.pilot-date-controls select:focus {
  transform: scale(0.97);
  outline: none;
}

.badge {
  display: inline-block;
  padding: 0.25em 0.35em;
  font-size: 0.65em;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.375rem;
  letter-spacing: 0.4px;
}

/* CIV - niebieski */
.badge-civ {
  background-color: #003366;
  color: #ffffff;
}

/* MIL - oliwkowy */
.badge-mil {
  background-color: #006633;
  color: #ffffff;
}

/* Responsywność */
@media (max-width: 1250px) {
  body.page-schedule .logo-composite {
    justify-content: center;
  }

  .schedule-wrapper {
    padding: 0;
  }

  #scheduleDateBadge,
  .handbook-button {
    margin-top: 0;
  }
  
  #scheduleDateBadge {
    margin-left: 0;
  }

  body.page-schedule #topbar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  body.page-schedule #topbar .center {
    position: static !important;
    transform: none !important;
  }

  body.page-schedule #topbar .left,
  body.page-schedule #topbar .center,
  body.page-schedule #topbar .right {
    width: 100%;
    justify-content: center;
    display: flex;
    flex-wrap: wrap;
  }

  body.page-schedule #topbar .center a {
    margin: 5px 10px;
  }

  body.page-schedule #refreshingIframe {
    height: auto;
    min-height: 1000px;
  }
}

/* Telefony w pionie: topbar + weatherBar zawsze sklejone */
@media (max-width: 600px) and (orientation: portrait) {
  #topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 300;
  }

  .schedule-wrapper {
    padding: 0;
  }

  #weatherBar {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--topbar-height, 60px);
    z-index: 250;
  }

  body.page-schedule {
    padding-top: calc(var(--topbar-height, 60px) + var(--weatherbar-height, 0px) + 40px);
  }
}

@media (min-width: 1251px) {
  #topbar {
    justify-content: center;
    flex-wrap: nowrap;
  }

  #topbar .center {
    position: static !important;
    left: auto;
    transform: none !important;
    white-space: nowrap;
  }

  #topbar .right {
    margin-left: 0;
  }

  .logo-composite {
    justify-content: center;
  }
}
