/**
 * ============================================================
 * QBCore FiveM Website - Map Styles
 * ============================================================
 * Leaflet.js Custom Styling für GTA V Map (Banger City Retrowave Theme)
 */

/* ============================================================
   Leaflet Base Overrides
   ============================================================ */
.leaflet-container {
    background: #1a0f2e;
    font-family: var(--font-family, 'Inter', sans-serif);
}

/* ============================================================
   Custom Player Markers (Animated)
   ============================================================ */
.custom-marker {
    background: transparent;
    border: none;
}

.marker-pin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.marker-pin:hover {
    transform: scale(1.2);
    border-color: rgba(255, 255, 255, 0.8);
}

.marker-pin::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    opacity: 0.3;
    animation: markerPulse 2s infinite;
}

@keyframes markerPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.2;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ============================================================
   Player Popup (Retrowave Theme)
   ============================================================ */
.leaflet-popup-content-wrapper {
    background: rgba(26, 15, 46, 0.95);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(0, 212, 255, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(0, 212, 255, 0.3);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    color: #fff;
    font-size: 0.95rem;
}

.leaflet-popup-tip {
    background: rgba(26, 15, 46, 0.95);
    border: 2px solid rgba(0, 212, 255, 0.4);
}

.leaflet-popup-close-button {
    color: #00d4ff !important;
    font-size: 1.5rem !important;
    padding: 8px !important;
    opacity: 0.7 !important;
}

.leaflet-popup-close-button:hover {
    opacity: 1 !important;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

.player-popup {
    min-width: 220px;
}

.player-popup-header {
    padding: 15px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(255, 26, 255, 0.1));
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-popup-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.player-popup-body {
    padding: 0 15px 15px;
}

.player-popup-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popup-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.popup-info-row:last-child {
    border-bottom: none;
}

.popup-info-label {
    color: #8b7db8;
    font-size: 0.85rem;
}

.popup-info-value {
    color: #00d4ff;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

display: flex;
align-items: center;
gap: 8px;
padding-bottom: 8px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
margin-bottom: 8px;
}

.player-popup-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
}

.player-popup-name {
    font-weight: 600;
    font-size: 14px;
}

.player-popup-job {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.player-popup-coords {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-family: monospace;
}

/* Close Button */
.leaflet-popup-close-button {
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: 18px !important;
    padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
    color: #00d4ff !important;
}

/* ============================================================
   Zoom Controls
   ============================================================ */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-control-zoom a {
    background: rgba(20, 20, 30, 0.9) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 18px !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(0, 212, 255, 0.2) !important;
    color: #00d4ff !important;
    border-color: rgba(0, 212, 255, 0.3) !important;
}

.leaflet-control-zoom-in {
    border-radius: 8px 8px 0 0 !important;
}

.leaflet-control-zoom-out {
    border-radius: 0 0 8px 8px !important;
}

/* ============================================================
   Attribution
   ============================================================ */
.leaflet-control-attribution {
    background: rgba(20, 20, 30, 0.8) !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 10px !important;
    padding: 4px 8px !important;
    border-radius: 4px 0 0 0 !important;
}

.leaflet-control-attribution a {
    color: #00d4ff !important;
}

/* ============================================================
   Custom Map Legend (in-map)
   ============================================================ */
.map-legend-control {
    background: rgba(20, 20, 30, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 12px;
}

.map-legend-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #00d4ff;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.map-legend-item:last-child {
    margin-bottom: 0;
}

.map-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
}

/* ============================================================
   Job-specific Marker Colors
   ============================================================ */
.marker-police .player-marker-dot {
    background: #3498db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #3498db;
}

.marker-police .player-marker-pulse {
    background: #3498db;
}

.marker-ambulance .player-marker-dot {
    background: #e74c3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #e74c3c;
}

.marker-ambulance .player-marker-pulse {
    background: #e74c3c;
}

.marker-mechanic .player-marker-dot {
    background: #f39c12;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #f39c12;
}

.marker-mechanic .player-marker-pulse {
    background: #f39c12;
}

.marker-taxi .player-marker-dot {
    background: #f1c40f;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #f1c40f;
}

.marker-taxi .player-marker-pulse {
    background: #f1c40f;
}

.marker-trucker .player-marker-dot {
    background: #9b59b6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #9b59b6;
}

.marker-trucker .player-marker-pulse {
    background: #9b59b6;
}

.marker-garbage .player-marker-dot {
    background: #27ae60;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #27ae60;
}

.marker-garbage .player-marker-pulse {
    background: #27ae60;
}

.marker-unemployed .player-marker-dot {
    background: #95a5a6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 0 2px #95a5a6;
}

.marker-unemployed .player-marker-pulse {
    background: #95a5a6;
}

/* ============================================================
   Loading State
   ============================================================ */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    z-index: 1000;
}

.map-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 212, 255, 0.2);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.map-loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ============================================================
   No Data State
   ============================================================ */
.map-no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1000;
}

.map-no-data-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .leaflet-control-zoom a {
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        font-size: 16px !important;
    }

    .player-marker-dot {
        width: 20px;
        height: 20px;
    }

    .player-marker-pulse {
        width: 32px;
        height: 32px;
    }

    .map-legend-control {
        font-size: 11px;
        padding: 8px;
    }
}