* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #080b10;
    color: #f4f6f8;
}

body,
button,
input,
select {
    font-family: inherit;
}

#map {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
}


/* GLASS */

.glass-panel,
.topbar,
.search-container,
.bottom-bar {
    background: rgba(12, 16, 23, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(25px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
}


/* TOP */

.topbar {
    position: fixed;
    top: 18px;
    left: 18px;
    right: 18px;
    height: 72px;
    z-index: 20;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px 0 18px;
}


.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}


.brand-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #ffd84d;
    background: rgba(255, 216, 77, 0.12);
    border: 1px solid rgba(255, 216, 77, 0.2);
}


.brand-text h1 {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.3px;
}


.brand-text span {
    display: block;
    margin-top: 3px;
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(244, 246, 248, 0.48);
}


.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.live-indicator {
    height: 36px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 7px;
    border-radius: 10px;
    color: #42e6a4;
    background: rgba(66, 230, 164, 0.08);
    border: 1px solid rgba(66, 230, 164, 0.16);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
}


.live-dot,
.connection-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #42e6a4;
    box-shadow: 0 0 10px rgba(66, 230, 164, 0.7);
}


.glass-button {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.045);
    color: #f4f6f8;
    cursor: pointer;
}


    .glass-button:hover {
        background: rgba(255, 255, 255, 0.1);
    }


/* SEARCH */

.search-container {
    position: fixed;
    top: 106px;
    left: 18px;
    width: 360px;
    z-index: 15;
    border-radius: 14px;
}


.search-box {
    height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
}


    .search-box > i {
        color: rgba(244, 246, 248, 0.48);
    }


    .search-box input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: #f4f6f8;
        font-size: 13px;
    }


        .search-box input::placeholder {
            color: rgba(244, 246, 248, 0.38);
        }


.search-clear {
    border: 0;
    background: transparent;
    color: rgba(244, 246, 248, 0.48);
    cursor: pointer;
}


/* CONTROL */

.control-panel {
    position: fixed;
    top: 164px;
    left: 18px;
    width: 360px;
    z-index: 10;
    border-radius: 18px;
    padding: 20px;
}


.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}


.eyebrow {
    display: block;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: rgba(244, 246, 248, 0.48);
}


.panel-heading h2 {
    margin: 3px 0 0;
    font-size: 21px;
    font-weight: 650;
}


.panel-heading-icon {
    color: #ffd84d;
    font-size: 21px;
}


.control-panel label {
    display: block;
    margin-bottom: 7px;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: rgba(244, 246, 248, 0.48);
}


.select-wrapper {
    position: relative;
}


    .select-wrapper select {
        width: 100%;
        height: 44px;
        padding: 0 38px 0 13px;
        appearance: none;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 11px;
        outline: none;
        background: rgba(255, 255, 255, 0.045);
        color: #f4f6f8;
        font-size: 12px;
    }


    .select-wrapper i {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(244, 246, 248, 0.48);
        pointer-events: none;
    }


.panel-divider {
    height: 1px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.1);
}


/* STATS */

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}


.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}


.stat-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffd84d;
    background: rgba(255, 216, 77, 0.12);
}


.stat-content strong {
    display: block;
    font-size: 18px;
}


.stat-content span {
    display: block;
    margin-top: 3px;
    font-size: 8px;
    letter-spacing: 1.2px;
    color: rgba(244, 246, 248, 0.48);
}


/* BUTTON */

