/* Base Map and Layout Styles */
#ol-map {
  border-radius: 0px;
  box-sizing: border-box; 
  width: 100%; 
  height: 100%;
  max-width: none;
  /* min-height: 734px; */
}

#upload-controls-overlay {
  /* Simplified - only contains recall-url-container now */
  background: rgba(255, 255, 255, 0.95);
  margin-top: 15px;
}

.upload-status-panel {
  display: none;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(140deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 10px 35px rgba(15, 23, 42, 0.08);
  color: #1f2937;
}

.upload-status-panel.is-visible {
  display: flex;
}

.upload-status-panel.is-complete .status-title {
  color: #0f766e;
}

.upload-status-panel.is-error .status-title {
  color: #dc2626;
}

.status-progress {
  position: relative;
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
}

.status-progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.status-progress-ring__bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.2);
  stroke-width: 10;
}

.status-progress-ring__value {
  --progress: 0;
  fill: none;
  stroke: #2563eb;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: calc(339.292 - (var(--progress, 0) / 100) * 339.292);
  transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease;
}

.upload-status-panel.is-complete .status-progress-ring__value {
  stroke: #0f766e;
}

.upload-status-panel.is-error .status-progress-ring__value {
  stroke: #dc2626;
}

.status-progress-label {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1em;
  font-weight: 600;
  color: #1f2937;
}

.status-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1d4ed8;
}

.status-subtitle {
  font-size: 0.85rem;
  color: #4b5563;
}

.status-steps {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.status-step-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #d1d5db;
  color: #1f2937;
  font-size: 0.9em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.status-step--running .status-step-icon {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.25);
  animation: status-step-pulse 1.8s ease infinite;
}

.status-step--completed .status-step-icon {
  background: #0f766e;
  color: #ffffff;
  box-shadow: none;
}

.status-step--error .status-step-icon {
  background: #dc2626;
  color: #ffffff;
}

.status-step-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-step-name {
  font-weight: 600;
  color: #111827;
}

.status-step-message {
  font-size: 0.83rem;
  color: #4b5563;
  white-space: pre-line;
  word-break: break-word;
}

@keyframes status-step-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(29, 78, 216, 0.25);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(29, 78, 216, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(29, 78, 216, 0);
  }
}

@media (max-width: 768px) {
  .upload-status-panel {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .status-progress {
    margin-bottom: 8px;
  }

  .status-step {
    flex-direction: column;
    align-items: center;
  }

  .status-step-body {
    align-items: center;
  }
}

.xc-flightcheck-layout {
  --left-panel-width: clamp(320px, 28vw, 400px);
  --left-toggle-width: 15px;
  --right-panel-width: clamp(300px, 24vw, 360px);
  --right-toggle-width: 15px;
  display: grid;
  grid-template-columns: var(--left-panel-width) var(--left-toggle-width) minmax(0, 1fr);
  width: 100%;
  gap: 0;
  min-height: calc(100vh - 140px);
  min-height: calc(100dvh - 140px);
  position: relative;
}

.xc-flightcheck-layout.left-wide {
  --left-panel-width: clamp(520px, 44vw, 760px);
}

.left-panel {
  display: flex;
  min-height: 100%;
  background: #34495e;
  position: relative;
  grid-column: 1;
}

#left-panel-toggle {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 15px;
  border: none;
  background: #167aad;
  color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease;
  z-index: 25;
  box-shadow: none;
  align-self: stretch;
  grid-column: 2;
}

@media (max-width: 994px) {
  #left-panel-toggle {
    display: none;
  }
  .xc-flightcheck-layout {
    --left-toggle-width: 0px;
  }
}

#left-panel-toggle i {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

#left-panel-toggle:hover {
  background: #9cc61f;
}

.xc-flightcheck-layout.is-left-collapsed {
  --left-panel-width: 0px;
  --left-toggle-width: 0px;
  grid-template-columns: 0 var(--left-toggle-width) minmax(0, 1fr);
}

.xc-flightcheck-layout.is-left-collapsed .left-wrapper {
  display: none;
}

.xc-flightcheck-layout.is-left-collapsed .left-panel {
  display: none;
}

