/* Variables principales (Copiadas de proyectos.css para consistencia) */
:root {
    --azul: #1e90ff;
    --fondo: #0d1117;
    --texto: #e2e8f0;
    --gris: #c0c0c0;
    --borde: #1e90ff;
    --card-fondo: #0f172a;
    --card-borde: #1e293b;
    --sombra: rgba(30, 144, 255, 0.4);
    --fuente: 'Poppins', sans-serif;
}

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

body {
    background-color: var(--fondo);
    font-family: var(--fuente);
    color: var(--texto);
    padding: 2rem 1rem;
}

/* Hero */
.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.hero-content .logo-img img {
    width: 80px;
    display: none;
}

/* Nav */
.nav {
    background-color: #10172a;
    position: relative;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.menu-toggle img {
    width: 36px;
    height: 36px;
}

/* Lista de navegación */
.nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 1rem;
    gap: 1rem;
}

.nav a {
    color: var(--texto);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.nav a:hover {
    color: var(--azul);
}

/* Sección Diagrama UPS */
.ups-section {
    margin-top: 4rem;
    padding: 2rem;
    min-height: 60vh;
}

.titulo-seccion {
    text-align: center;
    color: var(--azul);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.diagram-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    text-align: center;
}

/* ====== ESTILOS ESPECÍFICOS DEL DIAGRAMA ===== */

.diagram-scroll-container {
    overflow-x: auto;
    padding-bottom: 2rem;
    text-align: center;
    /* Centrar la imagen si es más pequeña que pantalla */

    /* Scrollbar Style */
    scrollbar-width: thin;
    scrollbar-color: var(--azul) #0f172a;
}

.diagram-scroll-container::-webkit-scrollbar {
    height: 12px;
}

.diagram-scroll-container::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 6px;
}

.diagram-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--azul);
    border-radius: 6px;
    border: 3px solid #0f172a;
}

/* Contenedor Imagen + Hotspots */
.image-map-container {
    position: relative;
    display: inline-block;
    /* Se ajusta al ancho de la imagen */
    margin: 0 auto;
    /* max-width: 100%; No limitamos ancho para permitir scroll en móvil y ver detalle */
}

.diagram-image {
    display: block;
    max-height: 80vh;
    /* Limitar altura para que quepa en pantalla */
    width: auto;
    /* Mantener relación de aspecto */
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Hotspots (Interactividad Invisible) */
.hotspot {
    position: absolute;
    cursor: pointer;
    background-color: transparent;
    /* Invisible por defecto */
    z-index: 10;
    border-radius: 6px;
    transition: all 0.3s ease;
    /* Transición suave */
}

/* Feedback al pasar el mouse (Sutil y elegante) */
/* Feedback al pasar el mouse (Sutil y elegante) */
.hotspot:hover {
    background-color: transparent;
    /* Totalmente transparente */
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.6);
    /* Resplandor neón en el borde */
    border: 2px solid rgba(6, 182, 212, 1);
    /* Borde sólido brillante */
    backdrop-filter: none;
    /* Sin distorsión */
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #0f172a;
    margin: 2% auto;
    /* Margen reducido para aprovechar altura */
    padding: 2.5rem;
    border: 2px solid var(--azul);
    width: 95%;
    /* Ancho maximizado */
    max-width: 1400px;
    /* Límite muy amplio */
    height: 92vh;
    /* Altura casi completa */
    border-radius: 12px;
    box-shadow: 0 0 30px var(--azul);
    color: #cbd5e1;
    /* Gris claro amigable para la vista */
    position: relative;
    animation: zoomIn 0.3s ease;
    display: flex;
    flex-direction: column;
    /* Para manejar el scroll interno */
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-modal {
    color: var(--gris);
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--azul);
}

#modalTitle {
    color: var(--azul);
    border-bottom: 2px solid #1e293b;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

#modalBody {
    font-size: 1.1rem;
    line-height: 1.8;
    overflow-y: auto;
    /* Scroll interno */
    flex: 1;
    padding-right: 10px;
    padding-bottom: 40px;
    /* Espacio para el indicador de scroll */
}

