/* Location Radius Map Component Styles */

.location-radius-map-container {
    max-width: 100%;
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

}

/* Controls Section */
.lrm-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 768px) {
    .lrm-controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
}

/* Search Container */
.lrm-search-container {
    position: relative;
    flex: 1;
    min-width: 250px;
}

/* Selected Location Display */
.lrm-selected-location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-height: 20px;
    position: relative;
}

.lrm-location-label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.lrm-location-name {
    color: #007cba;
    font-weight: 500;
    flex: 1;
    word-break: break-word;
}

.lrm-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

/* .lrm-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
} */

.lrm-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.lrm-search-results.active {
    display: block;
}

.lrm-search-result {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    z-index: 1001;
}

.lrm-search-result:hover {
    background-color: #f8f9fa;
}

.lrm-search-result:last-child {
    border-bottom: none;
}

.lrm-no-results {
    padding: 12px 15px;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Radius Container */
.lrm-radius-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lrm-radius-container label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.lrm-radius-select {
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    min-width: 100px;
    box-sizing: border-box;
}

/* .lrm-radius-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
} */

/* Map Container */
.lrm-map {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ddd;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    width: 100% !important;
    min-height: 400px;
}

/* Ensure Mapbox canvas fills container properly */
.lrm-map .mapboxgl-canvas-container {
    width: 100% !important;
    height: 100% !important;
}

.lrm-map .mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Custom Mapbox Popup Styles */
.mapboxgl-popup-content {
    padding: 15px;
    border-radius: 8px;
    font-family: inherit;
}

.lrm-popup-content h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 16px;
}

.lrm-popup-content p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.lrm-popup-link {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.lrm-popup-link:hover {
    background: #005a87;
    color: white;
}

/* Schools List - Removed as per user request */

/* Loading States */
.lrm-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #666;
}

.lrm-loading::before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: lrm-spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes lrm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.lrm-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    color: #c33;
    margin: 10px 0;
}

/* Empty State */
.lrm-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.lrm-empty-state h4 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Custom Marker Styles */
.lrm-marker {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #007cba;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.lrm-marker.selected {
    background: #ff6b35;
    transform: scale(1.2);
}

/* Center Marker (User Location) - Red Pin */
.lrm-center-marker {
    width: 0;
    height: 0;
    position: relative;
    cursor: pointer;
}

.lrm-center-marker::before {
    content: "";
    width: 36px;
    height: 36px;
    position: absolute;
    top: -36px;
    left: -18px;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="36" viewBox="0 0 24 24"><path d="M12 0c-4.198 0-8 3.403-8 7.602 0 4.198 3.469 9.21 8 16.398 4.531-7.188 8-12.2 8-16.398 0-4.199-3.801-7.602-8-7.602zm0 11c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3z" fill="%23C92C2C"></path></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
    z-index: 1000;
}

.lrm-center-marker::after {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    width: 4px;
    height: 4px;
    background: #dc3545;
    border-radius: 50%;
    box-shadow: 0 0 0 2px white, 0 2px 4px rgba(0,0,0,0.3);
    z-index: 1001;
}

/* Radius Circle */
.lrm-radius-circle {
    fill: rgba(0, 124, 186, 0.1);
    stroke: #007cba;
    stroke-width: 2;
}

/* Responsive Design */

/* Location Selection Notification */
.lrm-location-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* Auto-selected center indicator */
.lrm-auto-selected .lrm-center-marker {
    animation: pulse 2s infinite;
}

/* Auto-tracking mode indicator */
.lrm-auto-tracking {
    position: relative;
}

.lrm-auto-tracking::before {
    content: "🎯 Auto-tracking: Location follows your map movement";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.3);
    animation: trackingPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    70% {
        transform: scale(1.2);
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0);
    }
}

@keyframes trackingPulse {
    0%, 100% { 
        opacity: 0.8; 
        transform: translateX(-50%) scale(1);
    }
    50% { 
        opacity: 1; 
        transform: translateX(-50%) scale(1.05);
    }
}

/* Enhanced center point visualization for auto-tracking */
.lrm-auto-tracking .mapboxgl-marker {
    animation: centerPulse 2s ease-in-out infinite;
}

@keyframes centerPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Dynamic radius circle enhancement for auto-tracking */
.lrm-auto-tracking .lrm-radius-circle {
    stroke-dasharray: 5, 5;
    animation: dashMove 2s linear infinite;
}

@keyframes dashMove {
    to {
        stroke-dashoffset: -10;
    }
}

/* Enhanced map cursor */
.lrm-map.click-enabled {
    cursor: crosshair !important;
}

.lrm-map.click-enabled .mapboxgl-canvas-container {
    cursor: crosshair !important;
}

/* Mobile responsive notification */
@media (max-width: 768px) {
    .lrm-location-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
        font-size: 13px;
        padding: 10px 15px;
    }
    
    .lrm-map.clickable::after {
        font-size: 11px;
        padding: 6px 10px;
        bottom: 5px;
        left: 5px;
        right: 5px;
        text-align: center;
    }
    
    .lrm-auto-tracking::before {
        content: "🎯 Following movement";
        font-size: 11px;
        padding: 6px 12px;
        top: 5px;
        left: 5px;
        right: 5px;
        transform: none;
        text-align: center;
    }

    /* Mobile styles for selected location display */
    .lrm-selected-location {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding:  10px 0px;
    }

    .lrm-location-label {
        font-size: 13px;
    }

    .lrm-location-name {
        font-size: 13px;
        line-height: 1.3;
    }
}

.lrm-reset-location {
    background: none;
    border: none;
    padding: 0 0 0 8px;
    margin-left: auto;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.85;
    transition: opacity 0.2s;
}
.lrm-reset-location svg {
    display: block;
}
.lrm-reset-location:hover {
    opacity: 1;
    background: none;
}

.lrm-reset-location:focus {
    outline: none;
    box-shadow: 0 0 0 2px #dc354533;
}