.xc-flightcheck-layout.is-left-collapsed .center-panel {
  grid-column: 1 / -1;
}

.xc-flightcheck-layout.is-left-collapsed #left-panel-toggle {
  position: absolute;
  top: 0px;
  bottom: auto;
  left: 0px;
  width: 55px;
  height: 55px;
  /* border-radius: 50%; */
  background: #aedb34;
  color: #252525;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  align-self: auto;
}

.xc-flightcheck-layout.is-left-collapsed #left-panel-toggle:hover {
  background: #81a322;
  color: #252525;
}

.xc-flightcheck-layout.is-left-collapsed #left-panel-toggle i {
  transform: rotate(180deg);
}

.left-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 0;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

.left-wrapper > #upload-controls-overlay {
  margin-left: 16px;
  margin-right: 16px;
}

.left-wrapper > .left-tabs {
  margin-left: 16px;
  margin-right: 16px;
}

.left-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
  border-radius: 8px;
  margin-top: 8px;
}

.left-tab-button {
  flex: 1 1 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  padding: 8px 10px;
  font-size: 0.85em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.left-tab-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.left-tab-button.is-active {
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
  font-weight: 600;
}

.left-tab-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.45);
  outline-offset: 2px;
}

.tab-section {
  display: none;
  flex: 1 1 auto;
  /* width: 100%; */
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
}

.tab-section.is-active {
  display: block;
}

.center-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  grid-column: 3;
  grid-row: 1;
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas:
    "map-column"
    "chart-panel";
  /* min-height: calc(100vh - 140px); */
  gap: 0;
  position: relative;
}

.map-column {
  grid-area: map-column;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.right-panel-toggle {
  grid-area: right-toggle;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #1f7aa8;
  color: #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s ease, width 0.2s ease;
  width: 100%;
  min-width: var(--right-toggle-width);
  height: 100%;
  box-shadow: none;
}

.right-panel-toggle:hover {
  background: #4faad4;
}

.right-panel-toggle i {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

.right-panel {
  grid-area: right-panel;
  display: flex;
  flex-direction: column;
  background: #f7f9fc;
  border-left: 1px solid rgba(15, 23, 42, 0.12);
  /* min-height: calc(100vh - 140px); */
  min-width: 0;
  overflow: hidden;
}

.right-wrapper {
  display: flex;
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  flex-direction: column;
  gap: 16px;
  /* padding: 18px 16px; */
  min-height: 100%;
  overflow-y: auto;
}

.chart-panel {
  grid-area: chart-panel;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
}

.xc-flightcheck-layout.is-right-collapsed .analysis-layout {
  grid-template-columns: 1fr 0 0;
}

.xc-flightcheck-layout.is-right-collapsed .right-panel {
  display: none;
}

.xc-flightcheck-layout.is-right-collapsed .right-panel-toggle {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 55px;
  height: 55px;
  /* border-radius: 50%; */
  background: #4faad4;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.xc-flightcheck-layout.is-right-collapsed .right-panel-toggle:hover {
  background: #3b8fb6;
  color: #0f172a;
}

.xc-flightcheck-layout.is-right-collapsed .right-panel-toggle i {
  transform: rotate(180deg);
}

body.has-analyzer-fullscreen {
  overflow: hidden;
}

body.has-analyzer-fullscreen .tra-aktivierung-reiter {
  display: none;
}

.xc-flightcheck-layout.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  padding: 0;
  background: #01070f;
  z-index: 2000;
  grid-template-columns: var(--left-panel-width) var(--left-toggle-width) minmax(0, 1fr);
  gap: 0;
}

.xc-flightcheck-layout.is-fullscreen .analysis-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "map-column"
    "chart-panel";
  grid-template-rows: minmax(0, 60vh) minmax(0, 40vh);
}

.xc-flightcheck-layout.is-fullscreen .chart-panel {
  padding: 0;
  height: 100%;
  max-height: none;
  display: flex;
  flex-direction: column;
}

.xc-flightcheck-layout.is-fullscreen .chart-table-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.xc-flightcheck-layout.is-fullscreen .chart-table-container > :not(.altitude-chart-toggles):not(.altitude-chart-wrapper):not(.buddy-card) {
  display: none !important;
}

