/* ===== CONFIGURACIÓN GENERAL Y VARIABLES DE COLOR ===== */
:root {
    --purple-dark: #4A148C;    /* Morado oscuro para títulos y acentos */
    --purple-medium: #8E44AD; /* Morado medio para fondos o links */
    --blue-light: #40E0D0;     /* turquesa para fondos de sección */
    --blue-accent: #82B1FF;    /* Azul celeste para acentos y hover */
    --text-color: #333333;     /* Color de texto principal */
    --white: #FFFFFF;          /* Blanco */
    --border-radius: 8px;      /* Bordes redondeados para un look moderno */
}


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

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    background-color: var(--white);
    line-height: 1.6;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    overflow-x: hidden; /* Evita el desbordamiento horizontal */
}

.section {
    padding: 20px;
    width: 100%;
}

/* ===== SECCIÓN 1: HEADER Y MENÚ ===== */
.header-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 300px;
    padding-bottom: 20px;
    position: relative;
}

.logo {
    max-width: 250px;
    height: auto;
    margin-bottom: 20px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    text-decoration: none;
    color: var(--purple-dark);
    font-weight: 600;
    padding: 10px 15px;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.main-nav a:hover {
    background-color: var(--purple-medium);
    color: var(--white);
}

.menu-toggle {
    display: none; /* Oculto en escritorio */
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--purple-dark);
    cursor: pointer;
    position: absolute;
    top: 40px;
    right: 20px;
}

/* ===== SECCIÓN 2: CARRUSEL ===== */
.carousel-section {
    height: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--blue-light);
    padding: 40px 20px;
}

.carousel {
    position: relative;
    width: 850px;
    height: 400px;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.carousel-inner {
    display: flex;
    height: 100%;
    transition: transform 0.7s ease-in-out;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Asegura que la imagen cubra el espacio sin deformarse */
}

/* ===== SECCIÓN 3: COLUMNAS DE INFORMACIÓN ===== */
.info-section {
    padding: 60px 20px;
}

.info-columns {
    display: flex;
    justify-content: space-between;
    gap: 20px; /* Espacio entre columnas */
}

.column {
    flex-basis: calc(33.333% - 20px); /* Ancho base de cada columna */
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: #f9f9f9;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.column:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(74, 20, 140, 0.15);
}

.column img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.column h1 {
    font-size: 1.8rem;
    color: var(--purple-dark);
    margin: 20px 0 10px 0;
}

.column p {
    font-size: 0.95rem;
    padding: 0 20px 20px 20px;
    flex-grow: 1; /* Permite que el párrafo ocupe el espacio restante */
}

/* ===== SECCIÓN 4: FOOTER ===== */
.footer-section {
    background-color: var(--purple-dark);
    color: var(--white);
    text-align: center;
    padding: 40px 20px;
}

.social-links {
    margin-bottom: 20px;
}

.social-links a {
    color: var(--white);
    font-size: 1.8rem;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--blue-accent);
}

.contact-info p {
    margin-bottom: 10px;
}

.contact-info a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-info a:hover {
    color: var(--blue-accent);
}

.contact-info i {
    margin-right: 8px;
}

.footer-credit {
    margin-top: 20px;
    font-size: 0.8rem;
    opacity: 0.7;
}


/* ===== DISEÑO RESPONSIVO (TABLETS Y MÓVILES) ===== */
@media (max-width: 992px) {
    .info-columns {
        flex-direction: column;
        align-items: center;
        gap: 40px;
    }
    .column {
        flex-basis: 80%;
        max-width: 500px;
    }
    .carousel-section {
        height: auto;
    }
    .carousel {
        width: 100%;
        max-width: 850px;
        height: auto;
        aspect-ratio: 850 / 400; /* Mantiene la proporción */
    }
}

