html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
}

/* =====================================================
   Layout Logic
   ===================================================== */
#container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Prevents the whole page from scrolling */
}

#mainContent {
    display: flex;
    flex: 1;
    overflow: hidden; /* Prevents double scrollbars */
}

/* Horizontal Mode (List on top, Map on bottom) */
.layout-horizontal {
    flex-direction: column;
}
.layout-horizontal #divider {
    height: 6px;
    width: 100%;
    cursor: row-resize;
    background: #cbd5e1;
}
.layout-horizontal #airportListContainer {
    width: 100%;
    height: 25%; /* Initial height */
    min-height: 50px;
}

/* Vertical Mode (List on left, Map on right) */
.layout-vertical {
    flex-direction: row;
}
.layout-vertical #divider {
    width: 6px;
    height: 100%;
    cursor: col-resize;
    background: #cbd5e1;
}
.layout-vertical #airportListContainer {
    height: 100%;
    width: 350px; /* Initial width */
    min-width: 150px;
}

#airportListContainer {
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure the container fills the sidebar */
    overflow: hidden; /* Prevent the container itself from scrolling */
}

/* Wrappers control the scrolling and space */
#ultraListWrapper, #airportListWrapper {
    overflow-y: auto;
    background: #fff;
    min-height: 0; /* Essential for flex-scrolling */
    display: flex;
    flex-direction: column;
}

#ultraList, #airportList {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Initial height for Ultras */
#ultraListWrapper {
    height: 150px; 
}

/* The airport list wrapper fills its panel */
#airportListWrapper {
    flex: 1; 
}

#ultraDivider {
    height: 4px;
    background: #e2e8f0;
    cursor: row-resize;
    flex-shrink: 0;
    border-top: 1px solid #cbd5e1;
    border-bottom: 1px solid #cbd5e1;
}

#ultraDivider:hover {
    background: #cbd5e1;
}



#map {
    flex: 1;
}







#controls {
    padding: 10px;
    background: #f4f4f4;
    border-bottom: 1px solid #ccc;
}

#divider {
    background: #ccc;
    height: 6px;
    cursor: row-resize;
}



input[type="text"] { padding: 5px; width: 180px; }
button { padding: 6px 10px; margin-left: 5px; cursor: pointer; }

/* =====================================================
   Autocomplete suggestions for Add Airport
   ===================================================== */
.airport-autocomplete {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 360px;
    max-width: calc(100vw - 24px);
    max-height: 320px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    z-index: 10000;
}

#airportSuggestions {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    max-height: 400px; /* Increased height for better visibility */
    overflow-y: auto;
    position: absolute;
    
    /* Change width to be significantly wider than the input */
    width: 400px; 
    
    /* Ensure it stays aligned to the left of the input box */
    left: 0;
    
    /* Ensure it appears above other map elements */
    z-index: 2000; 
    margin-top: 4px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Optional: Add a media query to ensure it doesn't overflow on small screens */
@media (max-width: 700px) {
    #airportSuggestions {
        width: 90vw;
    }
}

.suggestions.hidden {
    display: none;
}

.suggestion-item {
    padding: 10px 12px;
    border-bottom: 1px solid #334155;
    cursor: pointer;
}

.suggestion-item:hover, .suggestion-item.active {
    background: #334155;
}

.suggestion-item strong {
    font-weight: 600;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-sep {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}



#airportList li {
    padding: 2px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: none;
}

#airportListContainer.collapsed {
    display: none !important;
}

#divider.collapsed {
    display: none !important;
}


/* --- ADDITIONAL: New hover effect --- */
#airportList li:hover {
    background: #f8fafc;
}

/* --- ADDITIONAL: Explicitly styling the links --- */
#airportList li a {
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
    white-space: nowrap;
}

#airportList li a:hover {
    text-decoration: underline;
}