.xc-flightcheck-layout.is-fullscreen #violation-table-container,
.xc-flightcheck-layout.is-fullscreen #meteo-debug-panel {
  display: none !important;
}

.xc-flightcheck-layout.is-fullscreen .altitude-chart-toggles {
  flex-shrink: 0;
}

.xc-flightcheck-layout.is-fullscreen .altitude-chart-wrapper {
  display: flex;
  gap: 12px;
  align-items: stretch;
  min-height: 0;
  flex: 1;
}

.xc-flightcheck-layout.is-fullscreen #altitude-chart-container {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.xc-flightcheck-layout.is-fullscreen .buddy-card {
  position: absolute;
  top: 54px;
  right: 12px;
  z-index: 35;
  display: block;
  width: min(420px, calc(100% - 24px));
  max-height: calc(100% - 68px);
  overflow: auto;
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 8px;
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.xc-flightcheck-layout.is-fullscreen .buddy-card[hidden] {
  display: none !important;
}

body.glide-mode-active .xc-flightcheck-layout.is-fullscreen #buddy-card:not([hidden]) {
  display: block !important;
}

.xc-flightcheck-layout.is-fullscreen .buddy-card__header {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.58);
  border-bottom-color: rgba(226, 232, 240, 0.16);
}

.xc-flightcheck-layout.is-fullscreen .buddy-card__body {
  padding: 4px 0;
}

.xc-flightcheck-layout.is-fullscreen .buddy-card__section {
  padding: 8px 12px;
  border-bottom-color: rgba(226, 232, 240, 0.12);
}

.xc-flightcheck-layout.is-fullscreen .buddy-card,
.xc-flightcheck-layout.is-fullscreen .buddy-entry__pilot,
.xc-flightcheck-layout.is-fullscreen .buddy-entry__stats,
.xc-flightcheck-layout.is-fullscreen .buddy-entry__glider,
.xc-flightcheck-layout.is-fullscreen .buddy-entry__launch,
.xc-flightcheck-layout.is-fullscreen .buddy-card__message {
  color: #f8fafc;
}

.xc-flightcheck-layout.is-fullscreen .buddy-entry {
  background: rgba(15, 23, 42, 0.28);
  border-bottom-color: rgba(226, 232, 240, 0.12);
}

.xc-flightcheck-layout.is-fullscreen .buddy-entry.is-active {
  background: rgba(14, 165, 233, 0.16);
}

.xc-flightcheck-layout.is-fullscreen #altitude-chart {
  height: 100%;
  width: 100%;
}

.xc-flightcheck-layout.is-fullscreen .map-column,
.xc-flightcheck-layout.is-fullscreen .map-wrapper {
  min-height: 0;
}

.xc-flightcheck-layout.is-fullscreen .map-wrapper {
  height: 100%;
}

.xc-flightcheck-layout.is-fullscreen.is-right-collapsed .analysis-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "map-column"
    "chart-panel";
}

.xc-flightcheck-layout.is-fullscreen.is-right-collapsed .right-panel {
  display: none;
}

.xc-flightcheck-layout.is-fullscreen.is-right-collapsed .right-panel-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  background: #1f7aa8;
}

@media (max-width: 992px) {
  .xc-flightcheck-layout {
    grid-template-columns: 1fr;
  }

  .xc-flightcheck-layout.left-wide {
    --left-panel-width: 100%;
  }

  .left-panel {
    min-height: auto;
    grid-column: auto;
  }

  .center-panel {
    grid-column: 1;
    grid-row: auto;
  }

  .analysis-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "right-panel"
      "map-column"
      "chart-panel";
    min-height: auto;
  }

  .right-panel-toggle {
    display: none;
  }

  .right-panel {
    border-left: none;
    border-top: 1px solid rgba(15, 23, 42, 0.12);
    min-height: auto;
  }

  .xc-flightcheck-layout.is-right-collapsed .right-panel {
    display: flex;
  }
}

@media (max-width: 1200px) {
  .xc-flightcheck-layout {
    --right-panel-width: 300px;
  }
}

@media (min-width: 1440px) {
  .xc-flightcheck-layout.left-wide {
    --right-panel-width: 360px;
  }
}