@media (max-width: 768px) {
    /* --- Menú responsivo --- */
    .menu-toggle {
        display: block; /* Muestra el botón de hamburguesa */
    }
    .main-nav {
        display: none;
        width: 100%;
    }
    .main-nav.active {
        display: block;
        padding-top: 20px;
    }
    .main-nav ul {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .main-nav li {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    .main-nav a {
        display: block;
        width: 100%;
    }

    /* --- Ajustes generales --- */
    .column h1 {
        font-size: 1.5rem;
    }
}
/* ===== ESTILOS PARA BIBLIOTECA v3 (AÑADIR AL FINAL) ===== */

/* --- Panel de Administración --- */
.admin-panel {
    padding: 40px;
    background-color: var(--blue-light);
    min-height: 80vh;
}
.admin-panel h2 {
    text-align: center;
    color: var(--purple-dark);
    margin-bottom: 10px;
}
.admin-panel p {
    text-align: center;
    margin-bottom: 30px;
}
.ticket-list-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
#ticket-table {
    width: 100%;
    border-collapse: collapse;
}
#ticket-table th, #ticket-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
#ticket-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}
.action-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: 600;
    margin-right: 5px;
}
.approve-btn { background-color: #28a745; }
.reject-btn { background-color: #dc3545; }


/* --- Búsqueda de Libros --- */
.search-container {
    display: flex;
    max-width: 500px;
    margin: 0 auto 20px auto;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
#book-search-input {
    flex-grow: 1;
    border: none;
    padding: 12px 15px;
    font-size: 1rem;
}
#book-search-input:focus { outline: none; }
#book-search-btn {
    background-color: var(--purple-medium);
    border: none;
    color: white;
    padding: 0 20px;
    cursor: pointer;
}

/* --- Lomo de Libro Actualizado --- */
.swiper-slide.book-spine {
    width: 50px !important; /* Un poco más ancho para más texto */
    padding: 15px 5px;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
}

.book-spine .title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: white;
    font-family: 'Times New Roman', serif;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
    white-space: nowrap;
    text-align: center;
}

.book-spine .author {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif;
    font-size: 11px;
    margin-top: 15px;
    white-space: nowrap;
    text-align: center;
    opacity: 0.9;
}

.hidden { display: none !important; }

/* Añadir un estilo para el botón de abrir en nueva pestaña en dFlip */
.df-ui-btn.df-ui-custom-1 {
    /* El ícono se definirá en JS */
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900;
    font-size: 16px;
}

/* ===== ESTILOS PARA LA SECCIÓN DE SERVICIOS (AÑADIR AL FINAL) ===== */

#servicios-section {
    padding: 60px 20px;
    background-color: var(--white);
}

.servicios-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--purple-dark);
    margin-bottom: 40px;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.servicio-card {
    background-color: transparent;
    height: 300px;
    perspective: 1000px; /* Efecto 3D */
    cursor: pointer;
    border-radius: var(--border-radius);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
}

/* El estado 'flipped' que se aplica con JS */
.servicio-card.is-flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* para Safari */
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.card-front {
    background-color: var(--white);
    color: black;
}

.card-front img {
    width: 100%;
    height: 75%;
    object-fit: cover;
}

.card-front h3 {
    text-align: center;
    padding: 15px 10px;
    font-size: 1.2rem;
    color: var(--purple-dark);
}

.card-back {
    background-color: var(--purple-medium);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card-back p {
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

/* --- Responsividad para la sección de servicios --- */
@media (max-width: 992px) {
    .servicios-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .servicios-grid {
        grid-template-columns: 1fr;
    }
    .servicios-title {
        font-size: 2rem;
    }
}
/* ===== ESTILOS PARA PÁGINA "NOSOTROS" (AÑADIR AL FINAL) ===== */

/* --- Estilos para diapositivas de texto en el carrusel --- */
.text-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    height: 100%;
    background-color: var(--purple-dark);
    color: var(--white);
}

.text-slide h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--blue-accent);
}

.text-slide p {
    font-size: 1.2rem;
    max-width: 80%;
    line-height: 1.6;
    font-weight: 300;
}

