/* ================================
   MAP COMPONENTS
   ================================ */

#fullMap .map-container {
   height:100%;
   flex: 1;
   background: var(--white);
   position: relative;
   align-content: space-evenly;
   overflow: hidden;
}

#fullMap .full-map {
    width: 100%;
    height: 100%;
    flex-shrink: 0;
}

#fullMap .map-legend {
   background: var(--bg-white);
   box-shadow: var(--shadow);
   line-height: 1.2;
   backdrop-filter: blur(10px);
   position: fixed;
   left: 0;
   bottom: var(--nav-height);
   display: flex;
   flex-direction: column;
}

#fullMap .map-location-btn {
   background: var(--primary-gradient);
}

#fullMap .legend-title {
   padding: var(--space-xs);
   font-weight: 600;
   background: var(--primary-gradient);
   color: var(--text-white);
}

#fullMap .legend-item {
   display: flex;
   padding: var(--space-xxs) 0;
   margin: var(--space-xs);
   gap: var(--space-xs);
}
   
#fullMap .legend-marker {
   width: var(--space-md);
   height: var(--space-md);
   border-radius: 50%;
   border: 1px solid var(--text-white);
   flex-shrink: 0;
}

#fullMap .legend-marker.always-tap-cask {
   background: var(--gold);
   border-color: var(--dark-gold);
   box-shadow: 0 0 4px rgba(255, 215, 0, 0.6);
}

#fullMap .legend-marker.always-bottle-can {
   background: var(--green);
   border-color: var(--dark-green);
}

#fullMap .legend-marker.currently {
   background: var(--blue);
   border-color: var(--dark-blue);
}

#fullMap .legend-marker.not-currently {
   background: var(--red);
   border-color: var(--dark-red);
}

#fullMap .legend-marker.unknown {
   background: var(--light-grey);
   border-color: var(--dark-grey);
}

#fullMap .legend-marker.user-location {
   background: var(--purple);
   border-color: var(--white);
}


/* Map Popup Styling */
#fullMap .leaflet-popup-content-wrapper {
   border-radius: var(--radius-xl) !important;
   box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2) !important;
   border: 2px solid rgba(139, 92, 246, 0.2) !important;
   text-align: center !important;
}

#fullMap .leaflet-popup-content {
   margin: var(--space-md) 0 !important;
   min-width: 250px;
}

#fullMap .popup-title {
   font-size: var(--text-lg);
   font-weight: 700;
   margin-bottom: var(--space-lg);
   background: var(--primary-gradient);
   -webkit-background-clip: text;
   -webkit-text-fill-color: transparent;
   background-clip: text;
}

#fullMap .popup-address,
#fullMap .popup-postcode {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

#fullMap .popup-distance {
    font-size: 0.9rem;
    color: var(--purple);
    font-weight: 600;
    margin: 0.5rem 0;
}

#fullMap .popup-gf-status {
    padding: 0.5rem;
    border-radius: 10px;
    margin: 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

#fullMap .popup-gf-status.always-gf {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--gold);
    border: 1px solid var(--gold);
}

#fullMap .popup-gf-status.current-gf {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
    color: var(--green);
    border: 1px solid var(--green);
}

#fullMap .popup-gf-status.no-gf {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid var(--red);
}

#fullMap .popup-gf-status.unknown {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

#fullMap .popup-button {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

#fullMap .popup-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Leaflet popup arrow styling */
#fullMap .leaflet-popup-tip {
    background: white !important;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top: none;
    border-right: none;
}

#fullMap .results-map-container {
    display: none; /* Hidden by default */
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
    flex: 1;
}

#fullMap .results-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    position: relative;
}

#fullMap .marker-cluster {
    background-color: var(--light-grey) !important;
}

#fullMap .marker-cluster div {
    background-color: var(--dark-grey) !important;
}


/* Add this to your map.css file */

/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.map-loading-content {
    text-align: center;
    padding: var(--space-xl);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto var(--space-lg);
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.loading-subtext {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Map Retry Control Styles */
.map-retry-container {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-lg);
    max-width: 250px;
}

.map-retry-content {
    text-align: center;
}

.retry-icon {
    font-size: 2rem;
    margin-bottom: var(--space-sm);
}

.map-retry-content p {
    margin: var(--space-sm) 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.map-retry-content .btn {
    width: 100%;
    margin-top: var(--space-md);
}

/* Better contrast for map markers */
.leaflet-marker-icon.always-tap-cask-marker {
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
}

.leaflet-marker-icon.always-bottle-can-marker {
    filter: drop-shadow(0 0 3px rgba(16, 185, 129, 0.6));
}