.tra-aktivierung-reiter {
    background: #34495e;
    color: white;
    font-weight: bold;
    margin-bottom: 0;
}

#track-info, #violation-summary {
    overflow-y: auto;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    max-width: 360px;
}

/* Button styling for direct placement above enhanced-track-info */
#clear-tracks-btn {
  width: calc(100% - 32px) !important;
  margin: 0 16px !important;
  padding: 12px 8px !important;
  border-radius: 0 !important;
  border: none !important;
  background: #aedb34  !important;
  color: #3c3434 !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

#clear-tracks-btn:hover {
  background: #2980b9 !important;
}

#clear-tracks-btn:active {
  background: #21618c !important;
}

/* General UI Elements */
button:hover {
    opacity: 0.9;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.col {
  flex: 1 1 0;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-wrapper,
.chart-and-table {
  position: relative;
  max-width: none;
  max-height: none;
}

.map-wrapper {
  display: flex;
  width: 100%;
  flex: 1 1 auto;
  min-height: 400px;
  background: #f5f5f5;
  min-width: 0;
}

.map-touch-toggle {
  position: fixed;
  top: -9999px;
  left: -9999px;
  z-index: 4000;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(33, 37, 41, 0.85);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
  visibility: hidden;
}

.map-touch-toggle:focus-visible {
  outline: 2px solid #66afe9;
  outline-offset: 2px;
}

.map-touch-toggle:hover {
  background: rgba(33, 37, 41, 0.9);
}

.map-touch-toggle__icon {
  display: inline-flex;
  font-size: 0.95rem;
}

.map-wrapper.map-scroll-mode .map-touch-toggle {
  background: rgba(13, 110, 253, 0.9);
}

.map-wrapper.map-scroll-mode .map-touch-toggle:hover {
  background: rgba(13, 110, 253, 1);
}

.map-wrapper.map-scroll-mode #ol-map {
  pointer-events: none;
}

.map-wrapper.map-scroll-mode #ol-map .ol-viewport {
  touch-action: auto !important;
}

/* Common Text Styles */
.section-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #111;
}

.section-title-danger {
  color: #e74c3c;
  margin-bottom: 10px;
  font-weight: 700;
}

.panel-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #0c5460;
}

.panel-body-small {
  font-size: 0.8em;
  color: #0c5460;
}

.muted {
  font-size: 0.9em;
  color: #666;
}

.muted-italic {
  color: #999;
  font-style: italic;
}

.text-right { text-align: right; }
.hidden { display: none !important; }

/* Form Elements */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.checkbox-row[hidden],
.glide-overlay-flight-list[hidden],
[hidden].checkbox-row {
  display: none !important;
}

.checkbox-row.is-disabled {
  opacity: 0.55;
}

.checkbox-row--nested {
  margin-left: 28px;
}

.tra-admin-switch {
  --switch-off: #64748b;
  --switch-on: #22c55e;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.6rem;
  cursor: pointer;
  user-select: none;
  color: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  vertical-align: middle;
}

.tra-admin-switch__input {
  position: absolute !important;
  display: block !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

.tra-admin-switch__track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  border-radius: 999px;
  background: var(--switch-off);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.16);
  transition: background 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
}

.tra-admin-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
  transition: transform 0.18s ease;
}

.tra-admin-switch__input:checked + .tra-admin-switch__track {
  background: var(--switch-on);
}

.tra-admin-switch__input:checked + .tra-admin-switch__track .tra-admin-switch__thumb {
  transform: translateX(18px);
}

.tra-admin-switch__state {
  min-width: 1.35rem;
  color: #93c5fd;
  font-size: 0.74rem;
  font-weight: 800;
}

.tra-admin-switch__state::after {
  content: attr(data-off);
}

.tra-admin-switch__input[data-switch-state="hidden"] ~ .tra-admin-switch__state {
  display: none;
}

.tra-admin-switch__input:checked ~ .tra-admin-switch__state::after {
  content: attr(data-on);
}

.tra-admin-switch__input:focus-visible + .tra-admin-switch__track {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.26), inset 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.tra-admin-switch__input:disabled + .tra-admin-switch__track {
  opacity: 0.62;
}

.tra-admin-switch--compact {
  gap: 0.4rem;
}

