/**
 * Collar Map — Estilos Leaflet Override + Glassmorphism
 */

/* ═══ Sección del mapa ═══ */
.launcher-map-section {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 2rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 16px;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(16, 185, 129, 0.06),
        0 8px 32px rgba(0, 0, 0, 0.4);
    animation: mapFadeIn 0.6s ease-out;
}

@keyframes mapFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ═══ Header del mapa ═══ */
.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(52, 211, 153, 0.15);
    background: rgba(15, 23, 42, 0.5);
}

.map-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: -0.3px;
}

.map-title i {
    color: #34d399;
    font-size: 1.1rem;
}

.map-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.map-badge i {
    font-size: 0.65rem;
}

/* ═══ Contenedor del mapa ═══ */
.collar-map-container {
    width: 100%;
    height: 800px;
    background: #0c1222;
    position: relative;
}

.collar-map-container.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 18, 34, 0.8);
    z-index: 500;
}

/* ═══ Mensaje sin datos ═══ */
.map-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 12px;
    color: #64748b;
}

.map-empty i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.map-empty span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ═══ Override Leaflet — Tema Oscuro ═══ */

/* Controles de zoom */
.collar-map-container .leaflet-control-zoom a {
    background: rgba(15, 23, 42, 0.85) !important;
    backdrop-filter: blur(8px);
    color: #e2e8f0 !important;
    border-color: rgba(52, 211, 153, 0.2) !important;
    font-weight: 700;
    transition: all 0.2s;
}

.collar-map-container .leaflet-control-zoom a:hover {
    background: rgba(52, 211, 153, 0.2) !important;
    color: #34d399 !important;
}

/* Atribución */
.collar-map-container .leaflet-control-attribution {
    background: rgba(15, 23, 42, 0.7) !important;
    color: #64748b !important;
    font-size: 0.6rem !important;
    backdrop-filter: blur(4px);
}

.collar-map-container .leaflet-control-attribution a {
    color: #34d399 !important;
}

/* ═══ Popups — Tema oscuro premium ═══ */
.collar-map-container .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 12px rgba(52, 211, 153, 0.1);
    color: #e2e8f0;
    padding: 0 !important;
}

.collar-map-container .leaflet-popup-content {
    margin: 0 !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    line-height: 1.5;
    min-width: 220px;
}

.collar-map-container .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-top: none;
    border-left: none;
}

.collar-map-container .leaflet-popup-close-button {
    color: #64748b !important;
    font-size: 18px !important;
    top: 6px !important;
    right: 8px !important;
}

.collar-map-container .leaflet-popup-close-button:hover {
    color: #f87171 !important;
}

/* ═══ Popup interno ═══ */
.popup-collar {
    padding: 14px 16px;
}

.popup-collar-name {
    font-size: 1rem;
    font-weight: 800;
    color: #34d399;
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}

.popup-collar-project {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.popup-collar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
    margin-bottom: 12px;
}

.popup-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.popup-field-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.5px;
}

.popup-field-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
}

.popup-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.popup-status.active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.popup-status.done {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.popup-btn-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.25));
    color: #34d399;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(52, 211, 153, 0.2);
    text-decoration: none;
}

.popup-btn-view:hover {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(52, 211, 153, 0.4));
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.2);
    transform: translateY(-1px);
}

.popup-btn-view-gt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.25));
    color: #a78bfa;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(139, 92, 246, 0.2);
    text-decoration: none;
}

.popup-btn-view-gt:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.4));
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .collar-map-container {
        height: 500px;
    }
    .map-header {
        padding: 10px 14px;
    }
    .map-title {
        font-size: 0.8rem;
    }
}
