/* ==========================================================================
   VOEALTUM — Chrome aeroportuário (FIDS topbar + telemetria em carrossel)
   ========================================================================== */

:root {
    --fids-amber: #c9a227;
    --fids-board: #0a0e14;
    --fids-cell: #121820;
    --fids-ink: #e8ecf1;
    --fids-mute: #8b95a5;
    --plane-accent: #d4ae57;
}

/* —— HUD de cockpit (substitui GATE / FIDS) —— */
.topbar.topbar-hud,
.topbar.topbar-fids {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    min-height: 68px;
    overflow: visible;
    background:
        radial-gradient(120% 80% at 50% -20%, rgba(212, 174, 87, 0.08), transparent 42%),
        linear-gradient(180deg, #1a140c 0%, #0b0906 52%, #070605 100%);
    border-bottom: 3px solid #2a2214;
    box-shadow:
        inset 0 1px 0 rgba(255, 220, 140, 0.12),
        0 8px 24px rgba(0, 0, 0, 0.35);
}

.topbar-hud .topbar-left,
.topbar-fids .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.topbar-hud .topbar-right,
.topbar-fids .topbar-right {
    overflow: visible;
    z-index: 80;
    flex-shrink: 0;
    align-items: center;
}

.theme-dropdown {
    z-index: 4000 !important;
}

.hud-knob,
.btn-sidebar-toggle.hud-knob {
    position: relative;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    border-radius: 50% !important;
    border: 3px solid #c9a227 !important;
    background:
        radial-gradient(circle at 35% 30%, #3a3224, #14110c 62%) !important;
    color: #f0d78c !important;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.12),
        0 0 0 2px #070605,
        0 4px 10px rgba(0, 0, 0, 0.45) !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.hud-knob:hover,
.btn-sidebar-toggle.hud-knob:hover {
    color: #fff4cc !important;
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.16),
        0 0 0 2px #070605,
        0 0 16px rgba(201, 162, 39, 0.45) !important;
}

.hud-knob-ring {
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    border: 1px dashed rgba(240, 215, 140, 0.35);
    pointer-events: none;
}

.hud-knob-label {
    font-family: 'Oswald', sans-serif;
    font-size: 9px;
    letter-spacing: 0.18em;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.hud-knob .sidebar-toggle-bars,
.hud-knob .fids-gate-label,
.hud-knob .fids-gate-code {
    display: none !important;
}

.hud-efis,
.fids-board {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    min-height: 52px;
    border-radius: 6px;
    background:
        linear-gradient(180deg, #03140c 0%, #020b08 100%);
    border: 2px solid #1c3d2c;
    box-shadow:
        inset 0 0 18px rgba(46, 204, 113, 0.12),
        inset 0 0 0 1px rgba(125, 206, 160, 0.18);
}

.hud-chip {
    appearance: none;
    border: 1px solid rgba(125, 206, 160, 0.28);
    background: rgba(8, 40, 24, 0.4);
    color: #b8f0c8 !important;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    text-shadow: 0 0 8px rgba(80, 220, 140, 0.55);
}

.hud-chip:hover {
    border-color: #7dcea0;
    background: rgba(46, 204, 113, 0.16);
}

.hud-chip--here,
#topbarRoute.hud-chip,
.hud-efis #topbarRoute {
    color: #f4e3a8 !important;
    border-color: rgba(212, 174, 87, 0.55);
    background: rgba(60, 44, 8, 0.55);
    text-shadow: 0 0 10px rgba(212, 174, 87, 0.45);
    font-size: 15px;
    max-width: min(42vw, 280px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-tick {
    width: 10px;
    height: 10px;
    border-right: 2px solid #7dcea0;
    border-top: 2px solid #7dcea0;
    transform: rotate(45deg);
    opacity: 0.7;
    flex-shrink: 0;
}

.hud-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Oswald', sans-serif;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7dcea0;
    flex-shrink: 0;
}

.hud-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 10px #2ecc71;
    animation: fidsPulse 1.8s ease-in-out infinite;
}

@keyframes fidsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.hud-switch.btn-topbar,
.topbar-hud .btn-topbar.hud-switch {
    border-radius: 4px !important;
    border: 1px solid #8a6d2f !important;
    background: linear-gradient(180deg, #2a2418 0%, #12100a 100%) !important;
    color: #f0d78c !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    min-height: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 230, 160, 0.15);
}

.hud-switch.btn-topbar:hover {
    border-color: #f0d78c !important;
    color: #fff8dc !important;
    background: linear-gradient(180deg, #3a301c 0%, #1a160c 100%) !important;
}

#btnTopbarContext,
.topbar-hud .topbar-context {
    display: none !important;
}

@media (max-width: 720px) {
    .hud-live { display: none; }
    .hud-chip { font-size: 11px; padding: 5px 8px; }
    .hud-chip--here, #topbarRoute.hud-chip { font-size: 12px; }
    .hud-knob, .btn-sidebar-toggle.hud-knob {
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
    }
}

/* —— Dock de telemetria (uma métrica, faixa suave) —— */
#flightStatusBar.flight-status-bar {
    flex-shrink: 0;
    margin: 0 14px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 16, 24, 0.92);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

#flightStatusBar .mp3-fs-tip,
#flightStatusBar .fs-divider {
    display: none !important;
}

.flight-status-bar.fs-carousel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 10px;
    align-items: center;
    padding: 10px 12px 10px 8px;
    border-top: none;
}

.flight-status-bar.fs-carousel::before {
    content: '';
    position: absolute;
    left: 8%;
    right: 8%;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 174, 87, 0.35), transparent);
    pointer-events: none;
}