.tra-admin-switch--compact .tra-admin-switch__track {
  width: 38px;
  height: 22px;
  flex-basis: 38px;
}

.tra-admin-switch--compact .tra-admin-switch__thumb {
  width: 16px;
  height: 16px;
}

.tra-admin-switch--compact .tra-admin-switch__input:checked + .tra-admin-switch__track .tra-admin-switch__thumb {
  transform: translateX(16px);
}

.checkbox-row .tra-admin-switch {
  width: 100%;
}

.checkbox-row--with-toggle > .tra-admin-switch {
  flex: 1 1 auto;
}

.tra-admin-switch .checkmark {
  display: none !important;
}

body.dark-mode .tra-admin-switch {
  --switch-off: #475569;
  --switch-on: #22c55e;
}

.checkbox-row .trackline-toggle--compact {
  margin-left: auto;
}

.trackline-toggle--compact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.trackline-toggle--compact:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}

.trackline-toggle--compact.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.trackline-toggle--compact.is-disabled .switch-rail {
  pointer-events: none;
}

.trackline-toggle--compact .trackline-switch--compact .switch-rail {
  width: 100px;
  height: 26px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.trackline-toggle--compact .trackline-switch--compact .switch-option {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.radio-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Notes and Panels */
.note {
  margin-top: 8px;
  margin-bottom: 15px;
  padding: 8px;
  border-radius: 4px;
  font-size: 0.85em;
}

.note-info {
  background: #e8f4fd;
  color: #0066cc;
  border: 1px solid #cfe8ff;
}

.note-warning {
  background: #fff7e6;
  color: #e67e22;
  border: 1px solid #ffe0b3;
}

.panel {
  font-size: 0.9em;
  color: #666;
  min-height: 60px;
}

.panel-light { background: #f8f9fa; }

#display-settings-content {
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.22);
}

#display-settings-content label,
#display-settings-content .track-coloring-options label,
#display-settings-content .setting-group h4,
#display-settings-content .checkbox-row {
  color: #ebdcdc;
}

#display-settings-content input[type="checkbox"],
#display-settings-content input[type="radio"] {
  accent-color: #2980b9 ;
  cursor: pointer;
}

#display-settings-content select {
  background: rgba(17, 29, 46, 0.65);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.25);
}

#display-settings-content hr {
  border-top-color: rgba(255, 255, 255, 0.2) !important;
}

#display-settings-content #color-legend {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

.display-settings-fullscreen-btn {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(17, 29, 46, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f9fafb;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.display-settings-fullscreen-btn:hover {
  background: rgba(17, 29, 46, 0.95);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.display-settings-fullscreen-btn.is-active {
  background: rgba(6, 132, 160, 0.95);
  border-color: rgba(255, 255, 255, 0.55);
  color: #04121c;
}

.panel-warn {
  background: #fff3cd;
  border-color: #ffeaa7;
}

.panel-info {
  background: #e8f4fd;
  border-color: #bee5eb;
}

.actions { margin-top: 12px; }

/* Buttons */
.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.1;
}

.btn-primary { background: #34495e; color: #fff; }
.btn-secondary { background: #95a5a6; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }

/* Map Elements */
.ol-map {
  width: 100%;
  height: 750px;
  background: #eef1f5;
}

.ol-info-box {
  position: absolute;
  top: 0;
  left: 25px;
  max-width: 420px;
  padding: 12px;
  z-index: 6000;
  font-size: 0.9em;
  pointer-events: auto;
}

.ol-info-box__close {
  position: absolute;
  top: 3px;
  right: -13px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 28%;
  background: #e74c3c;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ol-info-box .track-info-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
  padding: 12px 14px 10px;
  color: #111827;
}

.ol-info-box .track-info-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.ol-info-box .track-info-pilot {
  font-size: 1rem;
  font-weight: 600;
  color: #0f172a;
}

.ol-info-box .track-info-glider {
  font-size: 0.9rem;
  color: #475569;
}

.ol-info-box .track-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 14px;
  font-size: 0.85rem;
}

.ol-info-box .track-info-grid strong {
  color: #0f172a;
  font-weight: 600;
}

.ol-info-box .track-info-point {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(15, 23, 42, 0.15);
  font-size: 0.84rem;
  color: #0f172a;
}

.ol-info-box .track-info-point small {
  color: #475569;
  display: inline-block;
  margin-left: 4px;
  font-size: 0.78rem;
}

.ol-info-box .track-media-info {
  min-width: min(360px, calc(100vw - 72px));
  padding: 0;
  overflow: hidden;
}

.ol-info-box .track-media-info__frame {
  margin-bottom: 0;
  border-radius: 0;
  overflow: hidden;
  background: #e2e8f0;
}

.ol-info-box .track-media-info__image-link {
  display: block;
  color: inherit;
  cursor: zoom-in;
}

.ol-info-box .track-media-info__frame img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

html.flight-media-lightbox-open,
html.flight-media-lightbox-open body {
  overflow: hidden;
}

.flight-media-lightbox[hidden] {
  display: none;
}

.flight-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 23, 0.88);
}

.flight-media-lightbox__inner {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.flight-media-lightbox__image {
  display: block;
  width: auto;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 96px);
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.42);
}

