/**
 * Map Search Overlay
 * Floating "Search this area" button that appears when user navigates the map
 */

.map-search-overlay {
    position: absolute;
    top: 80px; /* Below navbar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 500; /* Above map, below filters/controls panel */
    pointer-events: none; /* Allow clicks through when hidden */
}

.map-search-overlay.visible {
    pointer-events: auto; /* Enable clicks when visible */
}

.map-search-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    
    /* Animation states */
    opacity: 0;
    transform: translateY(-10px);
}

.map-search-overlay.visible .map-search-button {
    opacity: 1;
    transform: translateY(0);
}

.map-search-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.map-search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.map-search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.map-search-button .icon {
    font-size: 18px;
}

.map-search-button .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
    .map-search-overlay {
        top: 70px; /* Adjust for mobile navbar */
    }
    
    .map-search-button {
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 20px;
    }
}

/* Ensure button doesn't overlap with timeline slider on mobile */
@media (max-width: 768px) and (orientation: portrait) {
    .map-search-overlay {
        top: 60px;
    }
}
