/*! Copyright (c) 2025-2026 Markus Schüssler. All rights reserved.
 * SPDX-License-Identifier: LicenseRef-Markus-Schuessler-Proprietary; see repository LICENSE.
 */
/* Enhanced Track Info */
.enhanced-track-info {
    background: transparent; 
    color: white;
    padding: 0; 
    border-radius: 0; /* Remove border radius for sidebar */
    margin-bottom: 0;
    box-shadow: none; 
    border: none; 
    height: 100%; /* Full height */
}

/* Remove the absolute positioning specific styles */
#enhanced-track-info {
    /* Remove filter drop-shadow when in sidebar */
    filter: none;
}

/* Accordion Container - adjusted for sidebar */
.accordion-container {
    background: #34495e;
    border-radius: 0; /* No rounded corners for sidebar */
    border: none; /* Remove border for cleaner look */
    box-shadow: none; /* Remove shadow in sidebar */
    overflow: hidden;
    /* height: 100%; */
}

/* Accordion Card */
.accordion-card {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-card:last-child {
    border-bottom: none;
}

/* Accordion Header */
.accordion-header {
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    background: rgba(255, 255, 255, 0.05);
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.1);
}

.accordion-header.active {
    background: rgba(255, 255, 255, 0.15);
}

/* Accordion Title */
.accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.95em;
    color: #74b9ff;
}

.accordion-title i {
    width: 20px;
    text-align: center;
    color: #ffeaa7;
}

.violation-quickview {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.violation-chip {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72em;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.08);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.violation-chip.is-ok {
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.6);
    background: rgba(40, 167, 69, 0.15);
}

.violation-chip.is-violation {
    color: #ffffff;
    border-color: rgb(231, 77, 60);
    background: rgba(231, 77, 60, 0.539);
}

.violation-chip.is-missing {
    color: #95a5a6;
    border-color: rgba(149, 165, 166, 0.6);
    background: rgba(149, 165, 166, 0.18);
}

/* Accordion Chevron */
.accordion-chevron {
    transition: transform 0.3s ease;
    color: #74b9ff;
    font-size: 0.9em;
}

.accordion-chevron.rotated {
    transform: rotate(180deg);
}

/* Accordion Content */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.is-open {
    max-height: none;
    overflow-y: visible;
}

.accordion-content[style*="display: block"] {
    max-height: none;
    overflow-y: visible;
}

/* Violation Card Special Styling */

.accordion-card.violation-card.gps-warning .accordion-header {
    background: rgba(149, 165, 166, 0.18);
}

.accordion-card.violation-card.gps-warning .accordion-header:hover {
    background: rgba(149, 165, 166, 0.26);
}

.accordion-card.violation-card.gps-warning .accordion-header.active {
    background: rgba(149, 165, 166, 0.32);
}

.accordion-card.violation-card.gps-warning .accordion-title,
.accordion-card.violation-card.gps-warning .accordion-title i,
.accordion-card.violation-card.gps-warning .accordion-chevron {
    color: #95a5a6;
}

/* Clean Flight Violation Card (Green) */
.accordion-card.violation-card.clean-flight .accordion-header {
    background: rgba(40, 167, 69, 0.15);
}

.accordion-card.violation-card.clean-flight .accordion-header:hover {
    background: rgba(40, 167, 69, 0.25);
}

.accordion-card.violation-card.clean-flight .accordion-header.active {
    background: rgba(40, 167, 69, 0.35);
}

.accordion-card.violation-card.clean-flight .accordion-title,
.accordion-card.violation-card.clean-flight .accordion-title i,
.accordion-card.violation-card.clean-flight .accordion-chevron {
    color: #28a745;
}

/* Pending Violation Card (Neutral Blue) */
.accordion-card.violation-card.pending .accordion-header {
    background: rgba(52, 152, 219, 0.18);
}

.accordion-card.violation-card.pending .accordion-header:hover {
    background: rgba(52, 152, 219, 0.26);
}

.accordion-card.violation-card.pending .accordion-header.active {
    background: rgba(52, 152, 219, 0.34);
}

.accordion-card.violation-card.pending .accordion-title,
.accordion-card.violation-card.pending .accordion-title i,
.accordion-card.violation-card.pending .accordion-chevron {
    color: #74b9ff;
}