.primary-button {
    width: 100%;
    height: 44px;
    margin-top: 14px;
    border-radius: 11px;
    border: 1px solid rgba(255, 216, 77, 0.25);
    background: rgba(255, 216, 77, 0.09);
    color: #ffd84d;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}


    .primary-button:hover {
        background: rgba(255, 216, 77, 0.16);
    }


/* AIRCRAFT */

.flight-aircraft {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd84d;
    font-size: 27px;
    cursor: pointer;
    pointer-events: auto;
    filter: drop-shadow( 0 0 5px rgba(255, 216, 77, 0.4) );
    transform-origin: center;
}


    .flight-aircraft:hover {
        filter: drop-shadow( 0 0 10px rgba(255, 216, 77, 0.7) );
    }


/* DETAILS */

.flight-details {
    position: fixed;
    top: 106px;
    right: 18px;
    width: 410px;
    max-height: calc(100vh - 142px);
    overflow-y: auto;
    z-index: 30;
    border-radius: 18px;
    padding: 20px;
}


.hidden {
    display: none !important;
}


.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(244, 246, 248, 0.6);
    cursor: pointer;
}


.flight-header {
    display: flex;
    align-items: center;
    gap: 12px;
}


.flight-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(255, 216, 77, 0.12);
    color: #ffd84d;
    font-size: 19px;
}


.flight-header h2 {
    margin: 3px 0 0;
    font-size: 24px;
    font-weight: 650;
}


.pilot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
}


    .pilot-row strong {
        display: block;
        margin-top: 3px;
        font-size: 13px;
    }


.online-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #42e6a4;
    font-size: 9px;
    font-weight: 700;
}


    .online-badge > span:first-child {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #42e6a4;
    }


/* SECTIONS */

.info-section {
    margin-top: 20px;
}


.section-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: rgba(244, 246, 248, 0.48);
}


    .section-title i {
        color: #ffd84d;
    }


.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


.info-item {
    padding: 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.055);
}


    .info-item span,
    .coordinates span,
    .connection-grid span {
        display: block;
        margin-bottom: 5px;
        font-size: 8px;
        letter-spacing: 1.2px;
        color: rgba(244, 246, 248, 0.48);
    }


    .info-item strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }


/* ROUTE */

.route {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}


.airport strong {
    display: block;
    font-size: 20px;
}


.airport span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px;
    color: rgba(244, 246, 248, 0.48);
}


.arrival {
    text-align: right;
}


.route > i {
    color: #ffd84d;
    font-size: 12px;
}


/* COORDINATES */

.coordinates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


    .coordinates > div {
        padding: 11px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.035);
    }


    .coordinates strong {
        font-family: "SFMono-Regular", Consolas, monospace;
        font-size: 12px;
    }


/* CONNECTION */

.connection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}


    .connection-grid > div {
        padding: 11px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.035);
    }


    .connection-grid strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 11px;
    }


/* BOTTOM */

.bottom-bar {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 14px;
    height: 38px;
    z-index: 20;
    border-radius: 11px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 0 14px;
    font-size: 9px;
    letter-spacing: 1px;
    color: rgba(244, 246, 248, 0.48);
}


.connection-status {
    display: flex;
    align-items: center;
    gap: 7px;
}


.footer-center {
    text-align: center;
    letter-spacing: 2px;
}


.footer-right {
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}


    .footer-right span:first-child {
        color: #ffd84d;
    }


/* MAP CONTROLS */

