@font-face {
    font-family: 'Montserrat';
    src: url('fonts/montserrat-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/montserrat-medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/montserrat-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* También mapear pesos 600 y 800 a bold para compatibilidad */
@font-face {
    font-family: 'Montserrat';
    src: url('fonts/montserrat-bold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Montserrat';
    src: url('fonts/montserrat-bold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at center, #1C3B78 0%, #000000 100%);
    /* Fondo exterior azul con difuminado */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    color: white;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.main-wrapper {
    aspect-ratio: 9 / 16;
    height: 100vh;
    max-width: 100vw;
    position: relative;
    background: linear-gradient(180deg, #1C3B78 0%, #0D1C40 100%);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    padding: 2vh 5%;
    padding-bottom: 11vh;
    /* Espacio para el nav */
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Header general */
.header {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
    margin-bottom: 4vh;
}

.logo-title {
    width: 49%;
    max-width: none;
    margin-bottom: 1vh;
}

.logo-subtitle {
    width: 49%;
    max-width: none;
}

/* Pantalla 1 Especial */
#screen-1 {
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#screen-1 .header {
    margin-top: 15vh;
}

#screen-2 .header {
    margin-top: 3vh;
    margin-bottom: 10vh;
}

.main-content-s1 {
    display: flex;
    margin-bottom: 30%;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.s1-title {
    width: 75%;
}

.footer-s1 {
    width: 100%;
    max-width: 550px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2vw;
    margin-bottom: 4vh;
}

.hand-icon {
    width: 8%;
    /* Aumentado de 2.5vw para móvil */
}

.click-text {
    width: 35%;
    /* Aumentado de 12vw para móvil */
}

/* Menú Pantalla 2 */
.menu-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 9%;
}

.menu-btn {
    display: flex;
    margin-bottom: 20px;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1.5vh 7%;
    cursor: pointer;
    color: #0D1C40;
    transition: transform 0.2s;
}

.menu-btn:active {
    transform: scale(0.98);
}

/* Estados de botones del menú principal */
.menu-btn.unvisited {
    background: #71A7D4;
    color: #223472;
}

.menu-btn.unvisited .btn-icon-wrapper {
    background: transparent;
}

.menu-btn.unvisited .btn-text h3,
.menu-btn.unvisited .btn-text p {
    color: #223472;
}

.menu-btn.visited {
    background: #ffffff;
    color: #223472;
}

.menu-btn.visited .btn-icon-wrapper {
    background: #71A7D4;
}

.menu-btn.visited .btn-text h3,
.menu-btn.visited .btn-text p {
    color: #223472;
}

.btn-icon-wrapper {
    width: 6vh;
    height: 6vh;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1vw;
}

.btn-icon-wrapper img {
    width: 6vh;
    height: auto;
}

.btn-text {
    flex-grow: 1;
}

.btn-text h3 {
    font-size: 1.7vh;
    font-weight: 800;
    margin-bottom: 0.5vh;
}

.btn-text p {
    font-size: 1.6vh;
    font-weight: 500;
}

.btn-arrow-img {
    height: 1.8vh;
    width: auto;
    margin-left: auto;
}

.bottom-cards {
    display: flex;
    gap: 1.2vw;
    margin-top: 7vh;
}

.card {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 3vh 2vh;
    display: flex;
    padding-top: 20px;
    align-items: flex-start;
    cursor: pointer;
}

.card h3 {
    font-size: 1.8vh;
    font-weight: 600;
    line-height: 1.4;
    color: white;
}

.card-datos {
    background-color: transparent;
    color: white;
}

.card-datos h3 {
    color: white;
}

/* Pantallas Detalles (3, 4, 5) - Nueva estructura v2 */
.detail-header {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 2vh;
    cursor: pointer;
    color: #0D1C40;
    margin-bottom: 2vh;
    margin-left: 2%;
    margin-right: 2%;
}

.detail-header .btn-icon-wrapper {
    background: #71A7D4;
    width: 7vh;
    height: 7vh;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 1.5vw;
}

.detail-header .btn-icon-wrapper img {
    width: 5.5vh;
    height: auto;
}

.detail-header h3 {
    font-size: 2vh;
    font-weight: 800;
    margin-bottom: 0.5vh;
}

.detail-header p {
    font-size: 1.6vh;
    font-weight: 500;
}

.btn-arrow-down {
    height: 1.2vh;
    width: auto;
    margin-left: auto;
}

.timeline-v2 {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    padding: 5vh 0;
    padding-right: 10%;
}

.timeline-v2-line {
    display: none;
}

.timeline-v2-row {
    display: flex;
    width: 100%;
    min-height: 6.5vh;
    /* Altura mínima por fila para asegurar espaciado */
    align-items: stretch;
    /* Estira el contenido para dibujar la línea completa */
    margin-bottom: 1vh;
    /* Más espacio entre filas */
    position: relative;
    z-index: 2;
    /* Fila base */
}

.timeline-v2-left {
    width: 45%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding-right: 3vh; /* Separado de la línea (era 1.5vw) */
}

.timeline-v2-left img {
    max-width: 100%;
    max-height: 4vh;
    /* Imágenes AÚN más chicas para que no toquen el menú */
    object-fit: contain;
}

.timeline-v2-title {
    font-size: 2vh;
    /* Título un poco más grande */
    font-weight: 800;
    color: white;
    text-align: right;
    width: 100%;
    margin-bottom: -0.5vh;
    /* Ajustado por las imágenes más chicas */
}

.timeline-v2-center {
    width: 0;
    /* No ocupa espacio real, solo sirve para anclar el punto */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.timeline-v2-center::before {
    content: '';
    position: absolute;
    top: -0.5vh;
    height: 1.55vh;
    left: 50%;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%);
    z-index: -1;
}

.timeline-v2-center::after {
    content: '';
    position: absolute;
    top: 1.05vh;
    bottom: -0.5vh;
    left: 50%;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%);
    z-index: -1;
}

.timeline-v2-row:first-of-type .timeline-v2-center::before {
    display: none;
}

.timeline-v2-row:last-of-type .timeline-v2-center::after {
    display: none;
}

.dot-v2 {
    width: 1.5vh;
    /* Puntos un poco más grandes para que la línea se note atravesando */
    height: 1.5vh;
    background-color: white;
    border-radius: 50%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    /* Centra el punto exactamente en la línea */
    z-index: 1;
    /* SUPER IMPORTANTE: Z-index MENOR que la línea para que la línea pase por encima */
    margin-top: 0.3vh;
}

.timeline-v2-right {
    width: 55%;
    padding-left: 3vh; /* Separado de la línea (era 1.5vw) */
    /* Espacio entre punto y texto */
    display: flex;
    align-items: flex-start;
}

.timeline-v2-right p {
    font-size: 1.6vh;
    /* Texto un poco más legible */
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

.timeline-v2-right strong {
    font-weight: 800;
}

/* Navigation Bar */
nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10vh;
    background: linear-gradient(180deg, #152E5E 0%, #0A1530 100%);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 2vw;
    transition: transform 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

nav.hidden {
    transform: translateY(100%);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.nav-item.active,
.nav-item:hover {
    opacity: 1;
}

.nav-item img {
    height: 3vh;
    width: auto;
}

.nav-item span {
    font-size: 1.3vh;
    font-weight: 500;
}

/* Pantalla 6 - Menú Próximos Pasos */
.btn-white {
    background: white;
    justify-content: space-between;
    padding: 18% 30px;
}

.text-blue {
    color: #132A55;
}

.text-large {
    font-size: 25px !important;
}

/* Pantalla 7 y 8 - Detalles PIEAT y Corredor Norte */
.detail-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 2vh 2vw;
    /* Igual a pantalla 3 */
    cursor: pointer;
    margin-bottom: 2vh;
    /* Igual a pantalla 3 */
    margin-left: 2%;
    /* Igual a pantalla 3 */
    margin-right: 2%;
    /* Igual a pantalla 3 */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.detail-header-simple:active {
    transform: scale(0.98);
    background-color: #f0f0f0;
}

.detail-header-simple h3 {
    font-size: 2vh;
    /* Igual a pantalla 3 */
    font-weight: 800;
    margin: 0;
    color: #132A55;
}

.content-pieat {
    padding: 0 5%;
    /* Removido flex-grow: 1 para que los botones inferiores se acerquen al texto */
    overflow-y: auto;
    margin-bottom: 2vh; /* Reducido para evitar scroll */
}

.subtitle-pieat {
    font-size: 1.8vh; /* Reducido de 2vh */
    margin-bottom: 0.3vh;
}

.italic-pieat {
    font-style: italic;
    font-size: 1.6vh; /* Reducido de 1.8vh */
    margin-bottom: 1.5vh; /* Reducido de 3vh */
    opacity: 0.9;
}

.timeline-pieat {
    position: relative;
    padding-left: 2vh;
    display: flex;
    flex-direction: column;
    gap: 1.5vh; /* Reducido de 3vh */
}

.timeline-pieat .timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 2.5vh; /* Separado de la línea (era 3vh) */
    position: relative;
    z-index: 2;
}

/* Línea punteada que conecta los ítems, no se dibuja en el último */
.timeline-pieat .timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 1.5vh;
    /* Empieza debajo del punto */
    bottom: -6vh; /* Aumentado para cubrir gaps grandes como en pantalla 8 */
    /* Conecta hasta el próximo punto */
    left: 0.75vh;
    /* Centro exacto del punto (que mide 1.5vh) */
    border-left: 2px dotted rgba(255, 255, 255, 0.6);
}

.timeline-pieat .dot {
    width: 1.5vh;
    height: 1.5vh;
    background-color: white;
    border-radius: 50%;
    margin-top: 0.4vh;
    flex-shrink: 0;
}

.timeline-pieat p {
    font-size: 1.5vh; /* Reducido de 1.8vh */
    line-height: 1.3;
    margin: 0;
}

.bottom-buttons-pieat {
    display: flex;
    gap: 3vw;
    padding: 0 5%;
    margin-top: 4vh;
}

.btn-outline {
    flex: 1;
    background: transparent;
    border: 1px solid white;
    color: white;
    border-radius: 25px;
    padding: 14px 20px;
    font-size: 18px;
    /* Ajusta este valor manualmente para hacer el texto más grande o chico */
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.btn-outline:active {
    transform: scale(0.95);
    opacity: 0.9;
}

.btn-filled {
    flex: 1;
    background: #6B9EC7;
    border: none;
    color: white;
    border-radius: 25px;
    padding: 1.5vh;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.btn-filled:active {
    transform: scale(0.95);
    opacity: 0.9;
}

/* Pantalla 9 y 11 - Mapa */
.screen-mapa-container {
    padding-top: 40px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
}

.mapa-wrapper {
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    margin-bottom: 170px;
}

.mapa-img-rounded {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    /* Mantiene aspect ratio y no recorta */
    border-radius: 20px;
}

/* Pantalla 10 - Datos Cortos */
.content-datos {
    padding: 0 5%;
    overflow-y: auto;
    margin-bottom: 1vh;
}

.title-datos {
    font-size: 2vh;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5vh;
}

.subtitle-datos {
    font-size: 1.4vh;
    font-weight: 500;
    margin-bottom: 1vh;
    line-height: 1.2;
}

.timeline-datos {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1vh;
}

.timeline-item-datos {
    position: relative;
    padding-left: 3.5vh; /* Separado de la línea (era 4vw) */
    font-size: 1.25vh;
    font-weight: 500;
    line-height: 1.2;
    transition: transform 0.2s ease;
}

.timeline-item-datos:active {
    transform: scale(0.98);
}

.timeline-item-datos .dot-datos {
    position: absolute;
    left: 0;
    top: 0.8vh;
    width: 1.5vh;
    height: 1.5vh;
    background-color: white;
    border-radius: 50%;
}

.timeline-item-datos:not(:last-child)::before {
    content: '';
    position: absolute;
    top: 2.3vh;
    bottom: -1vh;
    left: 0.75vh;
    border-left: 2px dotted rgba(255, 255, 255, 0.6);
}

.chip-datos {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.3);
    padding: 0.3vh 1vh;
    border-radius: 20px;
    font-weight: 800;
    font-size: 1.3vh;
    margin-bottom: 0.3vh;
    cursor: pointer;
    /* Para indicar que es clicable */
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.chip-datos:active {
    transform: scale(0.95);
}

.chip-datos:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.plus-icon {
    margin-left: 8px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.6);
}

/* Debug Panel */
#debug-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#debug-panel.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Pantalla 12 - Detalle de Datos Cortos (Imagen) */
.image-detail-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 10px;
    position: relative;
    /* Para posicionar las flechas */
}

.image-detail-rounded {
    width: 90%;
    max-height: 50vh;
    border-radius: 20px;
    object-fit: contain;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.gallery-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.gallery-arrows-inline {
    display: flex;
    gap: 10px;
}

.gallery-arrow-inline {
    background: transparent;
    border: 1px solid white;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    border-radius: 8px;
    /* Cuadrado con bordes redondeados */
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.gallery-arrow-inline:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.image-description-container {
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 15px;
    flex-shrink: 0;
    /* Evita que se encoja */
}

/* --- ANIMACIONES --- */
@keyframes floatUpAndDown {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pantalla 1: Landing CTAs */
.footer-s1 {
    animation: floatUpAndDown 2s ease-in-out infinite;
}

.screen.active .s1-title {
    animation: slideInUp 0.8s ease 0.5s forwards;
    opacity: 0;
}

.screen.active .hand-icon,
.screen.active .click-text {
    animation: slideInUp 0.8s ease 1s forwards;
    opacity: 0;
}

/* Pantalla 2: Staggered Menú */
.screen.active .menu-btn:nth-child(1) {
    animation: slideInUp 0.8s ease 0.5s forwards;
    opacity: 0;
}

.screen.active .menu-btn:nth-child(2) {
    animation: slideInUp 0.8s ease 1s forwards;
    opacity: 0;
}

.screen.active .menu-btn:nth-child(3) {
    animation: slideInUp 0.8s ease 1.5s forwards;
    opacity: 0;
}

.screen.active .bottom-cards {
    animation: slideInUp 0.8s ease 2s forwards;
    opacity: 0;
}

/* Pantallas 3, 4, 5: Staggered Timeline v2 */
.screen.active .timeline-v2-row:nth-child(1) {
    animation: slideInUp 0.4s ease 0.1s forwards;
    opacity: 0;
}

.screen.active .timeline-v2-row:nth-child(2) {
    animation: slideInUp 0.4s ease 0.2s forwards;
    opacity: 0;
}

.screen.active .timeline-v2-row:nth-child(3) {
    animation: slideInUp 0.4s ease 0.3s forwards;
    opacity: 0;
}

.screen.active .timeline-v2-row:nth-child(4) {
    animation: slideInUp 0.4s ease 0.4s forwards;
    opacity: 0;
}

.screen.active .timeline-v2-row:nth-child(5) {
    animation: slideInUp 0.4s ease 0.5s forwards;
    opacity: 0;
}

.screen.active .timeline-v2-row:nth-child(6) {
    animation: slideInUp 0.4s ease 0.6s forwards;
    opacity: 0;
}

/* Pantallas 7, 8: Staggered Timeline Pieat */
.screen.active .timeline-item:nth-child(1) {
    animation: slideInUp 0.4s ease 0.1s forwards;
    opacity: 0;
}

.screen.active .timeline-item:nth-child(2) {
    animation: slideInUp 0.4s ease 0.2s forwards;
    opacity: 0;
}

.screen.active .timeline-item:nth-child(3) {
    animation: slideInUp 0.4s ease 0.3s forwards;
    opacity: 0;
}

.screen.active .timeline-item:nth-child(4) {
    animation: slideInUp 0.4s ease 0.4s forwards;
    opacity: 0;
}

.screen.active .timeline-item:nth-child(5) {
    animation: slideInUp 0.4s ease 0.5s forwards;
    opacity: 0;
}

.screen.active .timeline-item:nth-child(6) {
    animation: slideInUp 0.4s ease 0.6s forwards;
    opacity: 0;
}

/* Pantalla 10: Staggered Timeline Datos */
.screen.active .timeline-item-datos:nth-child(1) {
    animation: slideInUp 0.4s ease 0.1s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(2) {
    animation: slideInUp 0.4s ease 0.2s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(3) {
    animation: slideInUp 0.4s ease 0.3s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(4) {
    animation: slideInUp 0.4s ease 0.4s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(5) {
    animation: slideInUp 0.4s ease 0.5s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(6) {
    animation: slideInUp 0.4s ease 0.6s forwards;
    opacity: 0;
}

.screen.active .timeline-item-datos:nth-child(7) {
    animation: slideInUp 0.4s ease 0.7s forwards;
    opacity: 0;
}

/* --- MODAL ZOOM MAPA --- */
.map-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.map-zoom-modal.active {
    display: flex;
    opacity: 1;
}

.map-zoom-content {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.map-zoom-img {
    max-width: none;
    width: 180%; /* Zoom inicial */
    height: auto;
    cursor: grab;
}

.close-zoom {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: white;
    color: black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 3100;
    cursor: pointer;
}