/* Map View Styles */
.map-container {
    display: flex;
    gap: 40px;
    width: 100%;
    max-width: 1211px; /* 344 + 40 + 827 */
    margin: 0 auto;
    padding: 20px;
}

.map-left-column {
    width: 344px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 0 20px 20px 20px;
    min-height: 500px;
}

.map-right-column {
    flex: 1;
    width: 827px;
    flex-shrink: 0;
    position: relative;
}

.leaflet-map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 150px;
    z-index: 10;
}

/* Responsive - Mobile */
@media (max-width: 1024px) {
    .map-container {
        flex-direction: column;
        gap: 20px;
        max-width: 100%;
        padding: 10px;
    }
    
    .map-left-column {
        width: 100%;
        order: 2; /* Move to bottom on mobile */
    }
    
    .map-right-column {
        width: 100%;
        order: 1; /* Move to top on mobile */
    }
    
    .leaflet-map {
        height: 400px;
        position: static;
        top: auto;
    }

    /* remove offset when map is not sticky */
    .marker-list {
        margin-top: 0;
    }
}

/* Additional responsive breakpoints */
@media (max-width: 768px) {
    .map-container {
        padding: 5px;
        gap: 15px;
    }
    
    .map-left-column {
        padding: 15px;
        min-height: 300px;
    }
    
    .leaflet-map {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .map-left-column {
        padding: 10px;
        min-height: 250px;
    }
    
    .leaflet-map {
        height: 300px;
    }
}

/* Marker list styles */
.marker-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: calc(100vh - 200px); /* Adjust based on your layout */
    overflow-y: auto;
    padding-right: 8px; /* Space for scrollbar */
}

/* Mobile: smaller max-height for better mobile experience */
@media (max-width: 1024px) {
    .marker-list {
        max-height: calc(100vh - 300px);
    }
}

.marker-item {
    background: #CF7B801A;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.marker-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.marker-item h3 {
    margin: 0 0 15px 0;
    color: #000;
    font-size: 18px;
    font-weight: bold;
}

.marker-item .contact-section {
    margin-bottom: 15px;
}

.marker-item .contact-section h4 {
    margin: 0 0 10px 0;
    color: #000;
    font-size: 14px;
    font-weight: bold;
}

.marker-item .contact-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 14px;
}

.marker-item .contact-item .icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    display: inline-block;
}

.marker-item .contact-item .text {
    color: #000;
}

.marker-item .separator {
    height: 1px;
    background: #e0e0e0;
    margin: 15px 0;
}

.marker-item .location-hours {
    margin-top: 15px;
}

.marker-item .location-hours .contact-item {
    margin: 6px 0;
}

.marker-item .hours-detail {
    margin-left: 24px;
    font-size: 13px;
    color: #666;
}

/* Force all texts on the facility card to black, including links */
.marker-item,
.marker-item p,
.marker-item h1,
.marker-item h2,
.marker-item h3,
.marker-item h4,
.marker-item h5,
.marker-item h6,
.marker-item .text,
.marker-item a {
    color: #000 !important;
}

.marker-item a { text-decoration: none; }
.marker-item a:hover { text-decoration: underline; }

.marker-item .bottom-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.marker-item .check-button {
    background: #ffffff;
    border: none;
    color: #E83F4B !important;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none !important;
    display: inline-block;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: 4px 4px 0px 0px #009F98;
}

.marker-item .check-button:hover {
    background: #E83F4B;
    color: #ffffff !important;
    text-decoration: none !important;
}

.marker-item .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

/* Marker popup styles (simple) */
.marker-popup {
    max-width: 300px;
    font-family: Arial, sans-serif;
}

.marker-popup h3 {
    margin: 0 0 10px 0;
    color: #E83F4B;
    font-size: 16px;
    font-weight: bold;
}

.marker-popup p {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.marker-popup strong {
    color: #333;
}

.marker-popup a {
    color: #E83F4B;
    text-decoration: none;
}

/* Mobile map controls */
.mobile-map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 1000;
}

.map-control-btn {
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-control-btn:active {
    background: #f0f0f0;
    transform: scale(0.95);
}

/* Hide controls on desktop */
@media (min-width: 1025px) {
    .mobile-map-controls {
        display: none;
    }
}