.flight-media-lightbox__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.flight-media-lightbox__close:hover,
.flight-media-lightbox__close:focus-visible {
  background: rgba(15, 23, 42, 0.96);
  outline: 2px solid rgba(255, 255, 255, 0.78);
  outline-offset: 2px;
}

.flight-media-lightbox__caption {
  position: fixed;
  right: 16px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 16px;
  max-width: min(920px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
  font-size: 0.95rem;
  line-height: 1.45;
  text-align: center;
}

.ol-info-box .track-media-info__meta {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.ol-info-box .track-media-info__caption {
  font-size: 0.92rem;
  font-weight: 600;
  color: #0f172a;
}

.ol-info-box .track-media-info__inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #334155;
}

.ol-info-box .track-media-info__inline-item {
  white-space: nowrap;
}

.ol-info-box .track-media-info__inline-link {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.ol-info-box .track-media-info__inline-link:hover {
  text-decoration: underline;
}

.ol-info-box .track-media-info__meta-row {
  font-size: 0.82rem;
  color: #334155;
}

.ol-info-box .track-media-info__meta-row strong {
  color: #0f172a;
}

.ol-info-box .track-media-info__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.ol-info-box .track-media-info__actions a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.ol-info-box .track-media-info__actions a:hover {
  text-decoration: underline;
}

.ol-info-box.ol-info-box--airspace-summary {
  max-width: min(410px, calc(100vw - 48px));
  max-height: none;
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.ol-info-box .airspace-summary-card {
  position: relative;
  width: min(410px, calc(100vw - 48px));
  min-width: 0;
  margin: 0;
  padding: 10px 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(48, 58, 51, 0.98) 0%, rgba(34, 47, 50, 0.98) 100%);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.ol-info-box.ol-info-box--airspace-summary .ol-info-box__close {
  top: 7px;
  right: 7px;
}

.ol-info-box .airspace-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin-bottom: 6px;
  padding-right: 34px;
}

.ol-info-box .airspace-summary-header h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
}

.ol-info-box .airspace-summary-table-wrap {
  overflow: visible;
  border-radius: 4px;
  background: rgba(250, 250, 248, 0.96);
}

.ol-info-box .airspace-summary-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: #475569;
  font-size: 0.72rem;
}

.ol-info-box .airspace-summary-table th,
.ol-info-box .airspace-summary-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: normal;
}

.ol-info-box .airspace-summary-table th:nth-child(2),
.ol-info-box .airspace-summary-table td:nth-child(2) {
  width: 36px;
}

.ol-info-box .airspace-summary-table th:nth-child(3),
.ol-info-box .airspace-summary-table td:nth-child(3) {
  width: 158px;
}