.fs-carousel-main {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 2px 8px;
    align-items: center;
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
}

.fs-plane-btn--prev { grid-column: 1; grid-row: 1; }
.fs-viewport { grid-column: 2; grid-row: 1; }
.fs-plane-btn--next { grid-column: 3; grid-row: 1; }
.fs-dots {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.fs-plane-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(232, 236, 241, 0.72);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.fs-plane-btn:hover {
    border-color: rgba(212, 174, 87, 0.7);
    background: rgba(212, 174, 87, 0.14);
    transform: translateY(-1px);
}

.fs-plane-btn:active {
    transform: scale(0.96);
}

.fs-plane-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.fs-plane-btn--prev svg {
    transform: rotate(-90deg);
}

.fs-plane-btn--next svg {
    transform: rotate(90deg);
}

.fs-viewport {
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow: hidden !important;
    position: relative;
}

.fs-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.fs-item.fs-slide {
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 4px 8px;
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px 10px;
    align-items: baseline;
    cursor: pointer;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.fs-item.fs-slide:hover,
.fs-item.fs-slide.is-open {
    border-color: rgba(212, 174, 87, 0.28);
    background: rgba(212, 174, 87, 0.05);
}

.fs-item.fs-slide .fs-label {
    display: inline;
    grid-column: 1;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--fids-mute);
}

.fs-item.fs-slide .fs-value {
    grid-column: 2;
    font-size: 15px;
    letter-spacing: 0.03em;
    line-height: 1.2;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-slide-lead {
    grid-column: 1 / -1;
    font-family: var(--font-body, Merriweather, serif);
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(232, 236, 241, 0.72);
    margin: 0;
    max-height: 2.9em;
    overflow: hidden;
}

.fs-carousel.is-explain-open .fs-slide-lead {
    display: none;
}

.fs-slide-hint {
    display: none;
}

.fs-explain {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
    padding: 0 8px;
    border-left: 2px solid transparent;
}

.fs-carousel.is-explain-open .fs-explain {
    max-height: 96px;
    opacity: 1;
    padding: 6px 12px 2px;
    border-left-color: var(--plane-accent);
    background: rgba(212, 174, 87, 0.04);
    border-radius: 0 6px 6px 0;
}

.fs-explain-title {
    font-family: var(--font-ui, 'Oswald', sans-serif);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--plane-accent);
    margin: 0 0 4px;
}

.fs-explain-body {
    margin: 0;
    font-family: var(--font-body, Merriweather, serif);
    font-size: 13px;
    line-height: 1.5;
    color: var(--fids-ink);
    opacity: 0.9;
}

.fs-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.fs-dot.is-active {
    background: var(--plane-accent);
    transform: scale(1.25);
}

.flight-status-bar.fs-carousel .fs-history-btn {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    padding: 7px 14px;
    font-size: 10px;
    letter-spacing: 0.08em;
    min-height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(232, 236, 241, 0.82);
}

.flight-status-bar.fs-carousel .fs-divider {
    display: none !important;
}

/* Calm: carrossel no lugar de esconder métricas */
body.co-calm .flight-status-bar.fs-carousel .fs-item,
body.co-calm .flight-status-bar.fs-carousel .fs-plane-btn,
body.co-calm .flight-status-bar.fs-carousel .fs-dots {
    display: flex !important;
}

body.co-calm .flight-status-bar.fs-carousel .fs-item {
    display: grid !important;
}

body.co-calm .flight-status-bar.fs-carousel {
    padding: 10px 12px 10px 8px;
}

body.light-mode .topbar.topbar-hud,
body.light-mode .topbar.topbar-fids {
    background:
        linear-gradient(180deg, #ffffff 0%, #f6f3ec 100%) !important;
    border-bottom: 1px solid rgba(12, 43, 91, 0.12) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8), 0 8px 20px rgba(12, 43, 91, 0.06);
}

body.light-mode .hud-efis,
body.light-mode .fids-board {
    background: linear-gradient(180deg, #f3f6fa 0%, #e8eef5 100%) !important;
    border-color: rgba(12, 43, 91, 0.14) !important;
}

body.light-mode .topbar.topbar-hud #topbarRoute,
body.light-mode .hud-chip--here,
body.light-mode .hud-chip {
    color: #1c2430 !important;
}

body.light-mode .hud-chip {
    color: #0c2b5b !important;
}

body.light-mode .topbar-hud .btn-topbar.hud-switch,
body.light-mode .hud-switch.btn-topbar {
    background: #ffffff !important;
    border-color: rgba(12, 43, 91, 0.16) !important;
    color: #1c2430 !important;
}

body.light-mode .btn-sidebar-toggle.hud-knob {
    background: radial-gradient(circle at 35% 30%, #fff8e8, #efe6d2 62%) !important;
    border-color: #c9a227 !important;
    color: #0c2b5b !important;
    box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(12, 43, 91, 0.12) !important;
}

body.light-mode #flightStatusBar.flight-status-bar,
body.light-mode .flight-status-bar.fs-carousel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(12, 43, 91, 0.08);
    box-shadow: 0 8px 28px rgba(12, 43, 91, 0.08);
}

body.light-mode .flight-status-bar.fs-carousel::before {
    background: linear-gradient(90deg, transparent, rgba(166, 134, 60, 0.28), transparent);
}

body.light-mode .fs-plane-btn {
    border-color: rgba(12, 43, 91, 0.1);
    background: #f4f6f8;
    color: #4b5568;
}

body.light-mode .fs-plane-btn:hover {
    border-color: rgba(138, 109, 47, 0.4);
    background: rgba(212, 174, 87, 0.12);
    color: #8a6d2f;
}

body.light-mode .fs-item.fs-slide .fs-label {
    color: #6b7280;
}

body.light-mode .fs-item.fs-slide .fs-value,
body.light-mode .flight-status-bar .fs-value,
body.light-mode .flight-status-bar #fsAcao {
    color: #1a2433 !important;
}

body.light-mode .fs-slide-lead {
    color: #4b5568;
}

body.light-mode .fs-explain {
    background: rgba(12, 43, 91, 0.03);
}

body.light-mode .fs-explain-body {
    color: #2a3544;
}

body.light-mode .fs-dot {
    background: rgba(12, 43, 91, 0.16);
}

body.light-mode .fs-dot.is-active {
    background: #c9a227;
}

body.light-mode .flight-status-bar.fs-carousel .fs-history-btn {
    border-color: rgba(12, 43, 91, 0.12);
    background: #f4f6f8;
    color: #374151;
}

.hud-knob-label,
.btn-sidebar-toggle .hud-knob-label,
#sidebarToggle .hud-knob-label,
#sidebarToggle .hud-knob-ring {
    display: none !important;
}

