/* ============================================================================
 * trial-map.css — Mapa Leaflet de ensayos clínicos (iframe)
 * ----------------------------------------------------------------------------
 * Extraído del <style> inline de trial-map.html en la armonización G1
 * (Lote 5). Usa los tokens definidos en _tokens.css (cargado antes).
 * Sin :root local, sin hex hardcoded fuera del docblock.
 *
 * El iframe es deliberadamente ligero: no carga bootstrap ni el CSS del
 * proyecto, solo Leaflet, _tokens.css y este archivo.
 * ============================================================================ */

/* ─── Reset minimal ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: system-ui, -apple-system, sans-serif;
}

/* ─── Map container ─────────────────────────────────────────────────────────── */
#map {
    width: 100%;
    height: 100%;
    background: var(--color-blue-100);
}

/* ─── Loading overlay ───────────────────────────────────────────────────────── */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color-blue-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    margin-top: 10px;
    color: var(--color-slate-500);
    font-size: 0.85rem;
}

/* ─── Leaflet popup overrides ───────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}
.leaflet-popup-content {
    margin: 12px 16px;
    line-height: 1.5;
}

.popup-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.popup-location {
    font-size: 0.8rem;
    color: var(--color-slate-500);
    margin-bottom: 6px;
}

/* Badge "recruiting" — verde semántico (mismo color que los markers ahora) */
.popup-badge {
    display: inline-block;
    background: var(--color-success);
    color: var(--color-white);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

/* Links a NCT individuales */
.popup-link {
    font-size: 0.8rem;
    color: var(--color-blue-400);
    text-decoration: none;
    display: block;
    margin-top: 2px;
    padding: 1px 0;
}
.popup-link:hover {
    text-decoration: underline;
}

/* Botón "+ N más → Ver todos" */
.popup-more {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 12px;
    background: var(--bg-blue-soft);
    color: var(--color-blue-400);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--color-blue-200);
    cursor: pointer;
    transition: background 0.2s;
}
.popup-more:hover {
    background: var(--color-blue-100);
}

/* Popup wrapper inline-style del original ahora declarado aquí */
.popup-content {
    min-width: 180px;
    max-width: 280px;
}