/* Card Body in Accordion */
.accordion-content .card-body {
    padding: 12px 16px;
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.2);
}

.accordion-card.violation-card.pending .accordion-content .card-body {
    background: rgba(52, 152, 219, 0.12);
    color: rgba(255, 255, 255, 0.92);
}

.accordion-card.violation-card.clean-flight .accordion-content .card-body {
    background: rgba(40, 167, 69, 0.16);
    color: rgba(255, 255, 255, 0.95);
}

.accordion-card.violation-card.gps-warning .accordion-content .card-body {
    background: rgba(149, 165, 166, 0.12);
    color: rgba(255, 255, 255, 0.92);
}

/* Independent GPX/TCX tracks: visual stats only, never part of the flight profile. */
.companion-track-stats {
    display: grid;
    gap: 10px;
}

.companion-track-stats__note {
    margin: 0;
    padding: 8px 10px;
    border: 1px solid rgba(116, 185, 255, 0.24);
    border-radius: 7px;
    background: rgba(116, 185, 255, 0.09);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.82rem;
    line-height: 1.35;
}

.companion-track-stats__track {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.companion-track-stats__track + .companion-track-stats__track {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.companion-track-stats__identity {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.companion-track-stats__identity > i {
    flex: 0 0 28px;
    width: 28px;
    color: #ffeaa7;
    text-align: center;
}

.companion-track-stats__identity > div {
    min-width: 0;
}

.companion-track-stats__name,
.companion-track-stats__meta {
    overflow-wrap: anywhere;
}

.companion-track-stats__name {
    margin: 0;
    color: inherit;
    font-size: 0.9rem;
    line-height: 1.25;
}

.companion-track-stats__meta {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.companion-track-stats__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
    gap: 6px;
    margin: 0;
}

.companion-track-stats__metric {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.055);
}

.companion-track-stats__metric dt {
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.7rem;
    line-height: 1.25;
}

.companion-track-stats__metric dd {
    margin: 3px 0 0;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 750;
    line-height: 1.2;
}

.accordion-card.violation-card.has-violations .accordion-header {
    background: rgba(231, 76, 60, 0.18);
}

.accordion-card.violation-card.has-violations .accordion-header:hover {
    background: rgba(231, 76, 60, 0.26);
}

.accordion-card.violation-card.has-violations .accordion-header.active {
    background: rgba(231, 76, 60, 0.34);
}

.accordion-card.violation-card.has-violations .accordion-title,
.accordion-card.violation-card.has-violations .accordion-title i,
.accordion-card.violation-card.has-violations .accordion-chevron {
    color: #e74c3c;
}

.accordion-card.violation-card.has-violations .accordion-content .card-body {
    background: rgba(231, 76, 60, 0.12);
    color: rgba(255, 255, 255, 0.94);
}

/* Stats Tabs */
.stats-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #34495e; 
    border-radius: 8px 8px 0 0; 
    border-bottom: none;
    padding: 12px 12px 0 12px; 
    border: 1px solid rgba(255, 255, 255, 0.2); 
    border-bottom: none; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
}

.tab-button {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 8px 14px;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    margin-right: 2px;
    position: relative;
    z-index: 2;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    font-weight: 600;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Stats Section */
.stats-section {
    background: #34495e; 
    border-radius: 0 0 8px 8px; 
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15); 
    border-top: none;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); 
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.overview-card {
    background: rgb(11 36 52 / 91%);
    border-radius: 6px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.overview-card:hover {
    background: rgba(16, 59, 86, 0.91);
    transform: translateY(-1px);
}

.violation-card {
    background: rgb(79 34 34 / 92%);
    border-color: rgba(255, 255, 255, 0.1);
}

.violation-card:hover {
    background: rgba(112, 49, 49, 0.92);
    border-color: rgba(255, 255, 255, 0.37);
}



.violation-card .card-header {
  color: #ffffff !important;
  border-bottom: 1px solid rgba(220, 53, 69, 0.4);
}



.violation-card.clean-flight {
  background: rgba(40, 167, 69, 0.25) !important;
  border: 1px solid rgba(40, 167, 69, 0.4) !important;
}


.violation-card.clean-flight:hover {
  background: rgba(40, 167, 69, 0.35) !important;
}

.violation-card.clean-flight .card-header {
  color: #ffffff !important;
  border-bottom: 1px solid rgba(40, 167, 69, 0.4);
}

/* Card Elements */
.card-header {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 6px;
    color: #74b9ff;
}

.card-body {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.9);
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row--divider {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.info-row--divider-soft {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
}

.info-row--spaced {
    margin-top: 6px;
}

.info-row--indented {
    padding-left: 20px;
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
}

.info-row--pilot {
    align-items: flex-start;
}

.info-row i {
    width: 16px;
    text-align: center;
    opacity: 0.8;
    color: #ffeaa7;
    min-width: 16px;
}

.info-row strong {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.info-row--action {
    flex-wrap: wrap;
    align-items: center;
}

.trackinfo-pilot-name {
    display: inline;
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
    letter-spacing: 0;
}

.trackinfo-pilot-link,
.trackinfo-pilot-username-link {
    display: inline;
    margin-left: 2px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #aedb34;
    font-weight: 700;
    letter-spacing: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.trackinfo-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 0;
    border: 0;
    background: #aedb34;
    color: #3c3434;
    font-weight: 700;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.trackinfo-pilot-link,
.trackinfo-pilot-username-link {
    box-shadow: none;
    transition: color 160ms ease;
}

.trackinfo-action-button:hover {
    background: #9ac52d;
    color: #3c3434;
    text-decoration: none;
    box-shadow: none;
}

.trackinfo-pilot-link:hover,
.trackinfo-pilot-username-link:hover {
    background: transparent;
    color: #d9f99d;
    text-decoration: underline;
}

.trackinfo-action-button:focus-visible {
    outline: 2px solid rgba(116, 185, 255, 0.72);
    outline-offset: 2px;
}

.trackinfo-pilot-link:focus-visible,
.trackinfo-pilot-username-link:focus-visible {
    border-radius: 2px;
    outline: 2px solid rgba(116, 185, 255, 0.72);
    outline-offset: 2px;
}

.trackinfo-flight-link {
    margin-left: 2px;
}

.info-row__icon--primary {
    color: #17a2b8 !important;
}

.info-row__icon--success {
    color: #28a745 !important;
}

.info-row__icon--danger {
    color: #e74c3c !important;
}

.info-row__icon--warning {
    color: #fd7e14 !important;
}

.info-row__icon--muted {
    color: #6c757d !important;
}

.info-row__icon--accent {
    color: #ffc107 !important;
}

.info-row__icon--notice {
    color: #74b9ff !important;
}

.info-row__icon--neutral {
    color: #95a5a6 !important;
}

.info-row__icon--left {
    color: #007bff !important;
}

.info-row__icon--dynamic {
    color: inherit;
}

.info-row.info-note {
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.85);
    margin-left: 24px;
    line-height: 1.4;
}

.trackinfo-pilot-identity {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.trackinfo-pilot-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1.2;
}

.trackinfo-pilot-flag {
    width: 16px;
    height: 11px;
    max-width: 16px;
    max-height: 11px;
    min-width: 16px;
    inline-size: 16px;
    block-size: 11px;
    flex: 0 0 16px;
    display: inline-block;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
    object-fit: cover;
}

.info-row small {
    font-size: 0.9em;
    opacity: 0.9;
    line-height: 1.2;
}

.info-row__muted {
    color: #6c757d;
    font-size: 0.9em;
}

.info-row__muted + .info-row__muted {
    margin-left: 8px;
}

.info-row__swatch {
    display: inline-block;
    width: 12px;
    height: 3px;
    margin-right: 6px;
    border-radius: 1px;
    background: var(--swatch-color, transparent);
    flex-shrink: 0;
}

.info-row__swatch[data-swatch-color] {
    background: var(--swatch-color, transparent);
}

.info-section-heading {
    margin: 16px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

.info-section-heading:first-child {
    margin-top: 0;
}

.info-section-heading--info {
    color: #17a2b8;
    border-bottom-color: rgba(23, 162, 184, 0.3);
}

.info-section-heading--success {
    color: #28a745;
    border-bottom-color: rgba(40, 167, 69, 0.3);
}

.info-section-heading--accent {
    color: #ffc107;
    border-bottom-color: rgba(255, 193, 7, 0.3);
}

/* Stats Title */
.stats-title {
    font-size: 1.05em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 6px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 8px;
    margin-top: 8px;
}

.performance-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}

/* Stat Items */
.stat-item {
  background: rgba(255, 255, 255, 0.08);
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
  position: relative;
  padding-bottom: 24px; 
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.stat-item strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.8em;
    opacity: 0.9;
}

.stat-item .click-hint {
    position: absolute;
    bottom: 3px;
    right: 5px;
    font-size: 0.65em;
    opacity: 0.6;
    color: #ffeaa7;
    pointer-events: none;
}

/* Airspace FL Calculation Cards */
.airspace-fl-calc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.airspace-fl-calc-card {
    border: 1px solid rgba(116, 185, 255, 0.24);
    background: rgba(15, 23, 42, 0.28);
    border-radius: 6px;
    padding: 12px;
}

.airspace-fl-calc-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.airspace-fl-calc-card__title {
    font-size: 0.96em;
    font-weight: 700;
    color: #ffffff;
}

.airspace-fl-calc-card__subtitle {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82em;
}

.airspace-fl-calc-card__clearance {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 234, 167, 0.12);
    border: 1px solid rgba(255, 234, 167, 0.25);
}

.airspace-fl-calc-card--penetration {
    border-color: rgba(255, 107, 107, 0.38);
    background: rgba(127, 29, 29, 0.18);
}

.airspace-fl-calc-card--penetration .airspace-fl-calc-card__clearance {
    background: rgba(255, 107, 107, 0.16);
    border-color: rgba(255, 107, 107, 0.36);
}

.airspace-fl-calc-card__clearance span,
.airspace-fl-calc-grid span,
.airspace-fl-reference__row > span {
    display: block;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.72em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.airspace-fl-calc-card__clearance strong {
    display: block;
    margin-top: 2px;
    color: #ffeaa7;
    font-size: 1.05em;
}

.airspace-fl-calc-card__clearance-secondary {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8em;
    font-weight: 700;
}

.airspace-fl-calc-card--penetration .airspace-fl-calc-card__clearance strong {
    color: #ff6b6b;
}

.airspace-fl-calc-card__clearance-secondary--penetration {
    color: #ffb4b4;
}

.airspace-fl-calc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.airspace-fl-calc-grid div,
.airspace-fl-reference__row {
    min-width: 0;
    padding: 7px 8px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.055);
}

.airspace-fl-calc-grid strong,
.airspace-fl-reference__row strong {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.83em;
    overflow-wrap: anywhere;
}

.airspace-fl-calc-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.airspace-fl-calc-card__meta span {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(116, 185, 255, 0.12);
    border: 1px solid rgba(116, 185, 255, 0.22);
    color: rgba(233, 246, 255, 0.92);
    font-size: 0.72em;
}

.airspace-fl-reference {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 10px;
}

.airspace-fl-reference__row--blend {
    display: block;
}

.airspace-fl-reference__blend-summary {
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.82em;
    font-weight: 700;
}

.airspace-fl-reference__station-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 6px;
}

.airspace-fl-reference__station {
    padding: 6px 7px;
    border-radius: 5px;
    border: 1px solid rgba(116, 185, 255, 0.16);
    background: rgba(15, 23, 42, 0.2);
}

.airspace-fl-reference__station-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    color: rgba(255, 255, 255, 0.94);
    font-size: 0.82em;
    font-weight: 700;
}

.airspace-fl-reference__station-pressure {
    color: #ffeaa7;
    white-space: nowrap;
}

.airspace-fl-reference__station-meta,
.airspace-fl-reference__station-more {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 0.74em;
}

/* Weather Station Cards */
.weather-station-cards-section {
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.weather-station-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
}

.weather-station-section-header .accordion-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-station-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.98em;
    font-weight: 600;
    color: inherit;
    text-transform: none;
    letter-spacing: 0.01em;
}

