﻿/* ===== BASE GLOBAL ===== */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background: #020617; /* mismo fondo oscuro que el mapa */
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* ===== LAYOUT BLAZOR ===== */

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
}

.content {
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: none;
}

article.content {
    padding: 0;
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
}


.page, main, .full-page {
    width: 100%;
}



/* Contenedor de páginas que deben ocupar toda la altura disponible */
.full-page {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ===== VALIDACIONES / ERRORES ===== */

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PH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 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ===== HEADER SUPERIOR RUTAS ===== */

.rutas-header {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,.1);
    background: linear-gradient(90deg, #0f172a, #111827);
    color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .rutas-header h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 600;
    }

    .rutas-header small {
        display: block;
        font-size: 0.8rem;
        color: #9ca3af;
    }

.pill-live {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .5);
    color: #a7f3d0;
    font-size: .75rem;
}

.pill-dot {
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.35);
}

.btn-ghost {
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.6);
    background: #111827;
    color: #e5e7eb;
    font-size: .78rem;
    padding: .3rem .9rem;
    cursor: pointer;
}

    .btn-ghost:hover {
        background: #1d4ed8;
        color: #fff;
    }

/* ===== MAPA + CONTENEDOR PRINCIPAL ===== */

.map-container {
    position: relative;
    z-index: 0 !important;
    overflow: visible !important;
    /* que rellene todo el espacio bajo el header */
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
}

    /* Estado normal: mapa sin opacidad */
    .map-container .leaflet-tile-pane {
        filter: opacity(1);
        transition: filter .25s ease;
    }

    /* Nivel 1: un poco más opaco */
    .map-container.opacidad-1 .leaflet-tile-pane {
        filter: opacity(0.75);
    }

    /* Nivel 2: más oscuro */
    .map-container.opacidad-2 .leaflet-tile-pane {
        filter: opacity(0.50);
    }

    /* Nivel 3: bastante oscuro */
    .map-container.opacidad-3 .leaflet-tile-pane {
        filter: opacity(0.25);
    }
    /* Nivel 4: bastante oscuro */
    .map-container.opacidad-4 .leaflet-tile-pane {
        filter: opacity(0.10);
    }

/* ===== CURSOR DEL MAPA ===== */

/* Cursor SIEMPRE flecha */
.leaflet-container {
    cursor: default !important;
}

/* Las capas interactivas NO deben cambiar el cursor */
.leaflet-interactive {
    cursor: default !important;
}

/* Evitar cursor de mano en puntos, polilíneas, polígonos de Leaflet */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-clickable {
    cursor: default !important;
}

/* ===== PANEL DE BÚSQUEDA TIPO GOOGLE MAPS ===== */

.gm-search-panel {
    position: absolute;
    top: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.96);
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
    z-index: 1200;
    max-width: 800px;
    width: calc(100% - 2rem);
}

.gm-search-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gm-search-inputs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
}

.gm-input-group {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 0; /* ? para que Origen y Destino se estiren */
}


    .gm-input-group label {
        font-size: 0.65rem;
        color: #9ca3af;
        margin-left: 0.25rem;
    }

    .gm-input-group input {
        width: 100%; /* ? para que el input rellene el grupo */
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, .6);
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
        background-color: rgba(15, 23, 42, 0.95);
        color: #e5e7eb;
        min-width: 0;
    }


        .gm-input-group input::placeholder {
            color: #6b7280;
        }

.gm-swap-btn {
    border-radius: 999px;
    border: none;
    padding: 0.25rem 0.45rem;
    background: rgba(30, 64, 175, .9);
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
}

    .gm-swap-btn:hover {
        background: rgba(37, 99, 235, 1);
    }

.gm-search-button {
    border-radius: 999px;
    border: none;
    padding: 0.4rem 0.9rem;
    background: #22c55e;
    color: #022c22;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}

    .gm-search-button:hover {
        background: #4ade80;
    }

/* ===== PANEL LATERAL DE ESTADO / SELECCIÓN ===== */

.map-overlay-card {
    position: absolute;
    top: .75rem;
    left: .75rem;
    max-width: 320px;
    z-index: 1200;
    background: rgba(15,23,42,.96);
    color: #e5e7eb;
    border-radius: .75rem;
    padding: .75rem .9rem;
    box-shadow: 0 16px 40px rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.35);
    font-size: .82rem;
}

    .map-overlay-card strong {
        font-size: .78rem;
        text-transform: uppercase;
        letter-spacing: .12em;
        color: #9ca3af;
    }

    .map-overlay-card p {
        margin: .25rem 0;
        font-size: .82rem;
    }

    .map-overlay-card .mini {
        font-size: .75rem;
        color: #9ca3af;
    }

/* ===== POPUP PARADA ===== */

