/* tour-engine.css — Estilos compartidos del motor de tour virtual UPCT
 * Cargado por todos los assets/{edificio}/index.html
 * No editar inline en los index.html — modificar solo este archivo
 */

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: sans-serif;
}

#fadeOverlay {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease-in-out;
    z-index: 9999;
}

#fadeOverlay.visible {
    opacity: 1;
}

/* Menú de selección de ruta */
#routeMenu {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    font-family: sans-serif;
}

/* Indicador de progreso en modo ruta */
#routeProgress {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(0,0,0,0.55);
    border-radius: 20px;
    padding: 6px 14px 8px;
    min-width: 180px;
    max-width: 260px;
    text-align: center;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#routeProgress .rp-label {
    color: #fff;
    font-size: 0.78em;
    letter-spacing: 0.03em;
    margin-bottom: 5px;
    display: block;
    font-family: sans-serif;
}
#routeProgress .rp-track {
    background: rgba(255,255,255,0.25);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
}
#routeProgress .rp-fill {
    background: #4fa3f7;
    height: 100%;
    border-radius: 4px;
    width: 0%;
    transition: width 300ms ease;
}
#routeMenu .rm-toggle {
    background: rgba(26, 115, 232, 0.88);
    color: #fff;
    border: none;
    padding: 8px 14px;
    font-size: 0.92em;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
#routeMenu .rm-toggle:hover { background: rgba(12, 90, 200, 0.95); }
#routeMenu .rm-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    list-style: none;
    padding: 4px 0;
    margin: 0;
}
#routeMenu.open .rm-list { display: block; }
#routeMenu .rm-list li {
    display: flex;
    align-items: center;
}
#routeMenu .rm-list li a {
    flex: 1;
    display: block;
    padding: 9px 16px;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9em;
}
#routeMenu .rm-list li a:hover { background: #f0f4ff; }
#routeMenu .rm-list li a.rm-active {
    font-weight: bold;
    color: #1a73e8;
    background: #eef3ff;
}
#routeMenu .rm-share {
    position: relative;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    padding: 6px 10px 6px 4px;
    line-height: 1;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
}
#routeMenu .rm-share:hover { color: #1a73e8; background: #eef3ff; }
#routeMenu .rm-share--ok { color: #2a9d2a; }
#routeMenu .rm-share--ok::after {
    content: attr(data-tip);
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-right: 6px;
    background: #333;
    color: #fff;
    font-size: 0.75em;
    padding: 3px 7px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
    animation: rm-tip-fade 2.2s ease forwards;
}
@keyframes rm-tip-fade {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ============================================================
   MINIMAP — plano del edificio con marcador de posición
   ============================================================ */
#minimap-container {
    position: fixed;
    bottom: 15px;
    left: 15px;
    z-index: 100;
    width: 150px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    overflow: visible;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
    user-select: none;
}

#minimap-img {
    display: block;
    width: 100%;
    height: auto;
}

#minimap-marker {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #00b0ca;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
    #minimap-container {
        width: 105px; /* 70% de 150px */
    }
}

/* ============================================================
   BOTÓN VOLVER AL PORTAL
   ============================================================ */
#btnVolver {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
    background: rgba(0, 84, 160, 0.88);
    color: #fff;
    text-decoration: none;
    padding: 8px 14px;
    font-size: 0.88em;
    font-family: sans-serif;
    border-radius: 4px;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
    transition: background 0.15s;
    cursor: pointer;
}
#btnVolver:hover {
    background: rgba(0, 60, 130, 0.97);
}

/* ============================================================
   MODO ACCESIBILIDAD  (?a11y=1)
   Se activa añadiendo la clase `a11y` al <body> desde tour-engine.js
   ============================================================ */
body.a11y #routeMenu .rm-header {
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 16px 10px;
}

body.a11y #routeMenu .rm-toggle {
    font-size: 1.1em;
    padding: 10px 18px;
}

body.a11y #routeMenu .rm-list li a {
    font-size: 1.05em;
    padding: 12px 20px;
    color: #111;
}

body.a11y #routeMenu .rm-list li a:hover {
    background: #dce8ff;
}

body.a11y #routeProgress {
    font-size: 1.1em;
}

/* ── F-015: capa accesible (aria-live + panel "Ir a…") ───────────── */

/* Solo lectores de pantalla */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* Panel de navegación accesible: oculto salvo a11y o navegación por teclado */
#a11yNav {
    position: fixed;
    left: 10px;
    bottom: 10px;
    z-index: 10000;
    display: none;
    max-width: 320px;
    max-height: 60vh;
    overflow: auto;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.97);
    color: #111;
    border: 2px solid #0054a0;
    border-radius: 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
body.a11y #a11yNav,
body.using-kbd #a11yNav,
#a11yNav:focus-within {
    display: block;
}

#a11yNav .a11y-nav-title {
    margin: 0 0 6px;
    font-size: 1em;
    font-weight: 700;
    color: #0054a0;
}
#a11yNav .a11y-nav-list {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
}
#a11yNav .a11y-nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin: 4px 0;
    padding: 8px 10px;
    background: #0054a0;
    color: #fff;
    border: 0;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
}
#a11yNav .a11y-nav-btn:hover { background: #1a73e8; }
#a11yNav .a11y-info { margin: 4px 0; }
#a11yNav .a11y-info summary { cursor: pointer; font-weight: 600; }

/* Foco visible dentro del panel y en el botón Volver */
#a11yNav a:focus-visible,
#a11yNav button:focus-visible,
#a11yNav summary:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* prefers-reduced-motion: anula transiciones CSS (el JS ya corta los fades) */
@media (prefers-reduced-motion: reduce) {
    #routeMenu,
    #fadeOverlay,
    .rm-toggle,
    .rm-list li a {
        transition-duration: 0.01ms !important;
    }
}
