/**
 * Airsoft Map Styles
 * 
 * @package AirsoftLocator
 * @since 1.0.0
 */

/* Map Container */
.airsoft-map-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 0.75rem;
    overflow: hidden;
}

.airsoft-map-container.large {
    min-height: 400px;
}

/* Custom Map Icons */
.custom-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Military Marker Styles */
.military-marker {
    background: transparent !important;
    border: none !important;
}

.marker-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
}

.marker-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
    max-width: 150px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.marker-label::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.8);
}

.association-marker {
    width: 40px !important;
    height: 40px !important;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.association-marker:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

.team-marker {
    width: 40px !important;
    height: 40px !important;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.team-marker:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
}

/* Map Popups */
.map-popup {
    min-width: 200px;
    max-width: 300px;
}

.popup-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
}

.popup-info p {
    margin: 4px 0;
    font-size: 14px;
    color: #666;
    font-family: 'Inter', sans-serif;
}

.popup-info p strong {
    color: #333;
    font-weight: 600;
}

/* Enhanced Map Info Popup */
.map-info {
    padding: 0;
    margin: 0;
}

.map-info h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-family: 'Inter', sans-serif;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.map-info p {
    margin: 6px 0;
    font-size: 14px;
    color: #4b5563;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.map-info p strong {
    color: #1f2937;
    font-weight: 600;
}

.map-info a {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.map-info a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Popup Action Button */
.map-info .mt-3 a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-info .mt-3 a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.map-info .mt-3 a svg {
    width: 16px;
    height: 16px;
    margin-right: 8px;
}

/* Leaflet Overrides */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leaflet-popup-tip {
    background: white;
}

.leaflet-popup-close-button {
    color: #666;
    font-size: 18px;
    font-weight: bold;
}

.leaflet-popup-close-button:hover {
    color: #333;
}

/* Map Controls */
.leaflet-control-zoom {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.leaflet-control-zoom a {
    background: #fff;
    color: #333;
    border: none;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.leaflet-control-zoom a:hover {
    background: #f8f9fa;
    color: #ff6b35;
}

/* Tactical Map Style */
.tactical-map {
    filter: hue-rotate(20deg) contrast(1.1) saturate(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .airsoft-map-container {
        min-height: 300px;
    }
    
    .association-marker,
    .team-marker {
        width: 30px !important;
        height: 30px !important;
    }
    
    .map-popup {
        min-width: 150px;
        max-width: 250px;
    }
    
    .popup-title {
        font-size: 14px;
    }
    
    .popup-info p {
        font-size: 12px;
    }
}

/* Loading State */
.airsoft-map-container.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #fff;
}

.legend-color.association {
    background: #28a745;
}

.legend-color.team {
    background: #ff6b35;
}

/* Map Filter Buttons */
.map-filter-btn {
    background: rgba(42, 42, 42, 0.9);
    border: 1px solid rgba(64, 64, 64, 0.8);
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-filter-btn:hover {
    background: rgba(255, 107, 53, 0.9);
    border-color: rgba(255, 107, 53, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.map-filter-btn.active {
    background: rgba(255, 107, 53, 0.9);
    border-color: rgba(255, 107, 53, 0.8);
    color: #ffffff;
}

.map-filter-btn.active:hover {
    background: rgba(255, 107, 53, 1);
    transform: translateY(-1px);
}

.map-filter-btn svg {
    transition: transform 0.2s ease;
}

.map-filter-btn:hover svg {
    transform: scale(1.1);
}

/* Floating Cards Z-Index Fix */
.absolute.z-50 {
    z-index: 50 !important;
}

/* Map Container Z-Index */
.airsoft-map-container {
    position: relative;
    z-index: 1;
}

/* Dark Theme Styles */
.tactical-map.dark-theme {
    filter: hue-rotate(180deg) invert(1) contrast(0.8) saturate(1.2);
}

.tactical-map.dark-theme .leaflet-tile {
    filter: invert(1) hue-rotate(180deg);
}

/* Responsive Filter Buttons */
@media (max-width: 768px) {
    .map-filter-btn {
        min-width: 100px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .map-filter-btn span {
        display: none;
    }
    
    .map-filter-btn svg {
        width: 16px;
        height: 16px;
    }
}
