@charset "UTF-8";

@import "styles-core.css";

/* POR AHORA NO SE USA */
/* Navegación */
nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: all 0.2s;
}

nav a:hover,
nav a:focus {
    background: var(--secondary-color);
    color: var(--primary-color);
}

/* Main container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    z-index: 10;
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2, h3, h4, :focus {
  scroll-margin-top: 70px; /* altura aproximada de la cabecera */
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Grilla de cursos */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Tarjetas de curso */
.course-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 10;
}

.course-card:hover  {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.course-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.course-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: white;
}

.course-title a {
    color: white;
    text-decoration: none;
    outline-color: white;
    border-radius: var(--border-radius);
}

.course-title a:hover {
    text-decoration: underline;
}

.course-description {
    opacity: 0.8;
    font-size: 0.9rem;
}

.module-description {
    opacity: 0.8;
    font-size: 0.9rem;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.course-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 0.3s;
}

/* Contenido del curso */
.course-content {
    padding: 1.5rem;
}

/* Unidades */
.units-list {
    list-style: none;
}

.unit-item {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    padding: 0.5rem;
}

.unit-item:hover, .unit-item:focus-within {
    box-shadow: var(--shadow-lg);
}

.unit-header {
    background: var(--secondary-color);
    padding: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.unit-header:hover {
    background: #e2e8f0;
}

.unit-header[aria-expanded="true"] {
    background: var(--primary-color);
    color: white;
}

.unit-title {
    font-weight: 600;
    margin: 0;
}

.unit-title a {
    text-decoration: none;
}

.unit-title a:hover, .unit-title a:focus {
    text-decoration: underline;
    outline: none;
    background: white;
}

.unit-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    gap: 1rem;
}

.unit-header[aria-expanded="true"] .unit-meta {
    color: rgba(255, 255, 255, 0.8);
}

.expand-icon {
    transition: transform 0.2s;
}

.unit-header[aria-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

/* Lecciones */
.lessons-list {
    list-style: none;
    padding: 0;
    background: white;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.lessons-list.expanded {
    max-height: 500px;
    transition: max-height 0.3s ease-in;
}

.lesson-item {
    border-top: 1px solid var(--border-color);
}

.lesson-link {
    display: flex;
    align-items: center;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: background-color 0.2s;
}

.lesson-link:hover,
.lesson-link:focus {
    background: var(--secondary-color);
}

.lesson-status {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.lesson-status.completed {
    background: var(--success-color);
    color: white;
}

.lesson-status.in-progress {
    background: var(--warning-color);
    color: white;
}

.lesson-status.not-started {
    background: var(--border-color);
    color: var(--text-light);
}

.lesson-info {
    flex: 1;
}

.lesson-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.lesson-duration {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn:hover,
.btn:focus {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #cbd5e1;
}


/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    .course-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .unit-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}