/* =========================================================
   IDENTIDAD VISUAL: ELAN E-LEARNING
   Tipografía: Montserrat
   Paleta: Tonos Base (Beige/Tierra) + Acentos (Azul/Dorado)
   =========================================================
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* Tonos Base del Mood Board */
    --bg-main: #F5F5EB;        /* Fondo general ultra claro */
    --bg-sidebar: #EFE8DA;     /* Fondo del menú lateral */
    --border-color: #E1D9CA;   /* Líneas divisorias sutiles */
    --terracotta: #B3917A;     /* Color de apoyo cálido */
    
    /* Superficies */
    --surface-color: #FFFFFF;  /* Tarjetas blancas para crear contraste limpio */
    
    /* Acentos del Logotipo */
    --brand-blue: #00AEEF;     /* Azul Cyan del logo para botones primarios */
    --brand-blue-hover: #008fca;
    --brand-gold: #C5A059;     /* Dorado del logo para acentos y badges */
    
    /* Textos */
    --text-main: #2C2C2C;      /* Gris muy oscuro, mejor lectura que el negro puro */
    --text-muted: #7A7266;     /* Gris cálido/marrón para textos secundarios */
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Montserrat', sans-serif; 
}

body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    line-height: 1.6;
}

/* =========================================
   1. PANTALLA DE LOGIN
   ========================================= */
.login-container {
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 20px;
    background-color: var(--bg-main);
    /* Opcional: Un degradado sutil usando sus colores */
    background: linear-gradient(135deg, var(--bg-main) 0%, var(--bg-sidebar) 100%);
}

.login-box {
    background: var(--surface-color); 
    padding: 50px 40px; 
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(179, 145, 122, 0.15); /* Sombra teñida con su color terracota */
    width: 100%; 
    max-width: 420px; 
    text-align: center;
    border: 1px solid var(--border-color);
}

.login-box h2 { 
    margin-bottom: 30px; 
    color: var(--brand-gold); /* Título en dorado */
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* =========================================
   2. FORMULARIOS Y BOTONES GENERALES
   ========================================= */
input, select, textarea {
    width: 100%; 
    padding: 14px 16px; 
    margin-bottom: 20px; 
    border: 2px solid var(--border-color);
    border-radius: 10px; 
    outline: none; 
    transition: all 0.3s ease;
    background-color: #FAFAFA;
    font-size: 0.95rem;
    color: var(--text-main);
}

input:focus, select:focus, textarea:focus { 
    border-color: var(--brand-blue); 
    background-color: var(--surface-color);
    box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.1);
}

button, .btn-primary {
    width: 100%; 
    padding: 14px; 
    background: var(--brand-blue); 
    color: white;
    border: none; 
    border-radius: 10px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
}

button:hover, .btn-primary:hover { 
    background: var(--brand-blue-hover); 
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 174, 239, 0.3);
}

.btn-danger { 
    background-color: #E63946; 
    color: white; 
    padding: 8px 16px; 
    border-radius: 8px; 
    text-decoration: none; 
    font-size: 0.85rem; 
    font-weight: 600;
    transition: 0.3s;
}
.btn-danger:hover { background-color: #D62828; }

/* =========================================
   3. ESTRUCTURA DASHBOARD (MENÚ Y CONTENIDO)
   ========================================= */
.dashboard { 
    display: flex; 
    min-height: 100vh; 
    flex-direction: column; 
}

@media(min-width: 768px) { 
    .dashboard { flex-direction: row; } 
}

/* Sidebar / Menú Lateral */
.sidebar {
    background: var(--bg-sidebar); 
    width: 100%; 
    padding: 32px 24px;
    border-right: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    gap: 12px;
}

@media(min-width: 768px) { 
    .sidebar { width: 280px; height: 100vh; position: sticky; top: 0; } 
}

.sidebar h3 { 
    color: var(--brand-gold); 
    margin-bottom: 24px; 
    font-size: 1.25rem;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.sidebar a {
    text-decoration: none; 
    color: var(--text-muted); 
    padding: 12px 16px;
    border-radius: 8px; 
    transition: all 0.2s ease; 
    font-weight: 600; 
    font-size: 0.95rem;
    display: block;
}

.sidebar a:hover { 
    background: var(--surface-color); 
    color: var(--brand-blue); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

/* Estado activo en el menú (Puedes usar este estilo en línea en el HTML actual) */
.sidebar a[style*="background"] {
    background: var(--surface-color) !important;
    color: var(--brand-gold) !important;
    border-left: 4px solid var(--brand-blue);
    border-radius: 0 8px 8px 0;
}

.logout-btn { 
    margin-top: auto; 
    color: #E63946 !important; 
}
.logout-btn:hover { background: #fee2e2 !important; }

/* Contenido Principal */
.main-content { 
    flex: 1; 
    padding: 40px; 
}

.header-dash { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 40px; 
}

.header-dash h2 {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.8rem;
}

/* =========================================
   4. TARJETAS (CARDS) Y GRID
   ========================================= */
.card-grid, .clases-grid, .task-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 24px; 
}

.card, .clase-card, .task-card, .qna-card { 
    background: var(--surface-color); 
    padding: 30px; 
    border-radius: 16px; 
    border: 1px solid var(--border-color); 
    box-shadow: 0 10px 30px rgba(179, 145, 122, 0.08); /* Sombra elegante */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover, .clase-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(179, 145, 122, 0.15);
}

.card h4, .clase-card h4 { 
    margin-bottom: 12px; 
    color: var(--text-main); 
    font-weight: 700;
    font-size: 1.25rem;
}

.badge { 
    display: inline-block; 
    padding: 6px 12px; 
    background: rgba(197, 160, 89, 0.15); /* Fondo dorado transparente */
    color: var(--brand-gold); 
    border-radius: 20px; 
    font-size: 0.8rem; 
    font-weight: 700; 
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* =========================================
   5. TABLAS DE DATOS
   ========================================= */
.table-container { 
    overflow-x: auto; 
    margin-top: 20px; 
    background: var(--surface-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    text-align: left; 
}

th, td { 
    padding: 18px 20px; 
    border-bottom: 1px solid var(--border-color); 
}

th { 
    background-color: var(--bg-sidebar); 
    color: var(--text-main); 
    font-weight: 700; 
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:hover { background-color: var(--bg-main); }

/* =========================================
   6. ALERTAS Y ESTADOS
   ========================================= */
.alert { 
    padding: 16px 20px; 
    border-radius: 10px; 
    margin-bottom: 24px; 
    font-weight: 600; 
    font-size: 0.95rem;
}
.alert.success { 
    background-color: #E8F5E9; 
    color: #2E7D32; 
    border: 1px solid #C8E6C9; 
    border-left: 5px solid #4CAF50;
}
.alert.error { 
    background-color: #FFEBEE; 
    color: #C62828; 
    border: 1px solid #FFCDD2; 
    border-left: 5px solid #F44336;
}

/* Estilos específicos para tareas y foros */
.btn-action { padding: 10px 20px; border-radius: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 600; text-align: center; }
.btn-pending { background: rgba(0, 174, 239, 0.1); color: var(--brand-blue); border: 1px solid var(--brand-blue); }
.btn-pending:hover { background: var(--brand-blue); color: white; }
.btn-done { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; cursor: default; }

.respuesta-box { background: var(--bg-main); padding: 20px; border-radius: 10px; border-left: 4px solid var(--brand-blue); margin-top: 15px;}