:root {
    --primary: #2c3e50;
    --danger: #e74c3c;
    --glass: rgba(255, 255, 255, 0.95);
    --nav-height: 140px; /* Estimated height for header + ad banner */
}

/* Base resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f4f7f9;
}

/* 1. Stick the top containers (Header & Ad) */
#header-container, 
.top-ad-banner {
    position: sticky;
    top: 0;
    z-index: 1050; /* Above Leaflet but below Bootstrap Modals */
    background: white;
}

.top-ad-banner {
    top: 60px; /* Offset by the approximate height of your header */
    border-bottom: 1px solid #ddd;
}

/* 2. Map Container logic */
#map-container {
    position: relative;
    width: 100%;
    /* Calculates height: Full screen minus the space taken by top navs */
    height: calc(100vh - var(--nav-height)); 
    min-height: 400px;
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* 3. Map fills its specific container */
#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* UI Overlay adjustments for inside the container */
.ui-overlay {
    position: absolute;
    top: 20px; /* Positioned relative to #map-container */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 92%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Rest of your functional styling remains the same --- */

input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 30px;
    border: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    font-size: 16px;
    outline: none;
    background: var(--glass);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

input:focus {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: scale(1.02);
}

#suggestions {
    background: var(--glass);
    border-radius: 18px;
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.sug-item {
    padding: 12px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sug-item:hover {
    background: rgba(44, 62, 80, 0.1);
}

.btn-clear {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    font-size: 14px;
}

.toast {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 11px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast.show {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    :root {
        --nav-height: 100px;
    }
    
    #map-container {
        height: 60vh; /* Shorter on mobile to allow reading text below */
    }

    .ui-overlay {
        top: 10px;
    }
}