.popup-parada {
    position: absolute;
    top: 6rem;
    left: 1rem;
    max-width: 260px;
    background: rgba(15,23,42,.96);
    color: #e5e7eb;
    border-radius: .75rem;
    padding: .6rem .8rem .4rem .8rem;
    box-shadow: 0 16px 30px rgba(15,23,42,.9);
    border: 1px solid rgba(148,163,184,.4);
    font-size: .82rem;
    z-index: 999999999;
}

.popup-parada-header {
    font-weight: 600;
    font-size: .86rem;
    margin-bottom: .25rem;
}

.popup-parada-body {
    font-size: .8rem;
}

    .popup-parada-body div {
        margin-bottom: .15rem;
    }

.popup-parada-cerrar {
    position: absolute;
    top: .3rem;
    right: .45rem;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: .9rem;
    cursor: pointer;
}

    .popup-parada-cerrar:hover {
        color: #e5e7eb;
    }

/* ===== PANEL LATERAL DE RUTAS ===== */

.route-panel-overlay {
    position: absolute;
    top: 4.5rem; /* debajo de la barra de búsqueda */
    right: 0.75rem;
    bottom: 1rem;
    width: 360px;
    max-width: 90vw;
    pointer-events: none !important;
    z-index: 1200;
}

.route-panel {
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.96);
    border-radius: 1rem;
    padding: 0.75rem 0.85rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, .6);
    display: flex;
    flex-direction: column;
    height: 100%;
    color: #e5e7eb;
}

.route-panel-title {
    margin: 0 0 .35rem;
    font-size: .9rem;
    font-weight: 600;
    color: #e5e7eb;
}

/* Lista de alternativas de ruta */

.route-alt-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
}

.route-alt-card {
    border-radius: 0.8rem;
    border: 1px solid rgba(148, 163, 184, .55);
    background: rgba(15, 23, 42, 0.9);
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.78rem;
    color: #e5e7eb;
    pointer-events: auto;
}

    .route-alt-card:hover {
        border-color: #3b82f6;
        background: rgba(30, 64, 175, 0.85);
    }

.route-alt-card-selected {
    border-color: #22c55e;
    background: rgba(21, 128, 61, 0.85);
}

.route-alt-main {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.route-alt-time {
    font-weight: 600;
    font-size: 0.85rem;
}

.route-alt-label {
    font-size: 0.75rem;
    color: #d1d5db;
}

.route-alt-sub {
    font-size: 0.7rem;
    color: #9ca3af;
}

/* Separador fino dentro del panel */

.route-panel-divider {
    border: none;
    border-top: 1px solid rgba(148, 163, 184, .4);
    margin: 0.45rem 0;
}

/* Cuerpo con scroll propio */

.route-panel-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.15rem;
}

/* TEXTO Y CHIPS DE LA RUTA */

.route-main-text {
    font-size: .86rem;
    margin-bottom: .4rem;
}

    .route-main-text span.highlight {
        color: #facc15;
        font-weight: 500;
    }

.chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    font-size: .75rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .55rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.5);
    background: #020617;
}

.chip-dot {
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
}

.chip-dot-start {
    background: #22c55e;
}

.chip-dot-end {
    background: #ef4444;
}

.chip-dot-line {
    background: #38bdf8;
}

.chip-dot-walk {
    background: #f97316;
}

.muted {
    color: #9ca3af;
}

/* LISTA DE TRAMOS TIPO “DIRECCIONES” CON NÚMEROS */

.lista-tramos-ruta {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    font-size: .8rem;
    counter-reset: step;
}

    .lista-tramos-ruta li {
        display: flex;
        align-items: flex-start;
        gap: 0.6rem;
        margin-bottom: 0.35rem;
    }

        .lista-tramos-ruta li::before {
            counter-increment: step;
            content: counter(step);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.25rem;
            height: 1.25rem;
            border-radius: 999px;
            background: #1d4ed8;
            color: #e5e7eb;
            font-size: 0.75rem;
            margin-top: 0.15rem;
        }

/* ===== PANEL DE CONFIGURACIÓN ===== */

.config-panel {
    position: absolute;
    bottom: 3rem;
    left: 1rem;
    width: 300px;
    background: rgba(15,23,42,0.96);
    border: 1px solid rgba(148,163,184,.35);
    border-radius: .75rem;
    padding: .95rem 1.1rem;
    color: #e5e7eb;
    box-shadow: 0 16px 40px rgba(15,23,42,.9);
    backdrop-filter: blur(4px);
    z-index: 99999;
    font-size: .85rem;
}

    .config-panel h5 {
        margin: 0 0 .9rem 0;
        font-size: .92rem;
        font-weight: 600;
        letter-spacing: .03em;
        color: #9ca3af;
        text-transform: uppercase;
    }

