html {
    margin: 0;
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    margin: 0;
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: visible;
    font-family: Arial, sans-serif;
}

#map {
    width: 100%;
    height: 100%;
}

.panel:has(#top-airlines-chart) {
    height: 300px;
    min-height: 300px;
    max-height: 300px;
    overflow: hidden;
}

#top-airlines-chart {
    display: block;
    width: 100% !important;
    height: 240px !important;
    max-height: 240px !important;
}

/* Single page scrollbar */
html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body {
    overflow-y: clip !important;
    overflow-x: clip !important;
}


/* Analytics footer height fix */
footer {
    height: auto !important;
    min-height: 340px !important;
    align-items: stretch;
    padding-bottom: 30px !important;
}

footer .panel {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
    overflow: hidden;
}



/* Callsign autocomplete */

.search-wrapper {
    position: relative;
    width: 100%;
}

.search-wrapper #searchBox {
    width: 100%;
    box-sizing: border-box;
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 2000;

    max-height: 280px;
    overflow-y: auto;

    background: #111827;
    border: 1px solid #334155;
    border-radius: 10px;

    box-shadow:
        0 12px 30px
        rgba(0, 0, 0, 0.45);
}

.search-suggestions[hidden] {
    display: none;
}

.search-suggestion-item {
    width: 100%;
    padding: 11px 12px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;

    border: 0;
    border-bottom:
        1px solid #243044;

    background: transparent;
    color: #ffffff;

    text-align: left;
    cursor: pointer;
}

.search-suggestion-item:last-child {
    border-bottom: 0;
}

.search-suggestion-item:hover {
    background: #1e293b;
}

.suggestion-callsign {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.suggestion-details {
    font-size: 11px;
    color: #94a3b8;
}

.search-empty {
    padding: 12px;
    color: #94a3b8;
    font-size: 12px;
}


/* Professional aircraft rendering */

.aircraft-marker {
    background: transparent;
    border: 0;
}

.aircraft-icon-shell {
    display: flex;
    align-items: center;
    justify-content: center;

    transform-origin: center center;

    transition:
        width 0.2s ease,
        height 0.2s ease,
        filter 0.2s ease;
}

.aircraft-icon-shell svg {
    display: block;
    overflow: visible;
}

.aircraft-marker:hover
.aircraft-icon-shell {
    filter:
        drop-shadow(
            0 0 9px
            rgba(255, 255, 255, 0.65)
        ) !important;
}


/* ===========================
   Flight Intelligence Popup
=========================== */

#map {
    height: min(78vh, 820px);
    min-height: 700px;
}

.leaflet-popup-content {
    margin: 14px 16px;
    width: 340px !important;
    min-width: 340px;
    max-width: 340px;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px;
}

.popup-card {
    width: 100%;
    color: #111827;
}

.popup-title {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 9px;
}

.popup-section {
    padding: 11px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.popup-section-title {
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    color: #6b7280;
}

.popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
}

.popup-grid div {
    display: flex;
    flex-direction: column;
}

.popup-grid span {
    margin-bottom: 2px;
    font-size: 10px;
    color: #6b7280;
}

.popup-grid strong {
    font-size: 12px;
    color: #111827;
}

.popup-route {
    display: grid;
    grid-template-columns: 1fr 50px 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.popup-route-code {
    font-size: 24px;
    line-height: 1;
    font-weight: 800;
}

.popup-route-code:last-child {
    text-align: right;
}

.popup-route-arrow {
    text-align: center;
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    color: #00bfe8;
}

.popup-route-cities {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 6px 0 12px;
    font-size: 10px;
    color: #6b7280;
}

.popup-route-cities span {
    max-width: 45%;
}

.popup-route-cities span:last-child {
    text-align: right;
}

.popup-local-flight {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .11em;
    color: #00a8c6;
}

.popup-local-airport {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 800;
}

.popup-local-city {
    margin-top: 3px;
    margin-bottom: 12px;
    font-size: 10px;
    color: #6b7280;
}

.popup-live-grid {
    margin-top: 10px;
}

.popup-meta {
    margin-top: 5px;
    font-size: 10px;
    color: #6b7280;
}

.popup-muted {
    font-size: 11px;
    color: #6b7280;
}

.popup-updated {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    font-size: 10px;
    color: #6b7280;
}

@media (max-height: 800px) {

    #map {
        height: 680px;
        min-height: 680px;
    }

}

@media (max-width: 900px) {

    .leaflet-popup-content {
        width: 290px !important;
        min-width: 290px;
        max-width: 290px;
    }

}

/* ===========================
   Analytics vertical spacing
=========================== */

footer {
    margin-top: 64px !important;
}


/* ===========================
   Final Map / Analytics Spacing
=========================== */

main {
    margin-bottom: 130px !important;
}

footer {
    margin-top: 0 !important;
}

.popup-airline {
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.popup-aircraft-meta {
    margin-bottom: 9px;
    font-size: 10px;
    color: #6b7280;
}


/* ===========================
   Airport Layer
=========================== */

.airport-marker-wrapper {
    background: transparent !important;
    border: 0 !important;
}

.airport-marker {
    min-width: 38px;
    padding: 3px 6px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 6px;

    background: rgba(5,15,30,.88);

    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    text-align: center;
    letter-spacing: .05em;

    box-shadow:
        0 2px 7px rgba(0,0,0,.28);

    white-space: nowrap;
}

.airport-marker:hover {
    background: #00bfe8;
    color: #07111f;
}

.airport-popup {
    min-width: 190px;
}

.airport-popup-code {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 2px;
}

.airport-popup-name {
    margin-bottom: 10px;
    font-size: 11px;
    color: #6b7280;
}

.airport-popup-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 3px 0;
}

.airport-popup-row span {
    font-size: 10px;
    color: #6b7280;
}

.airport-popup-row strong {
    font-size: 11px;
    text-align: right;
}


/* ===========================
   History Window Selector
=========================== */

#historyWindow{

    width:100%;

    padding:10px;

    border:none;

    border-radius:8px;

    background:#1f2937;

    color:white;

    font-size:14px;

    margin-top:8px;

}


/* ===========================
   Historical Analytics State
=========================== */

.history-unavailable {
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    text-align: center;

    color: #8b98ab;

    font-size: 13px;
    line-height: 1.5;
}