.scroll-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 10px;
    background: linear-gradient(to top, #0f172a 80%, transparent);
    color: var(--azul);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0 0 12px 12px;
    pointer-events: none;
    /* Permitir scroll aunque el mouse esté encima */
    letter-spacing: 1px;
    animation: fadePulse 2s infinite;
}

@keyframes fadePulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Scrollbar personalizada para el modal */
#modalBody::-webkit-scrollbar {
    width: 8px;
}

#modalBody::-webkit-scrollbar-thumb {
    background-color: var(--azul);
    border-radius: 4px;
}

/* Contenedor de Video Responsivo */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    margin: 30px auto;
    /* Centrado y con separación vertical */
    border-radius: 8px;
    border: 1px solid #1e293b;
    max-width: 850px;
    /* Límite de ancho para pantallas grandes */
    width: 100%;
    /* Asegurar que ocupe el espacio disponible hasta el max-width */
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Estilos Lightbox y Contenedores de Imagen --- */

.image-container {
    margin: 30px auto !important;
    /* Forzar centrado y margenes */
    max-width: 850px;
    /* Ancho máximo para imágenes en contenido */
    width: 100%;
    text-align: center;
    cursor: zoom-in;
    /* Cursor de lupa para indicar interactividad */
    transition: transform 0.2s ease;
}

.image-container:hover {
    transform: scale(1.02);
    /* Ligero efecto de zoom al pasar el mouse */
}

/* Lightbox Overlay */
#lightbox {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    z-index: 2000;
    /* Encima de todo (incluido el modal que es 1000) */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.95);
    /* Fondo casi negro opaco */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    animation: fadeIn 0.3s;
}

/* Imagen dentro del Lightbox */
#lightbox img {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    /* Máximo 90% de la altura de la ventana */
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(30, 144, 255, 0.5);
    animation: zoomIn 0.3s;
}

/* Botón cerrar Lightbox */
#lightbox .close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

#lightbox .close-lightbox:hover,
#lightbox .close-lightbox:focus {
    color: var(--azul);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
    }

    to {
        transform: scale(1);
    }
}

/* Footer (Base Copiada) */
.footer {
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    background-color: #0d1224;
    color: var(--gris);
    margin-top: 3rem;
}

.footer-links {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--azul);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links img.icono-red {
    width: 20px;
    height: 20px;
}

/* Responsive general */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    nav button img {
        border-radius: 8px;
    }

    .nav ul {
        display: none;
        flex-direction: column;
        background-color: #10172a;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        z-index: 999;
    }

    .nav ul.show {
        display: flex;
    }

    .nav ul li {
        padding: 0.5rem 0;
        text-align: center;
    }

    /* Modal Responsive */
    .modal-content {
        padding: 1.5rem;
        /* Menos padding en móvil */
        width: 95%;
        margin: 5% auto;
        /* Más margen vertical */
        height: 90vh;
    }

    #modalTitle {
        font-size: 1.5rem;
        /* Título más pequeño */
        padding-right: 30px;
        /* Espacio para el botón cerrar */
    }

    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 38px;
        /* Botón más grande para tocar */
    }

    /* Ajuste para imágenes en móvil */
    .image-container img {
        box-shadow: 0 0 5px rgba(30, 144, 255, 0.2);
        /* Sombra más ligera */
    }
}

@media (min-width: 769px) {
    .menu-toggle {
        display: none;
    }
}

@media (min-width: 769px) {
    .hero-content .logo-img img {
        display: block;
    }
}

/* --- Estilos "En Construcción" --- */
.construction-container {
    text-align: center;
    margin-top: 2rem;
    padding: 2rem;
    background-color: rgba(30, 41, 59, 0.5);
    /* Fondo sutil */
    border-radius: 12px;
    border: 1px dashed var(--gris);
}

.construction-text {
    color: var(--gris);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    line-height: 1.6;
    font-weight: 500;
}

.construction-highlight {
    color: var(--azul);
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}