/* Map View Styles */
.map-view {
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-controls {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    z-index: 1000;
    position: relative;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.controls-header h1 {
    margin: 0;
    color: var(--gray-900);
}

.view-toggles {
    display: flex;
    gap: 0.5rem;
}

.map-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    min-width: 150px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.map-container {
    flex: 1;
    position: relative;
    display: flex;
    height: calc(100vh - 140px);
    overflow: hidden;
}

.business-map {
    flex: 1;
    z-index: 1;
    position: relative;
}

.map-sidebar {
    width: 400px;
    background: white;
    border-left: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    height: 100%;
    position: relative;
}

.map-sidebar.hidden {
    transform: translateX(100%);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    flex-shrink: 0;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--gray-900);
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.sidebar-toggle:hover {
    background: var(--gray-200);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    height: calc(100% - 80px);
}

.business-list {
    padding: 1rem;
}

.business-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.business-card:hover,
.business-card.highlighted {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.business-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.business-header h4 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.1rem;
}

.verified-badge {
    background: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    font-weight: bold;
}

.business-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.stars {
    color: var(--accent-color);
}

.rating-text {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.business-category {
    color: var(--primary-color);
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.business-address {
    color: var(--gray-600);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

.business-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-300);
    background: white;
    color: var(--gray-700);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* Custom Map Markers */
.custom-marker-container {
    background: none !important;
    border: none !important;
}

.custom-marker {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

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

.custom-marker.verified {
    background: var(--secondary-color);
}

.user-location-container {
    background: none !important;
    border: none !important;
}

.user-location-marker {
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    box-shadow: var(--shadow);
    animation: pulse 2s infinite;
}

/* Marker Clusters */
.marker-cluster {
    background: var(--primary-color);
    border: 2px solid white;
    border-radius: 50%;
    text-align: center;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.marker-cluster div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

/* Business Popup */
.business-popup .leaflet-popup-content-wrapper {
    min-width: 320px;
}

.business-popup .leaflet-popup-content {
    margin: 1rem;
    font-family: var(--font-family-base);
    min-width: 280px;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.popup-actions .btn-sm,
.popup-actions .btn-primary,
.popup-actions .btn-outline {
    display: inline-block;
    text-decoration: none;
    text-align: center;
    line-height: 1.4;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
    cursor: pointer;
    transform: none !important;
}

.popup-actions .btn-sm:hover,
.popup-actions .btn-primary:hover,
.popup-actions .btn-outline:hover {
    transform: none !important;
}

.popup-content h3 {
    margin: 0 0 0.5rem 0;
    color: var(--gray-900);
}

.popup-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.popup-rating .stars {
    color: var(--accent-color);
}

.popup-category {
    color: var(--primary-color);
    font-weight: 500;
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
}

.popup-address {
    color: var(--gray-600);
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

.popup-actions {
    display: flex;
    gap: 0.5rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 1.5rem;
}

.business-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.business-info p {
    margin: 0 0 0.5rem 0;
}

.business-description h4 {
    margin: 0 0 0.5rem 0;
    color: var(--gray-900);
}

.business-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .map-container {
        flex-direction: column;
        height: calc(100vh - 180px);
        overflow: hidden;
    }

    .map-sidebar {
        width: 100%;
        height: 40%;
        border-left: none;
        border-top: 1px solid var(--gray-200);
        position: relative;
    }

    .map-sidebar.hidden {
        transform: translateY(100%);
    }

    .business-map {
        height: 60%;
        flex-shrink: 0;
    }

    .sidebar-content {
        height: calc(100% - 60px);
    }

    .map-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        justify-content: space-between;
    }

    .filter-group select {
        min-width: unset;
        flex: 1;
    }

    .modal-content {
        width: 95%;
        margin: 2% auto;
        max-height: 90vh;
    }

    .business-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .controls-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .view-toggles {
        justify-content: center;
    }

    .map-container {
        height: calc(100vh - 220px);
    }
}

/* Fullscreen mode */
.map-container:fullscreen {
    background: white;
}

.map-container:fullscreen .map-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    z-index: 1000;
}

/* Animation for smooth transitions */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Loading states */
.loading-marker {
    width: 30px;
    height: 30px;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Map Styles */
.map-view {
    min-height: 100vh;
    background: var(--gray-50);
}

.map-controls {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 0;
    position: sticky;
    top: 70px;
    z-index: 100;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.controls-header h1 {
    margin: 0;
    color: var(--gray-900);
}

.view-toggles {
    display: flex;
    gap: 0.5rem;
}

.map-filters {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: white;
    min-width: 150px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.map-container {
    display: flex;
    height: calc(100vh - 160px);
    position: relative;
}

.business-map {
    flex: 1;
    height: 100%;
    z-index: 1;
    min-height: 500px;
    width: 100%;
}

/* Ensure Leaflet map fills container */
#businessMap {
    width: 100% !important;
    height: 100% !important;
    min-height: 500px;
}

.directions-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
}