/* Estilos específicos para la página de Infraestructura */

/* Introduction Section */
.intro-section {
    padding: 80px 0 60px;
    background: linear-gradient(135deg, #E8F4FD 0%, #FFFFFF 100%);
}

.intro-content {
    max-width: 900px;
    margin: 40px auto 0;
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(25, 54, 96, 0.1);
    border-left: 5px solid #193660;
}

.intro-text {
    color: #2C3E50;
    font-size: 1.1em;
    line-height: 1.9;
    text-align: justify;
    margin: 0;
}

/* Video Tour Section */
.video-tour-section {
    padding: 60px 0;
    background: white;
}

.video-title {
    text-align: center;
    color: #193660;
    font-size: 1.8em;
    font-weight: 700;
    margin-bottom: 30px;
}

.video-container {
    max-width: 1000px;
    margin: 0 auto;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(25, 54, 96, 0.15);
}

.video-placeholder {
    background: linear-gradient(135deg, #193660 0%, #4A6FA5 100%);
    height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5em;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

/*
.video-placeholder:hover {
    background: linear-gradient(135deg, #E2161F 0%, #193660 100%);
    transform: scale(1.02);
}

.video-placeholder small {
    display: block;
    margin-top: 15px;
    font-size: 0.6em;
    opacity: 0.9;
    font-weight: normal;
}
*/

/* Facilities Section */
.facilities-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #E8F4FD 0%, #FFFFFF 100%);
}

.facilities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    margin-top: 50px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.facility-card {
    background: white;
    border-radius: 15px;
    border: 3px solid transparent;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.facility-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #193660, #4A6FA5);
}

.facility-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(25, 54, 96, 0.25);
    border-color: #E2161F;
}

.facility-card:hover::before {
    background: linear-gradient(90deg, #E2161F, #FFD700);
}

.facility-icon {
    width: 80px;
    height: 80px;
    margin: 30px auto 20px;
    background: linear-gradient(135deg, #193660, #4A6FA5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    box-shadow: 0 5px 20px rgba(25, 54, 96, 0.3);
    transition: all 0.3s ease;
}

.facility-card:hover .facility-icon {
    background: linear-gradient(135deg, #E2161F, #FF6B6B);
    transform: scale(1.1) rotate(5deg);
}

.facility-name {
    color: #193660;
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    margin: 0 20px 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Imágenes reales en las tarjetas */
.facility-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-top: 2px solid #193660;
    transition: all 0.3s ease;
    display: block;
}

.facility-card:hover .facility-image {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Placeholder (fallback si no carga la imagen) */
.facility-image-placeholder {
    background: linear-gradient(135deg, #E8F4FD 0%, #F8F9FA 100%);
    border-top: 2px dashed #193660;
    height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #193660;
    font-size: 1.1em;
    font-weight: 600;
    text-align: center;
    padding: 20px;
    transition: all 0.3s ease;
}

.facility-card:hover .facility-image-placeholder {
    background: linear-gradient(135deg, #193660 0%, #4A6FA5 100%);
    color: white;
    border-top-color: #FFD700;
}

.facility-image-placeholder small {
    display: block;
    margin-top: 10px;
    font-size: 0.75em;
    opacity: 0.8;
    font-weight: normal;
}

/* Overlay de galería al hover */
.facility-card {
    position: relative;
}

.facility-card::after {
    content: '🔍 Ver Galería';
    position: absolute;
    bottom: 260px;
    left: 0;
    right: 0;
    background: rgba(226, 22, 31, 0.95);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.facility-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* ================================
   MODAL GALERÍA - LIGHTBOX
   ================================ */

.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.gallery-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalZoomIn 0.4s ease;
}

@keyframes modalZoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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

/* Encabezado del Modal */
.modal-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: white;
}

.modal-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #FFD700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    background: rgba(226, 22, 31, 0.9);
    border: 2px solid #FFD700;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: #FFD700;
    color: #193660;
    transform: rotate(90deg) scale(1.1);
}

/* Contenedor de Imágenes */
.modal-image-container {
    position: relative;
    width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    animation: imageSlideIn 0.4s ease;
}

@keyframes imageSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* Flechas de Navegación */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(25, 54, 96, 0.9);
    border: 2px solid #FFD700;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-nav:hover {
    background: #E2161F;
    transform: translateY(-50%) scale(1.15);
    box-shadow: 0 5px 20px rgba(226, 22, 31, 0.5);
}

.modal-nav.prev {
    left: -80px;
}

.modal-nav.next {
    right: -80px;
}

/* Contador de Imágenes */
.modal-counter {
    margin-top: 20px;
    color: white;
    font-size: 1.2em;
    font-weight: 600;
    background: rgba(25, 54, 96, 0.8);
    padding: 10px 25px;
    border-radius: 25px;
    border: 2px solid #FFD700;
}

/* Miniaturas (Thumbnails) */
.modal-thumbnails {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    overflow-x: auto;
    padding: 10px;
    max-width: 100%;
}

.modal-thumbnails::-webkit-scrollbar {
    height: 8px;
}

.modal-thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.modal-thumbnails::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

.thumbnail {
    width: 100px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.thumbnail.active {
    opacity: 1;
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

/* Descripción de la Imagen */
.modal-description {
    margin-top: 20px;
    color: white;
    font-size: 1.1em;
    text-align: center;
    max-width: 800px;
    line-height: 1.6;
    background: rgba(25, 54, 96, 0.7);
    padding: 15px 25px;
    border-radius: 10px;
}

/* Active menu link */
.nav-menu a.active {
    background: #4A6FA5;
    color: #FFD700;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .facilities-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .modal-nav.prev {
        left: -70px;
    }

    .modal-nav.next {
        right: -70px;
    }
}

@media (max-width: 968px) {
    .intro-section {
        padding: 60px 0 40px;
    }

    .intro-content {
        padding: 30px;
    }

    .video-tour-section {
        padding: 40px 0;
    }

    .video-placeholder {
        height: 400px;
        font-size: 1.3em;
    }

    .facilities-section {
        padding: 60px 0;
    }

    .facilities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .facility-name {
        font-size: 1.2em;
        min-height: 50px;
    }

    .facility-image-placeholder {
        height: 220px;
    }

    /* Modal responsive */
    .modal-nav {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .modal-nav.prev {
        left: 10px;
    }

    .modal-nav.next {
        right: 10px;
    }

    .modal-title {
        font-size: 1.4em;
    }

    .thumbnail {
        width: 80px;
        height: 60px;
    }
}

@media (max-width: 768px) {
    .intro-text {
        font-size: 1em;
        line-height: 1.7;
    }

    .video-title {
        font-size: 1.5em;
    }

    .video-placeholder {
        height: 350px;
        font-size: 1.2em;
    }

    .facility-icon {
        width: 70px;
        height: 70px;
        font-size: 2em;
        margin: 25px auto 15px;
    }

    .facility-name {
        font-size: 1.1em;
        margin: 0 15px 15px;
    }

    .facility-image-placeholder {
        height: 200px;
        font-size: 1em;
    }

    /* Modal mobile */
    .gallery-modal-content {
        width: 95%;
    }

    .modal-header {
        padding: 15px 0;
    }

    .modal-title {
        font-size: 1.2em;
    }

    .modal-close {
        width: 45px;
        height: 45px;
        font-size: 1.8em;
    }

    .modal-counter {
        font-size: 1em;
        padding: 8px 20px;
    }

    .modal-thumbnails {
        gap: 10px;
    }

    .thumbnail {
        width: 70px;
        height: 50px;
    }

    .modal-description {
        font-size: 0.95em;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .intro-content {
        padding: 25px 20px;
    }

    .video-placeholder {
        height: 300px;
        font-size: 1.1em;
    }

    .facilities-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .facility-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .facility-icon {
        width: 65px;
        height: 65px;
        font-size: 1.8em;
    }

    .facility-name {
        font-size: 1em;
        min-height: auto;
    }

    .facility-image-placeholder {
        height: 180px;
        font-size: 0.95em;
    }

    /* Modal muy pequeño */
    .modal-nav {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .modal-nav.prev {
        left: 5px;
    }

    .modal-nav.next {
        right: 5px;
    }

    .modal-thumbnails {
        padding: 5px;
    }

    .thumbnail {
        width: 60px;
        height: 45px;
    }
}