.weather-station-section-title i {
    color: #ffeaa7;
}

.weather-station-section-header:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(116, 185, 255, 0.35);
}

.weather-station-section-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(116, 185, 255, 0.15);
    border: 1px solid rgba(116, 185, 255, 0.35);
    font-size: 0.72em;
    color: rgba(233, 246, 255, 0.9);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.weather-station-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weather-station-cards-section.is-collapsed .weather-station-cards {
    display: none;
}

.weather-station-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    color: rgba(255, 255, 255, 0.92);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.weather-station-card:hover {
    transform: translateY(-2px);
    border-color: rgba(116, 185, 255, 0.4);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
}

.weather-station-card.is-active {
    border-color: rgba(116, 185, 255, 0.9);
    box-shadow: 0 0 0 2px rgba(116, 185, 255, 0.25);
}

.weather-station-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    outline: none;
}

.weather-station-card__header:focus-visible {
    box-shadow: 0 0 0 2px rgba(116, 185, 255, 0.45);
}

.weather-station-card__header-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weather-station-card__header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weather-station-card__title {
    font-size: 1.05em;
    font-weight: 600;
    color: #ffffff;
}

.weather-station-card__subtitle {
    font-size: 0.82em;
    color: rgba(255, 255, 255, 0.65);
}

.weather-station-card__turnpoint-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(116, 185, 255, 0.18);
    border: 1px solid rgba(116, 185, 255, 0.45);
    font-size: 0.68em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #d6ecff;
}