/* --- Estilos para la Línea de Tiempo --- */
#timeline-section {
    padding: 60px 20px;
    background-color: var(--white);
}

.timeline-main-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--purple-dark);
    margin-bottom: 60px;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* La línea vertical central */
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--blue-light);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    /* Animación de entrada */
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* Estado visible que aplica JS */
.timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Items a la izquierda */
.timeline-item:nth-child(odd) {
    left: 0;
}

/* Items a la derecha */
.timeline-item:nth-child(even) {
    left: 50%;
}

/* El punto en la línea */
.timeline-dot {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--purple-medium);
    border: 4px solid var(--blue-accent);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-content {
    padding: 20px 30px;
    background-color: #f9f9f9;
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.timeline-item:nth-child(even) {
    text-align: left;
}
.timeline-item:nth-child(odd) {
    text-align: right;
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--purple-dark);
    margin-bottom: 10px;
}

/* --- Responsividad de la Línea de Tiempo --- */
@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
        text-align: left;
    }
    .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 21px;
    }
}
/* ===== ESTILOS PARA PÁGINA "CONTACTO" (AÑADIR AL FINAL) ===== */

/* --- Estilos para diapositivas de iconos en el carrusel --- */
.icon-slide {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
    background-color: var(--blue-light);
}

.icon-slide a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--purple-dark);
    font-size: 1.5rem;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.icon-slide a:hover {
    transform: scale(1.1);
    color: var(--purple-medium);
}

.icon-slide i {
    font-size: 5rem;
    margin-bottom: 15px;
}

/* --- Estilos para el Juego de Memoria (CORREGIDO) --- */
#memory-game-section {
    padding: 60px 20px;
    background-color: var(--white);
    text-align: center;
}

.memory-game-title {
    font-size: 2.5rem;
    color: var(--purple-dark);
    margin-bottom: 10px;
}

.memory-game-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}

.memory-game {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.memory-card {
    background-color: transparent;
    height: 150px;
    perspective: 1000px; /* Perspectiva para el efecto 3D */
    cursor: pointer;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-radius: var(--border-radius);
}

/* Aplica la rotación al 'inner' cuando la tarjeta se voltea */
.memory-card.flip .memory-card-inner {
    transform: rotateY(180deg);
}

.card-front-face, .card-back-face {
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: var(--border-radius);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden; /* Safari */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-back-face {
    background-color: var(--purple-dark);
}
.card-back-face img {
    width: 70%;
}

.card-front-face {
    background-color: var(--blue-light);
    color: var(--purple-dark);
    font-size: 3rem;
    transform: rotateY(180deg); /* La cara frontal empieza girada */
}

/* El resto de los estilos de la página de contacto no necesitan cambios */

/* --- Botón para reiniciar el juego --- */
#reset-game-btn {
    margin-top: 40px;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    background-color: var(--purple-medium);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#reset-game-btn:hover {
    background-color: var(--purple-dark);
}

#reset-game-btn.hidden {
    display: none;
}

/* --- Estilos para el Canvas de Confeti --- */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    pointer-events: none; /* Permite hacer clic a través del canvas */
}
/* ===== ESTILOS PARA LA ESTANTERÍA DE HEYZINE (AÑADIR AL FINAL) ===== */
#heyzine-bookshelf-section {
    padding: 60px 20px;
    text-align: center;
}
.heyzine-title {
    font-size: 2.5rem;
    color: var(--purple-dark);
    margin-bottom: 10px;
}
.heyzine-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 40px;
}
.heyzine-embed-container {
    max-width: 1200px;
    margin: 0 auto;
    /* Ajusta la altura mínima según necesites */
    min-height: 80vh; 
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden; /* Para que el iframe respete el borde redondeado */
}
.heyzine-embed-container iframe {
    width: 100%;
    height: 80vh; /* Asegúrate de que coincida con min-height */
    border: none;
}
