/* ================================
   16 - LEAFLET MAP STYLES
   Tema scuro coordinato con l'app
   ================================ */

/* --- Map Container --- */
.workspace-map-area {
    height: 50%;
    min-height: 300px;
    position: relative;
    background: var(--dark-blue);
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

#mapbox-container {
    width: 100%;
    height: 100%;
}

.map-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #070d18 0%, #0f1a2e 100%);
    color: #94a3b8;
    gap: 1rem;
    z-index: 1;
}

.map-placeholder i {
    font-size: 3rem;
    color: var(--primary-sky);
    opacity: 0.5;
}

.map-placeholder p {
    font-size: 0.9rem;
    max-width: 280px;
    text-align: center;
    line-height: 1.5;
}

/* --- Leaflet Overrides --- */
.leaflet-container {
    font-family: 'Poppins', sans-serif;
    background: #0f1a2e;
}

.leaflet-popup-content-wrapper {
    background: #152238 !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    color: #f8f9fa;
    padding: 0;
}

.leaflet-popup-content {
    margin: 12px 16px;
    color: #f8f9fa;
}

.leaflet-popup-tip {
    background: #152238 !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.leaflet-popup-close-button {
    color: #94a3b8 !important;
    font-size: 18px !important;
    padding: 4px 8px !important;
}

.leaflet-popup-close-button:hover {
    color: #fff !important;
    background: transparent !important;
}

.leaflet-control-zoom {
    border: none !important;
}

.leaflet-control-zoom a {
    background: #152238 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
}

.leaflet-control-zoom a:hover {
    background: #1e3254 !important;
    color: #fff !important;
}

.leaflet-control-attribution {
    background: rgba(21, 34, 56, 0.8) !important;
    color: #64748b !important;
    font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
    color: #94a3b8 !important;
}

/* --- Custom Markers --- */
.amerygo-marker-wrapper {
    background: transparent !important;
    border: none !important;
}

.amerygo-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-sky) 0%, var(--primary-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(0, 212, 255, 0.4);
    border: 3px solid #fff;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.amerygo-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 24px rgba(0, 212, 255, 0.6);
}

.amerygo-marker.active {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.3), 0 6px 24px rgba(0, 212, 255, 0.6);
}

/* --- Popup / Info Window --- */
.map-info-window {
    min-width: 160px;
}

.map-info-window .map-info-title {
    font-family: 'Playfair Display', serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.map-info-window .map-info-meta {
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.map-info-window .map-info-meta i {
    color: var(--primary-sky);
}

.map-info-window .map-info-type {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-sky);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.map-info-window .map-info-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.map-info-window .map-info-actions a {
    flex: 1;
    text-align: center;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.map-info-window .map-info-actions .map-btn-directions {
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-sky);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.map-info-window .map-info-actions .map-btn-directions:hover {
    background: var(--primary-sky);
    color: #070d18;
}

.map-info-window .map-info-actions .map-btn-tickets {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.map-info-window .map-info-actions .map-btn-tickets:hover {
    background: var(--accent-gold);
    color: #070d18;
}

/* --- Map Legend --- */
.map-legend {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(21, 34, 56, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 1000;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

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

.map-legend-item .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.map-legend-item .legend-line {
    width: 20px;
    height: 3px;
    border-radius: 2px;
    background: #00a8e8;
}

/* --- Responsive Map --- */
@media (max-width: 768px) {
    .workspace-map-area {
        height: 40%;
        min-height: 250px;
    }

    .map-legend {
        display: none;
    }
}