#viewContainer > .view-section.active {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* —— Radar + avião (menu retrátil — não é a bola MENU) —— */
.btn-sidebar-toggle.hud-radar-toggle,
.hud-radar-toggle {
    width: auto !important;
    height: 46px !important;
    min-width: 0 !important;
    border-radius: 8px !important;
    border: 1px solid rgba(125, 206, 160, 0.45) !important;
    background:
        linear-gradient(180deg, #0a1c12 0%, #050b08 100%) !important;
    box-shadow:
        inset 0 0 14px rgba(61, 204, 122, 0.12),
        0 0 0 1px #070605 !important;
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px;
    padding: 4px 10px 4px 6px !important;
    overflow: visible;
    color: #f0d78c !important;
}

.btn-sidebar-toggle.hud-radar-toggle:hover,
.hud-radar-toggle:hover {
    border-color: #7dcea0 !important;
    box-shadow:
        inset 0 0 16px rgba(61, 204, 122, 0.2),
        0 0 14px rgba(61, 204, 122, 0.25) !important;
}

.hud-radar-toggle .hud-knob-label,
.hud-radar-toggle .hud-knob-ring {
    display: none !important;
}

.hud-radar-disc {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: radial-gradient(circle at 50% 50%, #0d2a18 0%, #041208 72%);
    border: 1px solid rgba(61, 204, 122, 0.55);
    box-shadow: inset 0 0 10px rgba(61, 204, 122, 0.25);
    overflow: hidden;
}

.hud-radar-cross,
.hud-radar-cross::before {
    position: absolute;
    inset: 50% 0 auto 0;
    height: 1px;
    background: rgba(61, 204, 122, 0.28);
    pointer-events: none;
}

.hud-radar-cross::before {
    content: '';
    inset: 0 auto 0 50%;
    width: 1px;
    height: auto;
}

.hud-radar-rings,
.hud-radar-rings::before,
.hud-radar-rings::after {
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    border: 1px solid rgba(61, 204, 122, 0.32);
    pointer-events: none;
}

.hud-radar-rings::before {
    content: '';
    inset: 5px;
    border-color: rgba(61, 204, 122, 0.42);
}

.hud-radar-rings::after {
    content: '';
    inset: 10px;
    border-color: rgba(212, 174, 87, 0.5);
}

.hud-radar-sweep {
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(61, 204, 122, 0) 0 72%, rgba(61, 204, 122, 0.55) 88%, rgba(212, 174, 87, 0.95) 100%);
    animation: hudRadarSweep 2.2s linear infinite;
}

.hud-radar-blip {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3dcc7a;
    top: 6px;
    left: 62%;
    box-shadow: 0 0 8px #3dcc7a, 0 0 16px rgba(61, 204, 122, 0.8);
    animation: hudRadarBlip 1.4s ease-out infinite;
}

.hud-radar-plane {
    position: relative;
    width: 28px;
    height: 18px;
    color: #f0d78c;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(212, 174, 87, 0.85));
    transition: transform 0.28s ease;
}

.hud-radar-plane svg {
    width: 28px;
    height: 18px;
}

#appLayout.sidebar-retracted:not(.sidebar-mobile-open) .hud-radar-plane {
    transform: none;
}

