/* --- Estilos Generales --- */ 
html {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    background-color: #aadcf1;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100vw;
    overflow: hidden;
    font-size: 100%;
}

/* --- Leyenda del mapa --- */

.origen-distancia-icon {
    background: transparent;
    border: none;
}

.origen-casa {
    font-size: 18px;
    background: white;
    border-radius: 50%;
    padding: 6px;
    border: 2px solid #025c9b;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooltip-origen {
    background: rgba(255,255,255,0.95);
    color: #025c9b;
    border: 1px solid #9fd3ea;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    font-weight: bold;
}
.legend-control {
    background: rgba(255, 255, 255, 0.94);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #222;
    line-height: 1.45;
    border: 1px solid rgba(0,0,0,0.12);
}

.legend-control-title {
    font-weight: bold;
    color: #000;
    text-align: center;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.legend-row {
    white-space: nowrap;
    margin: 2px 0;
}

.leaflet-tooltip {
    pointer-events: none;
}

/*Circulo*/
.etiqueta-radio-circulo {
    background: transparent;
    border: none;
}

.etiqueta-radio-circulo div {
    background: rgba(255,255,255,0.90);
    border: 1px solid #9fd3ea;
    color: #025c9b;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    box-shadow: 0 1px 5px rgba(0,0,0,0.22);
}
/* --- Panel superior derecho del mapa --- */
.info-control {
    background: rgba(255, 255, 255, 0.94);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #222;
    line-height: 1.35;
    border: 1px solid rgba(0,0,0,0.12);
}

.info-control b {
    color: #025c9b;
}

/* --- Contenedores Principales --- */
.headercontainer {
    border: 1px solid #666;
    display: flex;
    background-color: #f7f7f7;
    justify-content: space-between;
    align-items: center;
    padding: 2px;
    width: 100vw;
    color: #03C;
    height: 60px;
    box-sizing: border-box;
}

.mainbodycontainer {
    background-color: #aadcf1;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    height: calc(100vh - 60px - 28px);
    width: 100vw;
    position: relative;
    transition: background-image 0.8s ease-in-out;
}

.footercontainer {
    background: rgba(255, 255, 255, 0.92);
    width: 100vw;
    height: 28px;
    min-height: 28px;
    border-top: 1px solid #999;
    box-sizing: border-box;
    text-align: center;
    font-size: 14px;
    line-height: 27px;
    padding: 0;
    margin: 0;
}

.footercontainer a {
    color: #1f1480;
    text-decoration: underline;
    font-weight: normal;
}

.footercontainer span {
    margin: 0 4px;
    color: #333;
}
form {
    padding: 2vh;
    border-radius: 2px;
    margin: auto;
    background-color: #f7f7f7;
    border: blue 5px outset;
    max-width: 100%;
}

input#abrir-cerrar {
    visibility: hidden;
    position: absolute;
}

.cerrar {
    display: none;
    color: #0472fc;
    font-weight: bold;
    font-size: larger;
}

.abrir {
    color: #0472fc;
    font-weight: bold;
    font-size: larger;
}

.sidebar {
    position: fixed;
    height: calc(100vh - 60px);
    width: 0;
    top: 60px;
    left: 0;
    z-index: 10;
    background-color: #00324b;
    overflow-x: hidden;
    overflow-y: auto;
    transition: 0.4s;
    padding: 1rem 0;
    box-sizing: border-box;
}

/* --- Lógica del Menú Lateral --- */
input#abrir-cerrar:checked ~ #sidebar {
    width: 46%;
    max-width: 760px;
}

input#abrir-cerrar:checked + label[for="abrir-cerrar"] .cerrar {
    display: inline;
}

input#abrir-cerrar:checked + label[for="abrir-cerrar"] .abrir {
    display: none;
}

/* --- Elementos Visuales --- */
#tituloFormulario {
    text-align: center;
    font-size: 200%;
    font-family: Cambria;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 50px;
    margin-right: 10px;
}

h5 {
    color: #312097;
}

h2 {
    color: black;
}

/* --- Media Queries para Móviles --- */
@media only screen and (max-width: 768px) {

    body {
        overflow-x: hidden;
        overflow-y: auto;
    }

    .headercontainer {
        height: auto;
        min-height: 92px;
        padding: 8px;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
    }

    .logo {
        width: 100%;
        justify-content: center;
    }

    .logo img {
        max-width: 250px;
        height: auto;
        margin-right: 0;
    }

    .headercontainer h5 {
        display: none;
    }

    label[for="abrir-cerrar"] {
        display: block;
        width: 90%;
        max-width: 320px;
        text-align: center;
        background: #eef7fb;
        border: 1px solid #9fd3ea;
        border-radius: 999px;
        padding: 8px 12px;
        box-sizing: border-box;
        margin: 0 auto;
    }

    .abrir,
    .cerrar {
        font-size: 16px;
    }

       .sidebar {
        position: fixed;
        top: 92px;
        left: 0;
        height: calc(100dvh - 92px);
        padding-top: 12px;
        padding-bottom: 120px;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 9999;
    }

  input#abrir-cerrar:checked ~ #sidebar {
        width: 100vw;
        max-width: 100vw;
    }

    .sidebar form {
        width: 94vw;
        max-width: 94vw;
        box-sizing: border-box;
        margin: 0 auto 24px auto;
        overflow-x: hidden;
    }

    .sidebar select,
    .sidebar input[type="number"],
    .sidebar button {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .sidebar select {
        font-size: 15px;
        min-height: 38px;
        white-space: normal;
    }

    #cuerpo,
    #especialidad,
    #tipoDocente,
    #tipoProvincia,
    #provinciaOrigenDocente,
    #localidadOrigenDocente,
    #cursoDocente,
    #cursoCentro,
    #provinciaCentro,
    #tipoCentro {
        width: 100%;
        max-width: 100%;
    }

    #tituloFormulario {
        font-size: 160%;
    }

    .mainbodycontainer {
        height: calc(100vh - 92px - 42px);
        background-size: contain;
        background-position: center center;
        background-color: #aadcf1;
    }

    .footercontainer {
        height: auto;
        min-height: 32px;
        font-size: 11px;
        line-height: 1.3;
        padding: 4px 6px;
        white-space: normal;
    }

    .legend-control {
        font-size: 12px;
        padding: 7px 10px;
    }

    .info-control {
        font-size: 13px;
        padding: 7px 10px;
    }
    .info-control,
    .legend-control {
        max-width: 210px;
        font-size: 12px;
        padding: 6px 8px;
    }

    .control-toggle {
        cursor: pointer;
        font-weight: bold;
        color: #025c9b;
        text-align: center;
        user-select: none;
    }

    .control-content.oculto {
        display: none;
    }
}