/* --- ADDITIONAL: New class to match Ultras text --- */
.airport-details {
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

/* --- OVERWRITE: Replacing old .remove-btn --- */
.remove-btn {
    color: #94a3b8;
    cursor: pointer;
    font-size: 10px;
    font-weight: normal;
}

.remove-btn:hover {
    color: #ef4444;
}

/* --- OVERWRITE: Replacing old .chk-group --- */
.chk-group {
    display: flex;
    gap: 8px;
    font-size: 12px;  
    color: #64748b; 
    font-weight: normal; 
    flex-shrink: 0;
    align-items: center;
}

/* --- OVERWRITE: Replacing old .airport-selected --- */
.airport-selected {
    background-color: #dbeafe !important;
    border-left: 4px solid #2563eb;
    padding-left: 8px !important; 
}

#loadStatus {
    margin-top: 10px;
    display: flex;            /* Enables side-by-side layout */
    justify-content: space-between; /* Pushes Text to left, Version to right */
    align-items: flex-end;    /* Keeps them aligned on the same bottom line */
}


#version-info {
    /* Remove the old position: absolute; top: 5px; right: 10px; etc. */
    font-size: 10px;
    color: #888;
    pointer-events: none;
    white-space: nowrap;      /* Prevents version from wrapping to a second line */
}


.modal::backdrop {
  background: rgba(0,0,0,0.35);
}

.modal {
  border: none;
  padding: 0;
  border-radius: 12px;
  max-width: 420px;
  width: calc(100% - 24px);
}

.modal-card {
  padding: 14px 14px 12px;
  background: #fff;
}

.modal-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
}

.modal-text {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #334155;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-actions button {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  cursor: pointer;
}

.modal-actions button:hover {
  background: #f1f5f9;
}

.modal-cancel {
  opacity: 0.85;
}



.spotlight-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  animation: spotlight-fade 4s ease-out forwards;
}

.spotlight-overlay::before {
  content: "";
  position: absolute;
  inset: 0;

  background: radial-gradient(
    circle var(--spotlight-radius) at var(--spotlight-x) var(--spotlight-y),
    rgba(0,0,0,0) 0%,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.45) 62%,
    rgba(0,0,0,0.45) 100%
  );

  animation: spotlight-shrink 5s ease-out forwards;
}

@keyframes spotlight-fade {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes spotlight-shrink {
  0%   { --spotlight-radius: 320px; }
  100% { --spotlight-radius: 0px; }
}

@media (prefers-reduced-motion: reduce) {
  .spotlight-overlay,
  .spotlight-overlay::before {
    animation: none !important;
    opacity: 0 !important;
  }
}

/* =====================================================
   Ultras Panel 
   ===================================================== */
#ultraPanel, #airportPanel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: none; 
}

/* The Airport Panel should take all remaining space by default */
#airportPanel {
    flex: 1; 
}

.ultra-header {
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: bold;
    flex-shrink: 0; /* Header never shrinks */
}

.ultra-header:hover { background: #334155; }

#ultraList {
    list-style: none;
    margin: 0;
    padding: 0;
    /* REMOVE max-height: 200px; */
    height: 100%; /* Add this to ensure it fills the resized wrapper */
}

.ultra-item {
    padding: 2px 12px;  /* Tight vertical spacing */
    border-bottom: none; /* Line removed as requested */
    font-size: 12px;    /* Restored to original size */
    display: flex;
    gap: 0px;
    align-items: center;
}

/* Hover background helps guide the eye since the lines are gone */
.ultra-item:hover { background: #f8fafc; }

.ultra-link {
    color: #2563eb;
    text-decoration: none;
    font-weight: bold;
    flex-shrink: 0;
}

.ultra-link:hover { text-decoration: underline; }

.ultra-details {
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;    /* Restored to original size */
}

.rarity-badge {
    background: #fee2e2;
    color: #991b1b;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 10px;    /* Restored to original size */
    font-weight: bold;
    flex-shrink: 0;
}


/* =====================================================
   Ultras plotting button feedback
   ===================================================== */
button.loading {
    opacity: 0.7;
    pointer-events: none;
}