.weather-station-card__badge {
    align-self: flex-start;
    background: rgba(116, 185, 255, 0.18);
    color: #d6ecff;
    border: 1px solid rgba(116, 185, 255, 0.45);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.68em;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.weather-station-card__action {
    background: rgba(116, 185, 255, 0.16);
    border: 1px solid rgba(116, 185, 255, 0.45);
    color: #eaf5ff;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.weather-station-card__action:hover,
.weather-station-card__action:focus-visible {
    background: rgba(116, 185, 255, 0.32);
    border-color: rgba(116, 185, 255, 0.7);
    transform: translateY(-1px);
}

.weather-station-card__action i {
    font-size: 0.95em;
}

.weather-station-card__chevron {
    font-size: 0.95em;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.25s ease;
}

.weather-station-card__chevron.rotated {
    transform: rotate(180deg);
}

.weather-station-cards-section.is-collapsed .accordion-chevron {
    transform: rotate(0deg);
}

.weather-station-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.86em;
}

.weather-station-card.is-collapsed .weather-station-card__body[hidden] {
    display: none;
}

.weather-station-card__metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.weather-station-card__metric {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weather-station-card__metric .metric-label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.weather-station-card__metric .metric-value {
    font-size: 1.05em;
    font-weight: 600;
    color: #ffffff;
    word-break: break-word;
}

.weather-station-card__turnpoints {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.72);
}

.turnpoints-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72em;
    color: rgba(182, 210, 255, 0.85);
}