.ol-info-box .airspace-summary-table th {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ol-info-box .airspace-summary-table tr:last-child td {
  border-bottom: 0;
}

.ol-info-box .airspace-summary-table tr.is-selected {
  background: rgba(255, 215, 0, 0.15);
  box-shadow: inset 4px 0 0 #ffd700;
}

.ol-info-box .airspace-summary-table tr.is-selected td {
  color: #ffffff;
  background: rgba(92, 89, 42, 0.88);
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.ol-info-box .airspace-summary-name {
  color: #c0392b;
  font-weight: 800;
  line-height: 1.2;
}

.ol-info-box .airspace-summary-table tr.is-selected .airspace-summary-name {
  color: #ffffff;
}

.ol-info-box .airspace-summary-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 6px;
  margin-top: 2px;
  color: #64748b;
  font-size: 0.67rem;
  line-height: 1.15;
}

.ol-info-box .airspace-summary-table tr.is-selected .airspace-summary-limits {
  color: rgba(255, 255, 255, 0.72);
}

.ol-info-box .airspace-summary-type {
  color: #334155;
  font-weight: 700;
}

.ol-info-box .airspace-summary-table tr.is-selected .airspace-summary-type {
  color: #ffffff;
}

.ol-info-box .airspace-summary-status {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 5px;
}

.ol-info-box .airspace-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a3a3a3;
  flex: 0 0 7px;
  margin-top: 4px;
}

.ol-info-box .airspace-status-dot.is-active {
  background: #22c55e;
}

.ol-info-box .airspace-status-dot.is-inactive {
  background: #94a3b8;
}

.ol-info-box .airspace-status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 1px 6px;
  border-radius: 3px;
  background: #d1d5db;
  color: #475569;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.3;
}

.ol-info-box .airspace-summary-status-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}

.ol-info-box .airspace-status-time {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #8a8f98;
  font-size: 0.68rem;
  line-height: 1.15;
  overflow-wrap: normal;
  word-break: keep-all;
}

.ol-info-box .airspace-summary-table tr.is-selected .airspace-status-pill {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.ol-info-box .airspace-summary-table tr.is-selected .airspace-status-time {
  color: rgba(255, 255, 255, 0.82);
}

/* Color Legend */
#color-legend {
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    font-size: 0.75em;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    line-height: 1.3;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-item--note {
    color: #555;
    margin-bottom: 4px;
}

.legend-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.legend-title--subsection {
    margin-top: 4px;
    font-size: 0.85em;
}

.legend-color-bar {
    width: 12px;
    height: 3px;
    margin-right: 6px;
    border-radius: 1px;
    flex-shrink: 0;
}

.legend-color-bar--dynamic {
    background: var(--legend-color, #64748b);
}

.legend-item--nested {
    margin-left: 10px;
}

.legend-item__label--small {
    font-size: 0.8em;
}

/* Display Settings Overlay */
#display-settings-overlay {
    position: absolute !important;
    top: -38px !important;
    right: 0px !important;
    z-index: 1000 !important;
    background: #aedb34 !important;
    backdrop-filter: blur(5px);
    min-width: 180px;
    max-width: 215px;
    height: 38px;
    transition: background-color 0.2s ease;
}


/* When collapsed */
#display-settings-content[style*="display: none"] {
    max-height: 0;
    padding: 0 12px;
}

/* Collapsed state - override min-width */
#display-settings-overlay:has(#display-settings-content[style*="display: none"]) {
    min-width: 60px;
}

/* Fallback for browsers that don't support :has() */
.display-settings-collapsed {
    min-width: 60px !important;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #enhanced-track-info {
        width: 300px;
    }
    
    #display-settings-overlay {
        right: 0px !important;
        top: 0px !important;
        min-width: 160px;
        max-width: 200px;
    }
}

@media (max-width: 768px) {
    .map-wrapper {
        flex-direction: column-reverse;
        height: auto;
    }

    .map-touch-toggle {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.24);
        padding-left: 14px;
        padding-right: 14px;
    }

    .ol-map {
        height: 500px;
        width: 100%;
        border-left: 2px solid #34495e;
        border-right: 2px solid #34495e;
    }
    
    #enhanced-track-info {
        width: 100%;
        height: auto;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    #display-settings-overlay {
        right: 0px !important;
        top: 0px !important;
        min-width: 140px;
        max-width: 180px;
    }
    
    .display-settings-header {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    
    #display-settings-content {
        padding: 10px;
        font-size: 0.85em;
    }
}
    
    .display-settings-header {
        padding: 8px 10px;
        font-size: 0.9em;
    }
    
    #display-settings-content {
        padding: 10px;
        font-size: 0.85em;
    }