.maplibregl-ctrl-group {
    background: rgba(12, 16, 23, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 12px !important;
    overflow: hidden;
    backdrop-filter: blur(18px);
}


    .maplibregl-ctrl-group button {
        background: transparent !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }


/* MOBILE */

@media (max-width: 800px) {

    .topbar {
        top: 10px;
        left: 10px;
        right: 10px;
    }

    .search-container {
        top: 92px;
        left: 10px;
        width: calc(100% - 20px);
    }

    .control-panel {
        top: 150px;
        left: 10px;
        width: calc(100% - 20px);
    }

    .flight-details {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: 58px;
        width: calc(100% - 20px);
        max-height: calc(100vh - 70px);
    }

    .bottom-bar {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .footer-center {
        display: none;
    }

    .bottom-bar {
        grid-template-columns: 1fr auto;
    }
}
/* =========================================================
   MOBILE OPTIMISATION
   Desktop styling above remains untouched.
========================================================= */

@media (max-width: 800px) {

    html,
    body {
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    #map {
        height: 100dvh;
    }

    /* TOP BAR */

    .topbar {
        top: max(10px, env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        height: 64px;
        padding: 0 10px 0 12px;
        border-radius: 16px;
    }

    .brand-icon {
        width: 40px;
        height: 40px;
    }

    .brand-text h1 {
        font-size: 15px;
    }

    .brand-text span {
        font-size: 8px;
    }

    .top-actions {
        gap: 6px;
    }

    .live-indicator {
        height: 34px;
        padding: 0 9px;
    }

    .glass-button {
        width: 36px;
        height: 36px;
    }


    /* SEARCH */

    .search-container {
        top: 84px;
        left: 10px;
        right: 10px;
        width: auto;
        border-radius: 14px;
    }

    .search-box {
        height: 48px;
    }

        .search-box input {
            font-size: 14px;
        }


    /* LEFT CONTROL PANEL */

    .control-panel {
        top: 142px;
        left: 10px;
        right: 10px;
        width: auto;
        padding: 15px;
        border-radius: 16px;
    }


    /* AIRCRAFT */

    .flight-aircraft {
        width: 48px;
        height: 48px;
        font-size: 27px;
    }


    /* FLIGHT DETAILS */

    .flight-details {
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 8px;
        width: auto;
        max-height: 78dvh;
        border-radius: 22px;
        padding: 18px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }


    /* BOTTOM BAR */

    .bottom-bar {
        left: 10px;
        right: 10px;
        bottom: 10px;
        height: 36px;
    }

    .footer-center {
        display: none;
    }


    /* MAP CONTROLS */

    .maplibregl-ctrl-top-right {
        top: 156px;
        right: 10px;
    }

    .maplibregl-ctrl-group button {
        width: 42px !important;
        height: 42px !important;
    }
}


/* =========================================================
   MOBILE FIX
   DO NOT CHANGE ANYTHING ABOVE THIS
========================================================= */

@media (max-width: 800px) {

    /* MAP */

    #map {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
    }


    /* TOP BAR */

    .topbar {
        top: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        height: 58px;
        padding: 0 10px;
        border-radius: 15px;
    }


    .brand {
        min-width: 0;
    }


    .brand-icon {
        width: 38px;
        height: 38px;
    }


    .brand-text {
        min-width: 0;
    }


        .brand-text h1 {
            font-size: 14px;
        }


        .brand-text span {
            font-size: 7px;
        }


    .top-actions {
        gap: 5px;
    }


    .live-indicator {
        height: 32px;
        padding: 0 8px;
        font-size: 8px;
    }


    .glass-button {
        width: 34px;
        height: 34px;
    }


    /* SEARCH */

    .search-container {
        position: fixed;
        top: 78px;
        left: 10px;
        right: 10px;
        width: auto;
        height: 46px;
        border-radius: 13px;
    }


    .search-box {
        height: 46px;
        padding: 0 12px;
    }


        .search-box input {
            font-size: 13px;
        }


    /* AIRCRAFT CONTROL PANEL */

    .control-panel {
        position: fixed;
        top: 134px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 215px;
        overflow: hidden;
        padding: 14px;
        border-radius: 16px;
    }


    .panel-heading {
        margin-bottom: 12px;
    }


        .panel-heading h2 {
            font-size: 18px;
        }


    .panel-heading-icon {
        font-size: 18px;
    }


    .control-panel label {
        font-size: 7px;
    }


    .select-wrapper select {
        height: 40px;
        font-size: 12px;
    }


    .panel-divider {
        margin: 12px 0;
    }


    .stats {
        gap: 7px;
    }


    .stat {
        padding: 8px;
    }


    .stat-icon {
        width: 29px;
        height: 29px;
    }


    .stat-content strong {
        font-size: 15px;
    }


    .stat-content span {
        font-size: 6px;
    }


    .primary-button {
        min-height: 40px;
        height: 40px;
        margin-top: 9px;
    }


    /* AIRCRAFT ICONS */

    .flight-aircraft {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }


    /* MAP CONTROLS */

    .maplibregl-ctrl-top-right {
        top: 360px !important;
        right: 10px !important;
    }


    .maplibregl-ctrl-group button {
        width: 40px !important;
        height: 40px !important;
    }


    /* FLIGHT DETAILS */

    .flight-details {
        position: fixed;
        left: 8px;
        right: 8px;
        top: auto;
        bottom: 8px;
        width: auto;
        max-height: 72dvh;
        padding: 17px;
        border-radius: 20px;
        overflow-y: auto;
        z-index: 50;
    }


    .flight-header {
        padding-right: 42px;
    }


        .flight-header h2 {
            font-size: 21px;
        }


    .close-button {
        width: 34px;
        height: 34px;
    }


    .info-grid {
        grid-template-columns: 1fr 1fr;
    }


    .coordinates {
        grid-template-columns: 1fr 1fr;
    }


    .connection-grid {
        grid-template-columns: 1fr 1fr;
    }


    /* BOTTOM BAR */

    .bottom-bar {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 8px;
        width: auto;
        height: 34px;
        padding: 0 10px;
        border-radius: 10px;
    }


    .footer-center {
        display: none;
    }


    .footer-right {
        font-size: 7px;
    }
}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 390px) {

    .brand-text {
        display: none;
    }


    .live-indicator {
        display: none;
    }


    .control-panel {
        top: 130px;
    }


    .maplibregl-ctrl-top-right {
        top: 350px !important;
    }


    .flight-details {
        max-height: 75dvh;
    }
}


/* =========================================================
   LANDSCAPE
========================================================= */

@media (max-width: 800px) and (orientation: landscape) {

    .topbar {
        height: 50px;
    }


    .search-container {
        top: 68px;
        height: 40px;
    }


    .search-box {
        height: 40px;
    }


    .control-panel {
        top: 116px;
        width: 310px;
        max-height: 190px;
    }


    .maplibregl-ctrl-top-right {
        top: 116px !important;
    }


    .flight-details {
        top: 68px;
        bottom: 45px;
        left: auto;
        right: 10px;
        width: 390px;
        max-height: calc(100dvh - 55px);
    }


    .bottom-bar {
        height: 30px;
    }
}
/* =========================================================
   MOBILE BURGER MENU
========================================================= */

.mobile-menu-button {
    display: none;
}


@media (max-width: 800px) {

    .mobile-menu-button {
        display: flex;
        position: fixed;
        top: 134px;
        left: 10px;
        z-index: 40;
        height: 44px;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 0 15px;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(12, 16, 23, 0.82);
        color: #f4f6f8;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.07);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        touch-action: manipulation;
    }


        .mobile-menu-button i {
            color: #ffd84d;
            font-size: 15px;
        }


        .mobile-menu-button:active {
            transform: scale(0.95);
        }


    /* Hide the desktop panel until opened */

    .control-panel {
        display: none;
    }


        /* Open menu */

        .control-panel.mobile-menu-open {
            display: block;
            position: fixed;
            top: 186px;
            left: 10px;
            right: 10px;
            width: auto;
            z-index: 35;
            max-height: calc(100dvh - 250px);
            overflow-y: auto;
            border-radius: 18px;
        }


    /* Active button */

    .mobile-menu-active {
        background: rgba(255, 216, 77, 0.12);
        border-color: rgba(255, 216, 77, 0.25);
        color: #ffd84d;
    }


    /* Keep map controls below menu */

    .maplibregl-ctrl-top-right {
        top: 134px !important;
        right: 10px !important;
    }
}


/* Small phones */

@media (max-width: 390px) {

    .mobile-menu-button {
        top: 130px;
    }


    .control-panel.mobile-menu-open {
        top: 182px;
    }
}