.turnpoints-values {
    font-size: 0.95em;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.turnpoints-empty {
    color: rgba(255, 255, 255, 0.45);
}

.turnpoint-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 8px;
    background: rgba(116, 185, 255, 0.12);
    border: 1px solid rgba(116, 185, 255, 0.32);
    font-size: 0.85em;
    color: #eaf5ff;
    line-height: 1.4;
}

.weather-station-card__charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.weather-station-card__charts canvas {
    display: block;
    width: 100%;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.weather-station-card__labels {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
}

.weather-station-card__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82em;
}

.weather-station-card__table th,
.weather-station-card__table td {
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: right;
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.04);
    font-variant-numeric: tabular-nums;
}

.weather-station-card__table th:first-child,
.weather-station-card__table td:first-child {
    text-align: left;
}

.weather-station-card__table tbody tr:hover {
    background: rgba(116, 185, 255, 0.12);
}

.weather-station-card__labels strong {
    font-weight: 600;
    color: #eaf5ff;
}

.weather-station-card.is-expanded {
    border-color: rgba(116, 185, 255, 0.45);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.25);
}

/* Highlights */
.highlight-positive {
    background: rgba(46, 204, 113, 0.15) !important;
    border-color: rgba(46, 204, 113, 0.3) !important;
}

.highlight-negative {
    background: rgba(231, 76, 60, 0.15) !important;
    border-color: rgba(231, 76, 60, 0.3) !important;
}

.highlight-speed {
    background: rgba(52, 152, 219, 0.15) !important;
    border-color: rgba(52, 152, 219, 0.3) !important;
}

