/* =========================================
   1. GLOBAL LAYOUT (NECESSARY CHANGES)
   ========================================= */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    /* ADDED: Prevents scrollbars so panel stays fixed */
    overflow: hidden; 
}

body {
    /* ADDED: This makes the Map and Panel stack vertically */
    display: flex;
    flex-direction: column; 
}

#map {
    /* CHANGED: 'flex: 1' tells map to take up all space NOT used by the panel */
    flex: 1;       
    width: 100%;
    /* Removed fixed height: 100% so it doesn't push panel off screen */
}

/* =========================================
   2. YOUR EXISTING CSS (UNTOUCHED)
   ========================================= */
.plane-icon {
    font-size: 20px; 
    line-height: 20px;
    text-align: center;
    width: 20px;
    height: 20px;
}

.plane-icon div {
    transform-origin: 50% 50%;
    transition: transform 0.5s ease-out; 
}

.aircraft-info-panel {
    display: flex;
    flex-direction: column;
    min-width: 320px; 
    font-family: sans-serif;
    padding: 10px;
    line-height: 1.4;
}

.image-container {
    width: 80%;
    height: 120px;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
}
.image-container img {
    max-width: 100%; 
    max-height: 100%;
    width: auto;     
    height: auto;    
    object-fit: contain; 
}
.data-row {
    display: flex;
    width: 100%;
}

.info-column-info, .info-column-stats {
    flex: 1;       
    width: 50%;     
    font-size: 0.9em;
    box-sizing: border-box;
    word-wrap: break-word; 
}
.info-column-info {
    padding-right: 10px;
    border-right: 1px solid #ccc;
}

.info-column-stats {
    padding-left: 10px;
}
.info-label {
    font-weight: bold;
    color: #333;
    display: inline-block;
    min-width: 60px;
}

/* =========================================
   3. NEW: BOTTOM PANEL & SEARCH (ADD THIS)
   ========================================= */
#bottom-panel {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 80px;
    background-color: #fff;
    border-top: 1px solid #ccc;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    z-index: 1000;
    box-sizing: border-box;
}

/* Search Section */
.search-container {
    position: relative;
    flex: 2;
    max-width: 600px;
    margin-right: 20px;
}

.search-box {
    display: flex;
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
    height: 40px; /* Desktop height */
}

.search-box input {
    width: 100%;
    padding: 0 12px;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    height: 100%;
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 15px;
    color: #888;
    font-size: 1.2em;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Dropdown Results */
.search-results {
    position: absolute;
    bottom: 100%; /* Floats UP over the map */
    left: 0;
    width: 100%;
    background: white;
    border: 1px solid #ccc;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.result-item {
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.result-item:hover {
    background-color: #f0f8ff;
}

/* Info Text Section */
.info-container {
    flex: 1;
    text-align: right;
    padding-left: 20px;
    white-space: nowrap;
}

.info-container h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.info-container p {
    margin: 2px 0 0 0;
    font-size: 0.85em;
    color: #666;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #bottom-panel {
        flex-direction: column-reverse;
        padding: 20px 20px 40px 20px; /* Extra bottom padding for thumbs */
    }
    
    .search-container {
        width: 100%;
        max-width: none;
        margin-right: 0;
    }

    .search-box {
        height: 50px; /* Taller for mobile touch */
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .info-container {
        width: 100%;
        text-align: center;
        padding: 0;
        margin-bottom: 20px;
        border-bottom: none;
    }
}