/* ===================================
   Mapbox Map Styles & Customization
   =================================== */

/* Map Marker Styling */
.artwork-marker {
    background-color: var(--primary-red);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.artwork-marker:hover {
    transform: scale(1.2);
    z-index: 10;
}

.artwork-marker.active {
    background-color: var(--dark-red);
    transform: scale(1.3);
    z-index: 20;
}
.map-style-control {
    position: absolute;
     bottom: 108px;
     left: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.map-control-btn {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    opacity:1;
    background: var(--primary-red);
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-control-btn:hover {
   background: var(--accent);
   border: 2px solid white;
   
}

.style-btn.active {
    background: var(--primary-red);
    color: white;
    opacity: 1
}



/* Map Cluster Styles */
.mapboxgl-popup-content {
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapboxgl-popup-close-button {
    font-size: 20px;
    padding: 8px;
    color: #666;
    z-index: 10;
}

.mapboxgl-popup-close-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #CE292C;
}

/* Popup content styling */
.popup-content {
    max-width: 300px;
}

.popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.popup-info {
    padding: 12px;
}

.popup-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #2c2c2c;
}

.popup-artist {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.popup-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 0 ;
}

.popup-type {
    display: inline-block;
    background-color: #CE292C;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 8px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
     position: absolute;
     top: 4px;
     left: 4px;
}

.popup-link {
    display: inline-flex;
    align-items: center;
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%23CE292C' d='M4 11v2h12l-5.5 5.5l1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5L16 11z'/%3E%3C/svg%3E") no-repeat right;
    padding-right: 16px;
 }

.popup-link:hover  {
    background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2300a8ff' d='M4 11v2h12l-5.5 5.5l1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5L16 11z'/%3E%3C/svg%3E") no-repeat right;
    padding-right: 12px;
}
/* Map Popup Styling */
.mapboxgl-popup {
    max-width: 300px;
}

.mapboxgl-popup-content {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    padding: 0 !important
}

.mapboxgl-popup-close-button {
   font-size: 18px !important;
    /* padding: 0px; */
    color: var(--primary-red);
    right: 4px !important;
    top: 4px !important;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 2px !important;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: .3em;
}

.mapboxgl-popup-close-button:hover {
    background: var(--primary-red) !important;
    color:white;
}

  
/* Map Controls */
.mapboxgl-ctrl-group {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.mapboxgl-ctrl-group button {
    width: 32px;
    height: 32px;
}

.mapboxgl-ctrl-icon {
    background-size: 20px;
}

/* Geocoder Search Box */
.mapboxgl-ctrl-geocoder {
    min-width: 300px;
    max-width: 400px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.mapboxgl-ctrl-geocoder input {
    font-size: 14px;
    padding: 8px 35px 8px 32px;
}

.mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-search {
    fill: var(--primary-red);
}

/* Cluster Styling */
.cluster-marker {
    background-color: var(--primary-red);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.cluster-marker:hover {
    transform: scale(1.1);
    background-color: var(--dark-red);
}

/* Fullscreen Map View */
.map-fullscreen {
    position: fixed;
    top: 0px;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

.map-fullscreen #artwork-map {
    width: 100%;
    height: 100%;
}

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

.map-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-gray);
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Map Attribution Styling */
.mapboxgl-ctrl-attrib {
    background-color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

.mapboxgl-ctrl-attrib a {
    color: var(--primary-red);
}

/* Mobile Map Adjustments */
@media (max-width: 768px) {
    .mapboxgl-ctrl-geocoder {
        min-width: 200px;
        max-width: 250px;
    }
    
    .map-style-control {
        position: absolute;
         bottom: 120px;
         left: 8px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 10;
    }

    .mapboxgl-popup-content {
        max-width: 250px;
        padding: 0 !important;
    }
}