.config-row {
    display: grid;
    grid-template-columns: 1fr 140px; /* label | campo */
    gap: .75rem;
    align-items: center;
    margin-bottom: .75rem;
}


    .config-row label {
        font-size: .8rem;
        color: #cbd5e1;
    }

.config-input {
    width: 90px;
    padding: .35rem .5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-size: .8rem;
    border-radius: .5rem;
    border: 1px solid rgba(148,163,184,.5);
    text-align: right;
    outline: none;
    transition: border-color .15s, background .15s;
}

    .config-input:focus {
        border-color: #38bdf8;
        background: #1e293b;
    }

.config-panel .btn-ghost {
    margin-top: .3rem;
    width: 100%;
    padding: .45rem .6rem;
    border-radius: .75rem;
    font-size: .82rem;
    background: #1d4ed8;
    border: 1px solid rgba(148,163,184,.4);
    color: #fff;
    text-align: center;
    transition: background .2s, box-shadow .2s;
}

    .config-panel .btn-ghost:hover {
        background: #2563eb;
        box-shadow: 0 0 10px rgba(37,99,235,.4);
    }

/* Botón flotante para abrir la configuración avanzada */
.config-toggle-btn {
    position: absolute;
    bottom: 3rem;
    left: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,.6);
    background: #111827;
    color: #e5e7eb;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(15,23,42,.8);
    z-index: 1300;
}

    .config-toggle-btn:hover {
        background: #1d4ed8;
        color: #fff;
    }

/* Cabecera del panel de configuración con botón de cierre */
.config-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .75rem;
}

    .config-panel-header h5 {
        margin: 0;
    }

.config-close-btn {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

    .config-close-btn:hover {
        color: #e5e7eb;
    }


.coords-bar {
    position: absolute;
    bottom: 6px;
    left: 10px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    pointer-events: none; /* para no bloquear clics en el mapa */
    z-index: 500;
}

.rt-arrow-icon {
    background: transparent;
    border: none;
}

.rt-arrow {
    position: relative;
    transform-origin: 50% 50%;
}

    .rt-arrow::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -75%);
        width: 0;
        height: 0;
        /* Base ancha */
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        /* Punta MÁS larga (clave) */
        border-bottom: 18px solid var(--arrow-color, rgba(239, 68, 68, 0.95));
    }

    .rt-arrow::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 60%;
        transform: translateX(-50%);
        /* Cuerpo un poco más largo */
        width: 4px;
        height: 10px;
        background: var(--arrow-color, rgba(239, 68, 68, 0.95));
        border-radius: 1px;
    }






/* Ocultar spinners nativos */
.config-input::-webkit-outer-spin-button,
.config-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.config-input[type="number"] {
    -moz-appearance: textfield;
}

.num-field {
    position: relative;
    width: 140px; /* igual que la 2ª columna */
    min-width: 140px;
}

    .num-field .config-input {
        width: 100% !important; /* pisa el width:90px anterior */
        box-sizing: border-box;
        padding-right: 2.4rem; /* espacio para ?? */
    }
.num-inline {
    display: grid;
    grid-template-columns: 1fr 1.6rem 1.6rem; /* input | ? | ? */
    gap: .25rem;
    align-items: center;
    min-width: 0;
}
    .num-inline .config-input {
        width: 100% !important; /* pisa width:90px anterior */
        min-width: 0;
        box-sizing: border-box;
    }



.num-stepper {
    position: absolute;
    right: .25rem; /* un pelín más metido */
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: .2rem;
}


.step-btn {
    width: 1.5rem;
    height: 1.05rem;
    border-radius: .3rem;
    border: 1px solid rgba(148,163,184,.45);
    background: rgba(30,41,59,.85);
    color: #e5e7eb;
    font-size: .6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

    .step-btn:hover {
        background: rgba(37,99,235, .9);
        border-color: rgba(59,130,246,.9);
    }



/* ✅ Solo esta fila: label arriba + control abajo, ancho completo */
.config-row.config-row-full {
    grid-template-columns: 1fr !important;
}

/* Asegura que el contenedor derecho pueda encoger y no desborde */
.config-row > * {
    min-width: 0;
}

/* Ajuste del range: ahora sí, columnas estables */
.line-filter {
    max-width: 100%;
    min-width: 0;
}

.line-filter__range {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr; /* Rango | min | a | max */
    gap: 8px;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

    .line-filter__range .config-input {
        width: 100% !important; /* pisa el 90px */
        min-width: 0;
    }

/* En muy estrecho, que pase a 2 columnas */
@media (max-width: 520px) {
    .line-filter__range {
        grid-template-columns: 1fr 1fr;
    }
}
