/* =========================================
   CONTENIDO DEL AULA (ESTILO TARJETAS - PALETA AZUL)
========================================= */
.modules-list { 
    flex: 1; 
    overflow-y: auto; 
    padding: 1rem; 
}

/* MÓDULO (TARJETA) */
.module-item { 
    margin-bottom: 8px; 
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); /* Sombra suave para separar del fondo oscuro */
}

/* CABECERA DEL MÓDULO */
.module-header {
    padding: 14px 18px;
    background: var(--white);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-ui);
    font-weight: 700; /* Un poco más grueso */
    font-size: 0.95rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    max-width: 100%;
}

.module-header:hover { 
    background: #f4f8ff; 
    color: var(--primary-main);
}

/* ESTADO ACTIVO (EXPANDIDO) - PALETA AZUL */
.module-item.active .module-header { 
    background-color: #eef4ff; /* Un azul muy muy suave */
    color: var(--primary-main); /* Tu azul principal (#2667ff) */
    border-left: 4px solid var(--primary-main); /* Detalle de borde a la izquierda */
}

/* TITULO */
.module-title { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1;              
    min-width: 0;         
    white-space: nowrap;  
    overflow: hidden;     
    text-overflow: ellipsis; 
    text-transform: uppercase;
}

.module-chevron { 
    font-size: 0.8rem; 
    transition: 0.3s; 
    color: #bbb; 
    flex-shrink: 0; 
}

.module-item.active .module-chevron { 
    transform: rotate(180deg); 
    color: var(--primary-main); 
}

/* LISTA DE CLASES */
.classes-container { 
    display: none; 
    background-color: var(--white); 
    padding: 5px 0;
    border-top: 1px solid #f0f0f0;
}
.module-item.active .classes-container { display: block; }

/* ITEM DE CLASE */
.class-item {
    padding: 12px 15px 12px 35px; /* Sangría */
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-gray); /* Color base neutro */
    cursor: pointer;
    transition: 0.2s;
    border-left: 3px solid transparent; 
}

.class-item:hover { 
    background: #f8faff; 
    color: var(--primary-darkest); /* Azul oscuro al pasar el mouse */
    border-left-color: var(--primary-main); 
    font-weight: 500;
}

.class-left { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex: 1; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.class-left i {
    font-size: 0.9rem;
    color: var(--primary-light); /* Iconos en azul claro */
}

/* BOTONES EDICIÓN */
.module-actions { display: flex; gap: 2px; margin-left: 5px; flex-shrink: 0; }
.move-actions { display: flex; flex-direction: column; margin-right: 10px; gap: 3px; }

.mini-btn {
    background: transparent; 
    border: none;
    cursor: pointer; 
    padding: 0; 
    font-size: 0.8rem; 
    color: #ccc; 
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
}
.mini-btn:hover { background: #f0f0f0; color: var(--secondary); }
.move-actions .mini-btn { width: 18px; height: 12px; font-size: 0.6rem; }

/* Reproductor y Grid de Recursos */
.player-wrapper {
    background: black;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: var(--space-xl);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex; justify-content: center; align-items: center;
    min-height: 450px;
}
video, iframe { width: 100%; height: 100%; min-height: 480px; }
.player-wrapper img { max-width: 100%; max-height: 600px; }

.resources-box { 
    background: var(--white); 
    padding: var(--space-xl); 
    border-radius: 16px; 
    box-shadow: var(--shadow); 
    border: 1px solid #f0f0f0;
}

.res-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); border-bottom: 1px solid #eee; padding-bottom: var(--space-md); }
.res-header h4 { margin: 0; color: var(--secondary); font-family: var(--font-head); font-size: 1.2rem; }

/* =========================================
   LISTA DE RECURSOS (ESTILO MOODLE / INSTITUCIONAL)
========================================= */

.res-list { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
}

.resource-card {
    background: #ffffff; 
    border: 1px solid #e2e8f0; 
    border-radius: 12px; 
    padding: 12px 20px; 
    position: relative; 
    transition: all 0.2s ease; 
    display: flex; 
    flex-direction: row;
    align-items: center; 
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.resource-card:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 6px 15px rgba(0,0,0,0.05); 
    border-color: #cbd5e1; 
    background: #f8fafc;
}

/* Enlace que envuelve el icono y texto a la izquierda */
.resource-card-link { 
    text-decoration: none; 
    color: inherit; 
    display: flex; 
    align-items: center; 
    flex: 1;
    min-width: 0; /* Previene desbordamiento de texto */
}

.res-card-icon { 
    width: 48px; 
    height: 48px; 
    border-radius: 10px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 1.5rem; 
    margin-right: 18px;
    flex-shrink: 0;
}

.res-card-info { 
    display: flex; 
    flex-direction: column; 
    flex: 1;
    min-width: 0;
}

.res-card-title { 
    font-family: var(--font-head); 
    font-weight: 700; 
    font-size: 1.05rem; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    color: var(--secondary);
    transition: color 0.2s;
}

.resource-card-link:hover .res-card-title {
    color: var(--primary-main);
    text-decoration: underline;
}

.res-card-type { 
    font-family: var(--font-ui); 
    font-size: 0.85rem; 
    color: #94a3b8; 
    font-weight: 500;
}

/* Botones de acción (Admin) alineados a la derecha */
.res-card-actions { 
    display: flex; 
    gap: 8px; 
    margin-left: 15px; 
    align-items: center;
    z-index: 2;
}

.btn-card-action { 
    background: #ffebee; 
    border: none; 
    width: 36px; 
    height: 36px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-size: 0.9rem; 
    color: #ef4444; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    transition: 0.2s; 
}

.btn-card-action:hover { background: #fca5a5; color: white; }
.btn-card-action.edit { background: #eef4ff; color: var(--primary-main); }
.btn-card-action.edit:hover { background: #dbeafe; color: #0284c7; }

/* Botón Agregar Píldora (Mantenemos tu estilo intacto) */
.btn-add-res {
    background-color: #f0f7ff; color: var(--primary-main); border: 1px solid var(--primary-pale); padding: 8px 20px; border-radius: 50px; font-family: var(--font-ui); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 8px;
}
.btn-add-res:hover { background-color: var(--primary-main); color: var(--white); border-color: var(--primary-main); box-shadow: 0 4px 12px rgba(38, 103, 255, 0.25); }