/* Map container */
#map {
    height: 500px;
    width: 100%;
    border-radius: 8px;
    margin-top: -200px;
}

.search-panel {
    margin-bottom: 20px;
}

/* Search container and input */
.search-container {
    width: 100%;
    position: relative;
    transition: all 0.3s ease; /* Add this for smooth transitions */
    background: white;
    border-radius: 4px;
    z-index: 1000;
    overflow: hidden; /* This helps with the animation */
}


#location-search {
    width: 100%;
    padding: 10px;
    padding-right: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 16px;
    box-sizing: border-box;
    transition: all 0.3s ease; 
}

/* New styles for search icon transition */
.search-icon {
    transition: all 0.3s ease;
}

/* Add these styles to your CSS */
.stations-toggle-btn {
    float: right;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.stations-toggle-btn:hover {
    background-color: #f0f0f0;
}

.stations-items-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Make the header row look nice with the button */
#nearest-stations h3 {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Autocomplete dropdown */
.autocomplete-items {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 999;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 250px;
    overflow-y: auto;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #f1f1f1;
}

.autocomplete-item:hover {
    background-color: #f8f8f8;
}

.autocomplete-loading, 
.autocomplete-no-results, 
.autocomplete-error {
    padding: 10px;
    color: #666;
    font-style: italic;
}

/* Nearest stations container */
#nearest-stations {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
    padding: 15px;
    background-color: #f9f9f9;
}

#nearest-stations h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

/* Stations list */
.nearest-stations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.nearest-stations-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.nearest-stations-list li:last-child {
    border-bottom: none;
}

.station-info {
    flex-grow: 1;
}

.station-name {
    display: block;
    font-weight: bold;
    margin-bottom: 3px;
}

.station-distance {
    color: #666;
    font-size: 14px;
}

.view-station-btn {
    background-color: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    margin-left: 10px;
}

.view-station-btn:hover {
    background-color: #2980b9;
}

/* Map elements */
.distance-label {
    background: none;
    border: none;
}

.distance-tooltip {
    background-color: white;
    border: 1px solid #3498db;
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 12px;
    pointer-events: none;
}

/* Map popup customization */
.leaflet-popup-content {
    margin: 10px;
}

.leaflet-popup-content strong {
    display: block;
    margin-bottom: 5px;
}


/* Media query for tablets and smaller devices */
@media screen and (max-width: 768px) {
    #map {
        margin-top: -100px; /* Reduce negative margin on tablets */
        height: 400px; /* Slightly smaller map height */
    }
    
    /* Add spacing between map and catalog */
    #catalog-container {
        margin-top: 30px; /* Creates space after the map */
    }
}

/* Media query for mobile phones */
@media screen and (max-width: 480px) {
    #map {
        margin-top: -50px; /* Further reduce negative margin on phones */
        height: 350px; /* Even smaller map height for mobile */
    }
    
    #catalog-container {
        margin-top: 40px; /* More space after the map on small screens */
    }
    
    /* Ensure the search panel is properly positioned */
    .search-panel {
        margin-bottom: 30px;
    }
}