/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    /* Un fondo degradado oscuro súper moderno tipo "Dark Mode" */
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    color: #e0e0e0;
}

/* Ajustamos el vidrio para que brille sobre fondos oscuros */
.main-glass-container {
    background-color: rgba(20, 30, 48, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.5); 
    width: 100%;
    max-width: 1200px;
    margin: 40px auto; /* CAMBIA A 40px auto PARA DARLE RESPIRACIÓN */
    border-radius: 16px;
    padding: 40px;
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); 
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #ffffff;
    font-size: 36px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.header h2, .section-title p {
    color: #b0bec5;
}

.section-title h3, .card-content h4 {
    color: #ffffff;
}

.info-section {
    background-color: rgba(255, 255, 255, 0.05);
    border-left: 6px solid #3498db;
    border-radius: 8px;
    padding: 20px 30px;
    margin-bottom: 50px;
    color: #fff;
}

.info-card p, .card-content p {
    color: #cfd8dc;
}
.info-card strong {
    color: #3498db; /* Azul brillante */
}

.parcial-section {
    margin-bottom: 60px;
    /* --- NUEVO: Motor de numeración --- */
    counter-reset: exercise-counter;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
    padding-bottom: 20px;
}

/* SISTEMA DE CARRUSEL */
.carousel-wrapper {
    position: relative;
    width: 100%;
}

.grid-container.carousel-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-flow: column; /* Forzar carrusel horizontal */
    grid-auto-columns: minmax(280px, 1fr);
    gap: 25px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    padding: 20px 0;
    
    /* Ocultar barra de desplazamiento */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.grid-container.carousel-container::-webkit-scrollbar {
    display: none;
}

/* Tarjeta individual (Vidrio oscuro) */
.card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    height: 100%;
    position: relative; /* Para posicionar el número neón */
    
    /* --- NUEVO: Aumentar el contador --- */
    counter-increment: exercise-counter;
}

/* --- NUEVO: Estilo del número neón --- */
.card::before {
    content: counter(exercise-counter);
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(52, 152, 219, 0.9); /* Azul neón brillante */
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.7); /* Brillo neón */
    z-index: 5;
    text-shadow: 0 0 5px #ffffff;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.15); /* Brillo neón al hover */
}

.card-preview {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid rgba(236, 240, 241, 0.1);
}

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

.card-content {
    padding: 20px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h4 {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 10px;
}

.card-content p {
    color: #b0bec5;
    font-size: 14px;
    margin-bottom: 20px;
}

/* BOTONES DEL CARRUSEL */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    backdrop-filter: blur(5px);
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.prev-btn {
    left: -22px;
}

.next-btn {
    right: -22px;
}

/* BOTONES DE ENLACE */
.btn-enlace, .btn-pdf {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
}

.btn-enlace {
    background-color: #3498db;
    color: #ffffff;
}

.btn-enlace:hover {
    background-color: #1d72b3;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.btn-pdf {
    background-color: #e74c3c;
    color: #ffffff;
}

.btn-pdf:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

/* --- Arreglo para que el ejercicio extra no afecte la numeración --- */
.card-extra {
    counter-increment: none; /* Evita que sume 1 al contador principal */
}

.card-extra::before {
    content: "10b"; /* Le ponemos su propio numerito especial manual */
    background-color: rgba(230, 126, 34, 0.9); /* Un color naranja neón para diferenciarlo */
    box-shadow: 0 0 10px rgba(230, 126, 34, 0.7);
}

/* --- NUEVO: Controles de Inicio / Fin y Barrita de Progreso --- */
.carousel-controls-extra {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 0 30px;
}

.btn-fast {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #b0bec5;
    padding: 6px 18px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fast:hover {
    background: rgba(52, 152, 219, 0.2);
    border-color: rgba(52, 152, 219, 0.5);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Barrita de progreso estilo Apple / Neón */
.scroll-progress-container {
    flex-grow: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    margin: 0 20px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.scroll-progress-bar {
    height: 100%;
    width: 0%; /* Inicia en 0 */
    background: #3498db;
    border-radius: 4px;
    box-shadow: 0 0 8px #3498db, 0 0 15px #3498db; /* Brillo Neón */
    transition: width 0.15s ease-out;
}


/* =========================================
   CARRUSEL 3D (PROYECTO HUDINI) - 3ER PARCIAL
   ========================================= */
.section-3d-parcial {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    position: relative;
    overflow: hidden;
}

.carousel-3d-container {
    position: relative;
    /* 👇 ANCHO DE LA TARJETA: Lo bajé de 300px a 220px para hacerlas más esbeltas */
    width: 220px; 
    /* 👇 ALTO DE LA TARJETA: Ajustado a 350px para mantener la proporción */
    height: 350px; 
    transform-style: preserve-3d;
    margin-top: 50px;
}

.carousel-item-3d {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    
    /* 1. BÁJALE AL BLUR: 
       Estaba en 15px. Bájalo a unos 5px u 8px. 
       Si lo dejas en 15, el cristal de enfrente va a difuminar tanto las tarjetas de atrás que no se van a distinguir. */
    backdrop-filter: blur(8px); 
    
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.1);
    
    /* 2. LA MAGIA 3D:
       Estaba en 'hidden'. Cámbialo a 'visible'. 
       Esto le dice al navegador que renderice la parte trasera de las tarjetas mientras dan la vuelta. */
    backface-visibility: visible; 
    
    color: #fff;
}

.carousel-item-3d i {
    font-size: 5rem;
    color: #00d2ff;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px #00d2ff);
}

.carousel-item-3d h4 { margin: 10px 0; font-size: 1.2rem; }

#bg-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* Ajuste para los botones del Carrusel 3D */
.carousel-item-3d .btn-enlace {
    width: auto; 
    padding: 6px 18px; 
    font-size: 0.85rem; 
    border-radius: 20px; 
    
    /* 👇 AQUÍ ESTÁ LA MAGIA: 
       Aumenta este valor para empujarlo más hacia abajo. 
       Estaba en 5px, prueba con 30px o 40px hasta que te guste cómo se ve. */
    margin-top: 30px; 
}

/* =========================================
   NÚMERO FLOTANTE DE LA TARJETA 3D
   ========================================= */
.floating-number {
    position: absolute;
    /* La colocamos en la esquina superior izquierda (o derecha, como prefieras) */
    top: -10px;
    left: -10px; 
    width: 30px;
    height: 30px;
    background: rgba(0, 210, 255, 0.15); /* Fondo azul translúcido */
    border-radius: 50%; /* Para que sea un círculo perfecto */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.0rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px #00d2ff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    backdrop-filter: blur(5px);
    
    /* 🔥 EL TRUCO 3D: Esto empuja el número hacia el frente, despegándolo del cristal */
    transform: translateZ(30px); 
}