#appLayout:not(.sidebar-retracted) .hud-radar-plane,
#appLayout.sidebar-mobile-open .hud-radar-plane {
    transform: scaleX(-1);
}

@keyframes hudRadarSweep {
    to { transform: rotate(360deg); }
}

@keyframes hudRadarBlip {
    0% { opacity: 1; transform: scale(1); }
    55% { opacity: 0.15; transform: scale(1.85); }
    100% { opacity: 0.95; transform: scale(1); }
}

body.light-mode .hud-radar-toggle,
body.light-mode .btn-sidebar-toggle.hud-radar-toggle {
    background: linear-gradient(180deg, #eef3f0 0%, #dce6e0 100%) !important;
    border-color: rgba(28, 90, 56, 0.45) !important;
    color: #6b5420 !important;
}

body.light-mode .hud-radar-disc {
    background: radial-gradient(circle at 50% 50%, #d7efe0 0%, #b7d4c4 72%);
    border-color: rgba(28, 90, 56, 0.5);
}

@media (max-width: 720px) {
    .btn-sidebar-toggle.hud-radar-toggle,
    .hud-radar-toggle {
        height: 42px !important;
        padding: 3px 8px 3px 4px !important;
        gap: 6px;
    }
    .hud-radar-disc {
        width: 30px;
        height: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hud-radar-sweep,
    .hud-radar-blip {
        animation: none;
    }
}

