/* Estilo general del cuerpo */
body {
    font-family: 'Inter', sans-serif; /* Usando Inter para un look más moderno */
    background-color: #f0f2f5; /* Fondo más suave */
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* Encabezado (Uniforme y Animado) */
.animated-header {
    background: linear-gradient(45deg, #007bff, #0056b3);
    background-size: 200% 200%;
    animation: gradientAnimation 10s ease infinite;
    color: white;
    text-align: center;
    padding: 40px 0;
    position: relative;
    overflow: hidden;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); /* Sombra más pronunciada */
}

.animated-header h1 {
    font-size: 3.5rem; /* Tamaño de fuente más grande */
    margin: 0;
    letter-spacing: 1px;
    animation: fadeInDown 1s ease-out forwards 0.5s;
}

.animated-header p {
    font-size: 1.4rem; /* Tamaño de fuente más grande */
    margin: 10px 0 0 0;
    opacity: 0;
    animation: fadeInDown 1s ease-out forwards 0.8s;
}

/* Animación de fondo de gradiente */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animación de aparición para el texto del encabezado */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navegación */
.nav-pills .nav-link {
    font-weight: bold;
    color: white;
    background: #007bff;
    margin: 5px;
    border-radius: 8px; /* Bordes más redondeados */
    transition: all 0.3s ease; /* Transición suave */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-pills .nav-link:hover {
    background: #0056b3;
    color: white;
    transform: translateY(-3px); /* Efecto de elevación al pasar el ratón */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.nav-pills .nav-link.active {
    background: #004085; /* Un azul más oscuro para el activo */
    color: white;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Títulos y secciones */
h2 {
    font-size: 2.5rem;
    color: #007bff;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 10px;
}

h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #007bff;
    border-radius: 2px;
}

h3 {
    font-size: 1.8rem;
    color: #333;
    margin-top: 30px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Niveles de ejercicios/evaluaciones/guías */
section.mt-5 {
    margin-top: 50px;
}

h3::before {
    margin-right: 10px;
    font-size: 1.5em; /* Iconos más grandes */
    vertical-align: middle;
}

h3.basic-level::before { content: '🔰 '; color: #28a745; } /* Verde para básicos */
h3.intermediate-level::before { content: '⚙️ '; color: #ffc107; } /* Amarillo para intermedios */
h3.advanced-level::before { content: '🚀 '; color: #dc3545; } /* Rojo para avanzados */

/* Tarjetas (cards) */
.card {
    border: none; /* Eliminar borde por defecto */
    border-radius: 12px; /* Más redondeado */
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1); /* Sombra más suave */
    overflow: hidden;
    margin-bottom: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px); /* Efecto de elevación al pasar el ratón */
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 25px;
}

.card-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.card-title.basic { color: #28a745; }
.card-title.intermediate { color: #ffc107; }
.card-title.advanced { color: #dc3545; }

.card-text {
    font-size: 1.05rem;
    margin-bottom: 20px;
    color: #555;
}


/* --- INICIO: Estilos para las tarjetas de video --- */
.video-card {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.video-card-img-top {
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    object-fit: cover;
    height: 180px;
}

.video-card-body {
   flex-grow: 1;
   display: flex;
   flex-direction: column;
   padding: 1.25rem;
}

.video-card-title {
    color: #2575fc; /* Color PHP */
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}
/* --- FIN: Estilos para las tarjetas de video --- */

/* Código (PrismJS) */
pre code {
    display: block;
    background-color: #2d2d2d; /* Fondo oscuro para el código */
    color: #f8f8f2; /* Color de texto claro */
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', monospace; /* Fuente monoespaciada */
    font-size: 0.95rem;
    line-height: 1.5;
    box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* Estilo para iframe */
iframe {
    width: 100%;
    height: 500px; /* Ajustable según el contenido */
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: auto;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Botones interactivos */
.btn {
    display: inline-flex; /* Para alinear íconos si se añaden */
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 12px 25px;
    margin: 10px 8px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none; /* Asegurar que los enlaces se vean como botones */
}

.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-hint {
    background-color: #ffc107; /* Amarillo */
    color: #333;
}
.btn-hint:hover {
    background-color: #e0a800;
    color: white;
    transform: translateY(-2px);
}

.btn-solution {
    background-color: #28a745; /* Verde */
    color: #fff;
}
.btn-solution:hover {
    background-color: #218838;
    transform: translateY(-2px);
}

.btn-validate {
    background-color: #007bff; /* Azul */
    color: white;
}
.btn-validate:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-2px);
}

.btn-outline-primary,
.btn-outline-warning,
.btn-outline-info,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger {
    border-width: 2px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover,
.btn-outline-warning:hover,
.btn-outline-info:hover,
.btn-outline-secondary:hover,
.btn-outline-success:hover,
.btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}


/* Acordeones (para teoría y evaluaciones) */
.accordion-item {
    border: none;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.accordion-header .accordion-button {
    background-color: #e9ecef; /* Fondo más claro */
    color: #333;
    font-size: 1.25rem;
    font-weight: bold;
    padding: 18px 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.accordion-header .accordion-button:not(.collapsed) {
    background-color: #007bff;
    color: white;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.accordion-header .accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    background-color: white;
    padding: 25px;
    border-top: 1px solid #eee;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.accordion-body pre code {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* Iconos en las tarjetas de módulos (index.html) */
.module-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    color: #007bff;
    transition: transform 0.3s ease;
}

.module-card:hover .module-icon {
    transform: scale(1.1); /* Efecto de zoom en el icono */
}

/* Secciones de Guías y Recursos */
.list-group-item {
    display: flex;
    align-items: center;
    background-color: white;
    border: none;
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 15px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.list-group-item strong {
    color: #007bff;
    margin-right: 10px;
}

.list-group-item .btn-link {
    margin-left: auto;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

.list-group-item .btn-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.resource-icon, .evaluation-icon {
    font-size: 2.2rem;
    margin-right: 15px;
    color: #007bff; /* Color por defecto, se puede sobrescribir */
}

/* Estilos específicos para evaluaciones */
.evaluation-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.evaluation-card-header:hover {
    background-color: #e9ecef;
}

.evaluation-card-header h3 {
    margin: 0;
    border-bottom: none; /* Eliminar borde inferior del h3 */
    padding-bottom: 0;
    font-size: 1.5rem;
}

.evaluation-card-header .btn {
    margin: 0; /* Eliminar margen de los botones dentro del header */
}

#resultado-basica,
#resultado-intermedio,
#resultado-avanzado {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
}

#resultado-basica[style*="color: green"],
#resultado-intermedio[style*="color: green"],
#resultado-avanzado[style*="color: green"] {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724 !important;
}

#resultado-basica[style*="color: orange"],
#resultado-intermedio[style*="color: orange"],
#resultado-avanzado[style*="color: orange"] {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404 !important;
}


/* Footer */
footer {
    background: #212529; /* Color de fondo más oscuro */
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    font-size: 0.95rem;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
}

/* Animaciones generales de aparición */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-animated {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

/* Media Queries para Responsividad */
@media (max-width: 768px) {
    .animated-header h1 {
        font-size: 2.5rem;
    }

    .animated-header p {
        font-size: 1rem;
    }

    .nav-pills .nav-link {
        margin: 5px 0;
    }

    h2 {
        font-size: 2rem;
    }

    h3 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 15px;
    }

    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.95rem;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .accordion-header .accordion-button {
        font-size: 1.1rem;
        padding: 15px 20px;
    }

    .accordion-body {
        padding: 20px;
    }

    .module-icon {
        font-size: 2.8rem;
    }

    .resource-icon, .evaluation-icon {
        font-size: 1.8rem;
    }
}
