/* Locations Page Styles */

.locations-page {
    background-color: var(--bg-main);
}

/* Header Section */
.locations-header {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.header-title {
    font-family: var(--font-display);
    font-size: 3rem;
    margin-bottom: 1rem;
    color: white;
}

.header-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stat-badge i {
    font-size: 1.5rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Search Section */
.search-section {
    padding: 2rem 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    transition: all var(--transition-base);
    font-family: var(--font-body);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-result-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--bg-accent);
}

.result-icon {
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--bg-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-icon.foodbank {
    background-color: #fef3c7;
    color: #d97706;
}

.result-icon.organization {
    background-color: #dbeafe;
    color: #0284c7;
}

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

.result-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.result-location {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Map Section */
.map-section {
    padding: 2rem 0;
}

#map {
    height: 600px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
}

/* Custom Leaflet Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 250px;
}

.popup-content {
    padding: 1rem;
}

.popup-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.popup-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.popup-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.popup-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-foodbank {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-organization {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-truck {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.popup-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    max-height: 100px;
    overflow: hidden;
}

.popup-button {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background-color: var(--primary);
    color: white;
    text-align: center;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
}

.popup-button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    color: white;
}

/* Map Legend */
.map-legend {
    padding: 1.5rem 0;
    background: white;
    border-top: 1px solid var(--border-color);
}

.legend-items {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-icon {
    font-size: 1.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
    }
    
    .stat-badge {
        padding: 0.75rem 1.5rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    #map {
        height: 400px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.875rem 0.875rem 0.875rem 3rem;
    }
    
    .legend-items {
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .locations-header {
        padding: 2rem 1rem;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-badge {
        width: 100%;
        justify-content: center;
    }
}

/* Loading State */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1000;
}

.map-loading i {
    font-size: 3rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}