/* --- Section & container layout --- */
.avnr_tm_section {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 10px);
    height: calc(100vh - 10px);
    overflow: hidden;
}
.avnr_tm_inner_container {
    padding: 0.5vw;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
/* --- Input Section --- */
.avnr_tm_input_section {
    width: 100%;
    flex: 0 0 40%;
    padding: 4px;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    gap: 10px;
    min-height: 0;
    flex-wrap: wrap; /* allows wrapping on smaller screens */
}
.avnr_tm_airport_card {
    flex: 2.25;
    background: var(--avn-gradient-blue-to-orange);
    color: white;
    border-radius: 1em;
    box-shadow: inset 0 0 1.5em 0 var(--avn-dark-color);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px; /* prevent cards from shrinking too small */
}
/* Normal state - row has minimal/no background */
.avnr_tm_airport_card .avnr_tm_airport_row { display: flex; }
/* When card is empty, give the row the gradient background */
.avnr_tm_airport_card.empty-input .avnr_tm_airport_row {
    background: var(--avn-gradient-blue-to-orange);
    border-radius:1em;
    box-shadow: inset 0 0 1.5em 0 var(--avn-dark-color);
    padding: 10px;
}
.avnr_tm_airport_card.empty-input {
    background: transparent !important;
    box-shadow: none !important;
}
.avnr_tm_airport_row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.avnr_tm_airport_label {
    white-space: nowrap;
}
.avnr_tm_airport_input {
    padding: 4px;
}
.avnr_tm_small_text {
    font-size: 0.8em;
}
.avnr_tm_map_container {
    flex: 1;
    min-height: 0;
}
.avnr_tm_map_inner {
    height: 100%;
    width: 100%;
}
/* --- Shortcut buttons container --- */
.avnr_tm_buttons_container {
    flex: 1;
    background-color: transparent;
    padding: 10px;
}
.avnr_tm_buttons_inner {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}
/* --- Result Section --- */
.avnr_tm_result_section {
    width: 100%;
    flex: 1 1 0;
    padding: 10px;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 0;
    display: flex;
    gap: 10px;
}
/* Right & Left panels */
.avnr_tm_right_panel {
    width: 60%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
}
.avnr_tm_left_panel {
    width: 40%;
    height: 100%;
    box-sizing: border-box;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 40px;
    align-items: flex-start;
}
/* Map box */
.avnr_tm_map_box {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: calc(60vh - 90px);
    border-radius: 1em;
    overflow: hidden;
}
.avnr_tm_map_image_wrapper {
    display: flex;
    flex: 1 1 0;
    min-height: 20vh;
    max-height: 75vh;
    min-width: 20vw;
}
.avnr_tm_map_image {
    height: 100%;
    width: 100%;
}

/* --- Tab Navigation Styles --- */
.avnr_tm_tabs_container {
    width: fit-content;
    max-width: 100%;
}

.avnr_tm_tabs_nav {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
}

.avnr_tm_tab_button {
    background: var(--avn-gradient-blue-to-orange);
    border: none;
    color: #d0d0d0;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s ease;
    position: relative;
    bottom: -2px;
    box-shadow: inset 0 0 0.5em 0 rgba(0, 0, 0, 0.3);
}

.avnr_tm_tab_button:hover {
    box-shadow: inset 0 0 1em 0 rgba(0, 0, 0, 0.5);
    color: #fff;
}

.avnr_tm_tab_button.active {
    background: var(--avn-gradient-blue-to-orange);
    color: var(--avn-yellow-light);
    border-bottom: 2px solid var(--avn-yellow-light);
    box-shadow: inset 0 0 1.5em 0 rgba(0, 0, 0, 0.6);
    font-weight: 600;
}

.avnr_tm_tab_content {
    display: none;
}

.avnr_tm_tab_content.active {
    display: block;
}

/* Table styling */
.avnr_tm_table {
    border-collapse: collapse;
    margin-top: 5px;
}



.avnr_tm_modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.avnr_tm_modal[aria-hidden="false"] {
    display: block;
}

.avnr_tm_modal_overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.avnr_tm_modal_content {
    position: relative;
    max-width: 720px;
    margin: 8vh auto;
    background: #1b1b1b;
    color: #e0e0e0;
    padding: 24px 28px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    line-height: 1.6;
}

.avnr_tm_modal_content h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.3rem;
    color: #ffffff;
}

.avnr_tm_modal_close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #ffffff;
    cursor: pointer;
}

.avnr_tm_action_buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.avnr_tm_tab_button.hidden {
    display: none;
}

.avnr_tm_tab_content.hidden {
    display: none;
}

.avnr_tm_highlight { color: var(--avn-yellow-light);}

.leaflet-control-attribution {font-size: 9px;}
.leaflet-control-zoom {transform: scale(0.6); transform-origin: top left;}
.leaflet-popup-content img.avnr_style_tiny_flag {
    height: 1.25em !important;
    width: auto !important;
    max-width: none;
    display: inline-block;
    vertical-align: middle;
}

/* --- Mobile responsive adjustments --- */
@media (max-width: 768px) {
    /* Stack airport cards vertically */
    .avnr_tm_input_section {
        flex-direction: column;
        flex-wrap: nowrap; /* Prevent wrapping, force vertical stack */
        gap: 15px;
        padding: 4px 2px; /* Reduced horizontal padding */
    }
    
    /* Make each airport card take full width without overflow */
    .avnr_tm_airport_card {
        flex: 1 1 auto;
        min-width: 0; /* Allow shrinking below content size */
        width: calc(100% - 4px); /* Subtract small margin for breathing room */
        max-width: 100%;
        box-sizing: border-box; /* Ensure padding is included in width */
        margin: 0 2px; /* Small horizontal margin */
    }
    
    /* Stack result section panels vertically */
    .avnr_tm_result_section {
        flex-direction: column;
        padding: 5px; /* Reduced padding for mobile */
    }
    
    .avnr_tm_right_panel,
    .avnr_tm_left_panel {
        width: 100%;
        margin-left: 0;
    }
    
    /* Adjust buttons container for mobile */
    .avnr_tm_buttons_container {
        padding: 5px;
        flex: 0 0 auto; /* Don't let it grow/shrink */
    }
    
    .avnr_tm_buttons_inner {
        align-items: flex-end; /* Keep natural button size, align right */
    }
    
    /* Let buttons maintain their natural size */
    .avnr_tm_buttons_inner button,
    .avnr_tm_buttons_inner form button {
        width: auto;
    }
    
    /* Make tabs scrollable horizontally on mobile if needed */
    .avnr_tm_tabs_nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .avnr_tm_tab_button {
        padding: 8px 16px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    
    /* Adjust airport card padding for mobile */
    .avnr_tm_airport_card {
        padding: 12px;
    }
    
    /* Reduce map height on mobile for better scrolling */
    .avnr_tm_map_container {
        min-height: 150px;
        max-height: 200px;
    }
}