/**
 * DCS Maps - MapLibre GL JS Styles
 * Custom styling for the MapLibre GL map interface
 */

/* Map Container */
.dcs-map-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #f0f0f0;
}

#dcs-map {
    width: 100%;
    height: 100%;
}

/* Custom Controls Container */
.dcs-map-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2000;
    pointer-events: visible !important; /* Allow all interactions */
}

/* Make interactive elements clickable */
.dcs-map-controls * {
    pointer-events: visible !important; /* All child elements can be clicked */
}

/* Apply same pointer-events to controls-container */
.controls-container {
    pointer-events: none !important; /* Allow map interactions to pass through */
}

.controls-container * {
    pointer-events: visible !important; /* All child elements can be clicked */
}

/* Search Control Styling */
.dcs-map-search-control {
    background: transparent;
    pointer-events: visible !important; /* Allow all interactions */
}

.dcs-map-search-control * {
    pointer-events: visible !important; /* All child elements can be clicked */
}
    z-index: 20000 !important;
    position: relative;
}

.dcs-map-search-control .search-input-wrapper:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59,130,246,0.2);
}

.dcs-map-search-control .search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59,130,246,0.25);
}

.dcs-map-search-control .search-input-wrapper:focus-within .search-icon {
    fill: #3b82f6;
}

/* Layer Controls */
.dcs-map-search-control .layer-controls:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59,130,246,0.2);
}

.dcs-map-search-control .layer-controls label {
    cursor: pointer;
    color: #374151;
    font-weight: 500;
}

.dcs-map-search-control .layer-controls input[type="checkbox"] {
    margin-right: 4px;
    margin-left: 0;
    accent-color: #3b82f6;
    width: 12px;
    height: 12px;
    vertical-align: middle;
    cursor: pointer;
}

/* Search Suggestions - FORCE above everything including business panel */
.dcs-map-search-control .search-suggestions,
.dcs-map-search-control #maplibre-search-suggestions,
#maplibre-search-suggestions,
.search-suggestions,
div#maplibre-search-suggestions {
    z-index: 10001 !important;
    position: absolute !important;
    isolation: isolate !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;
    transform: none !important;
    transition: none !important;
}

/* Ultra-specific targeting for search suggestions */
.dcs-map-container .dcs-map-search-control .search-container #maplibre-search-suggestions,
.dcs-map-container .dcs-map-search-control .marketplace-search-container #marketplace-search-suggestions {
    z-index: 10001 !important;
    position: absolute !important;
    isolation: isolate !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;
    transform: none !important;
    transition: none !important;
}

/* Marketplace search suggestions specific styling */
#marketplace-search-suggestions,
.marketplace-search-suggestions {
    z-index: 10001 !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 4px) !important;
    transform: none !important;
    transition: none !important;
}

/* Search suggestion items - even higher */
.search-suggestion-item,
.recent-search-item,
#maplibre-search-suggestions .search-suggestion-item,
#maplibre-search-suggestions .recent-search-item {
    z-index: 99999 !important;
    position: relative !important;
}

.dcs-map-search-control .search-suggestions::-webkit-scrollbar {
    width: 6px;
}

.dcs-map-search-control .search-suggestions::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.dcs-map-search-control .search-suggestions::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dcs-map-search-control .search-suggestions::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Home Button */
.dcs-home-btn {
    font-size: 20px;
    line-height: 1;
    padding: 0;
    background: white;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcs-home-btn:hover {
    background: #f0f0f0;
}

/* MapLibre GL Overrides */
.maplibregl-popup {
    max-width: 300px;
}

.maplibregl-popup-content {
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Business Tooltips - Remove White Background */
.maplibregl-popup.business-persistent-tooltip .maplibregl-popup-content,
.maplibregl-popup.business-hover-tooltip .maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.maplibregl-popup.business-persistent-tooltip .maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup.business-hover-tooltip .maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
    display: none !important;
}

.maplibregl-popup-content h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
}

.maplibregl-popup-content p {
    margin: 5px 0;
    font-size: 14px;
    color: #4b5563;
}

.maplibregl-popup-close-button {
    font-size: 20px;
    padding: 5px;
    color: #6b7280;
}

.maplibregl-popup-close-button:hover {
    color: #374151;
    background: #f3f4f6;
}

/* Business Info Panel */
.dcs-business-info-panel {
    backdrop-filter: blur(10px);
}

.dcs-business-info-panel::-webkit-scrollbar {
    width: 6px;
}

.dcs-business-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.dcs-business-info-panel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.dcs-business-info-panel .navigate-btn:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(59,130,246,0.3);
}

/* Notifications */
@keyframes slideUp {
    from { transform: translate(-50%, 20px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes slideDown {
    from { transform: translate(-50%, 0); opacity: 1; }
    to { transform: translate(-50%, 20px); opacity: 0; }
}

/* No Results Message */
.dcs-search-no-results {
    animation: fadeInOut 3s ease-in-out;
}

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

/* Road Edit Controls */
.dcs-road-edit-control button {
    width: 30px;
    height: 30px;
    font-size: 18px;
    background: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dcs-road-edit-control button:hover {
    background: #f0f0f0;
}

/* Mountain Gradient Effect */
.mountain-gradient {
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(232,232,232,0.6) 70%, rgba(211,211,211,1) 100%) !important;
}

/* Player Markers */
.dcs-player-marker {
    transition: all 0.3s ease;
}

.dcs-player-fade-in {
    animation: playerFadeIn 0.3s ease-out;
}

.dcs-player-fade-out {
    animation: playerFadeOut 0.3s ease-out;
}

@keyframes playerFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes playerFadeOut {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.8); }
}

.dcs-player-moving {
    transform: scale(1.1);
}

/* Marker Styles */
.dcs-marker-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dcs-map-controls {
        top: 5px;
        left: 5px;
    }
    
    .dcs-map-search-control .search-container {
        width: 280px !important;
    }
    
    .dcs-business-info-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* Print Styles */
@media print {
    .dcs-map-controls,
    .dcs-business-info-panel,
    .maplibregl-ctrl-container {
        display: none !important;
    }
}