/* Altitude Analysis */
.altitude-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.altitude-gain-item,
.altitude-loss-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px 15px 35px 15px; 
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.altitude-gain-item:hover,
.altitude-loss-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.altitude-gain-header {
    color: #2ecc71;
    font-size: 1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.altitude-loss-header {
    color: #e74c3c;
    font-size: 1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.altitude-gain-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #2ecc71;
    margin-bottom: 6px;
}

.altitude-loss-value {
    font-size: 1.4em;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 6px;
}

.altitude-gain-details,
.altitude-loss-details {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 2px;
}

.click-hint {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.75em;
    opacity: 0.7;
    color: #ffeaa7;
}

/* Legacy Support */
.track-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 8px;
}

.track-stats > div {
    min-width: 120px;
    font-size: 0.97em;
    color: #222;
}
@media (max-width: 768px) {
    #enhanced-track-info {
        width: 350px !important;
    }
}

@media (max-width: 480px) {
    #enhanced-track-info {
        width: calc(100% - 30px) !important;
        right: 15px !important;
        left: 15px !important;
    }
}

/* Display Settings Overlay Collapsible */
#display-settings-overlay {
    transition: all 0.3s ease-out;
}

.display-settings-header {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.display-settings-header:hover {
    background: #e9ecef !important;
}


/* Smooth transitions for collapse/expand */
#display-settings-content.collapsing {
    transition: max-height 0.3s ease-out;
}

/* Station measurements stay legible in both themes and scroll as one table. */
.weather-station-card__body,
.weather-station-card__header-text,
.weather-station-card__charts {
    min-width: 0;
}
.weather-station-card__title,
.weather-station-card__subtitle {
    overflow-wrap: anywhere;
}
.weather-station-card__action {
    min-height: 44px;
    flex-shrink: 0;
}
.weather-station-card__table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.weather-station-card__table-scroll:focus-visible {
    outline: 2px solid #3188c9;
    outline-offset: 2px;
}
.weather-station-card__table th,
.weather-station-card__table td {
    white-space: nowrap;
}
body:not(.dark-mode) .weather-station-cards-section {
    background: #f4f7fa;
    border-color: #d1dae5;
}
body:not(.dark-mode) .weather-station-card,
body:not(.dark-mode) .weather-station-card__title,
body:not(.dark-mode) .weather-station-card__metric .metric-value,
body:not(.dark-mode) .weather-station-card__table th,
body:not(.dark-mode) .weather-station-card__table td {
    color: #26384a;
    background-color: #fff;
    border-color: #d1dae5;
}
body:not(.dark-mode) .weather-station-card__subtitle,
body:not(.dark-mode) .weather-station-card__metric .metric-label,
body:not(.dark-mode) .weather-station-card__turnpoints,
body:not(.dark-mode) .weather-station-card__chevron,
body:not(.dark-mode) .turnpoints-empty {
    color: #4f6175;
}
body:not(.dark-mode) .weather-station-section-meta,
body:not(.dark-mode) .weather-station-card__badge,
body:not(.dark-mode) .weather-station-card__turnpoint-count,
body:not(.dark-mode) .weather-station-card__action,
body:not(.dark-mode) .turnpoints-label,
body:not(.dark-mode) .turnpoint-chip {
    color: #145989;
}
body:not(.dark-mode) .weather-station-section-title i {
    color: #8a6200;
}
body:not(.dark-mode) .weather-station-card__charts canvas {
    background: #fff;
    border-color: #d1dae5;
}
@media (max-width: 420px) {
    .weather-station-card { padding: 10px; }
    .weather-station-card__header { gap: 8px; }
    .weather-station-card__metrics { grid-template-columns: minmax(0, 1fr); }
}

/* Separate pressure-datum comparisons remain readable on narrow screens. */
.flight-level-assessment-entry { margin: 0.8rem 0; padding: 0.6rem 0; border-top: 1px solid var(--border-color, #b7bdc5); }
.flight-level-assessment .info-row { display: block; overflow-wrap: anywhere; }
.flight-level-assessment .info-row strong { color: inherit; }
.flight-level-assessment [data-assessment-status] { font-weight: 600; border-radius: 3px; padding: 1px 4px; color: #59400a; background: #fef3c7; }
.flight-level-assessment [data-assessment-status="violation"] { color: #991b1b; background: #fee2e2; }
.flight-level-assessment [data-assessment-status="clear"] { color: #166534; background: #dcfce7; }
