/* Map Container */
#mapContainer {
    margin-top: 30px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#map {
    height: 600px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
    background-color: #e8f4f8 !important;
}

/* State Tooltip Styling */
.state-tooltip {
    background-color: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Filter Section */
.filter-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.filter-title {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #0d6efd;
}

.filter-section label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.filter-section select {
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-section select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

#resultsCount {
    font-weight: 600;
    color: #0d6efd;
    font-size: 1rem;
}

/* Marker Cluster Styling */
.marker-cluster-small {
    background-color: rgba(33, 150, 243, 0.8);
}

.marker-cluster-small div {
    background-color: rgba(13, 71, 161, 0.9);
    color: white;
    font-weight: bold;
}

.marker-cluster-medium {
    background-color: rgba(255, 152, 0, 0.8);
}

.marker-cluster-medium div {
    background-color: rgba(230, 81, 0, 0.9);
    color: white;
    font-weight: bold;
}

.marker-cluster-large {
    background-color: rgba(244, 67, 54, 0.8);
}

.marker-cluster-large div {
    background-color: rgba(183, 28, 28, 0.9);
    color: white;
    font-weight: bold;
}

.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    text-align: center;
    border-radius: 15px;
    font-weight: 700;
    font-size: 12px;
    line-height: 30px;
    color: #fff;
}

/* Custom Marker Icon */
.custom-marker-icon {
    background: none;
    border: none;
}

.custom-marker-icon svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.custom-marker-icon:hover svg {
    transform: scale(1.1);
}

/* Marker Popup Styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.marker-popup {
    padding: 5px;
    text-align: center;
}

.marker-popup h6 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.marker-popup p {
    font-size: 0.85rem;
    color: #6c757d;
}

.marker-popup .btn {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 5px 15px;
}

/* Modal Styling */
#centreModal .modal-dialog {
    max-width: 700px;
}

#centreModal .modal-header {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

#centreModal .modal-title {
    font-weight: 600;
    font-size: 1.3rem;
}

#centreModal .modal-body {
    padding: 25px;
}

#centreModal .table {
    margin-bottom: 0;
}

#centreModal .table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    vertical-align: middle;
}

#centreModal .table td {
    vertical-align: middle;
    color: #2c3e50;
}

#centreModal .badge {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Page Header */
.page-header-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    padding: 40px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.page-header-section h1 {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.page-header-section p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0;
}

/* Legend */
.map-legend {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    margin-top: 15px;
}

.map-legend h6 {
    font-weight: 600;
    margin-bottom: 12px;
    color: #2c3e50;
    font-size: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.legend-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

.legend-icon.ncoe {
    background-color: #198754;
}

.legend-icon.stc {
    background-color: #dc3545;
}

.legend-icon.extension {
    background-color: #ffc107;
}

.legend-label {
    font-size: 0.9rem;
    color: #495057;
}

/* Loading State */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    #map {
        height: 450px;
    }

    .page-header-section h1 {
        font-size: 1.8rem;
    }

    .page-header-section p {
        font-size: 0.95rem;
    }

    .filter-section {
        padding: 20px;
    }

    .filter-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    #centreModal .modal-dialog {
        max-width: 95%;
        margin: 10px auto;
    }

    #centreModal .table th,
    #centreModal .table td {
        font-size: 0.85rem;
        padding: 8px;
    }
}

@media (max-width: 576px) {
    #map {
        height: 400px;
    }

    .page-header-section {
        padding: 30px 0;
    }

    .page-header-section h1 {
        font-size: 1.5rem;
    }

    .filter-section .section-title {
        font-size: 1.2rem;
    }
}

/* Animation for filter reveal */
#secondaryFilters {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

/* Button Styles */
.btn-reset {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    font-weight: 500;
    padding: 8px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: #5a6268;
    border-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Info Box */
.info-box {
    background: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.info-box p {
    margin: 0;
    color: #084298;
    font-size: 0.95rem;
}

.info-box i {
    margin-right: 8px;
    color: #0d6efd;
}