/* ========================= */
/* DASHBOARD — LAYOUT        */
/* ========================= */

.dash-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 70px; /* altura del navbar */
}

/* ========================= */
/* SIDEBAR                   */
/* ========================= */
.sidebar {
    width: 260px;
    background: var(--navy);
    position: fixed;
    top: 70px;
    left: 0;
    bottom: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-profile {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 16px;
}

.sidebar-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark, #00A08B));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0 auto 12px;
}

.sidebar-name {
    color: white;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-role {
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

/* Menú lateral */
.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-menu li a,
.sidebar-menu li button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    text-align: left;
}

.sidebar-menu li a:hover,
.sidebar-menu li button:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.sidebar-menu li a.active,
.sidebar-menu li button.active {
    color: white;
    background: rgba(0,191,166,0.15);
}

.sidebar-menu li a i,
.sidebar-menu li button i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-spacer { flex: 1; }

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer a,
.sidebar-footer button {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    background: none;
    border: none;
    width: 100%;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}

.sidebar-footer a:hover,
.sidebar-footer button:hover {
    color: #FF6B6B;
    background: rgba(255,107,107,0.08);
}

/* ========================= */
/* CONTENIDO PRINCIPAL       */
/* ========================= */
.dash-main {
    flex: 1;
    margin-left: 260px;
    padding: 32px;
    max-width: 1100px;
}

/* ========================= */
/* TARJETA DE BIENVENIDA     */
/* ========================= */
.welcome-card {
    background: linear-gradient(135deg, var(--navy), #0F1B33);
    border-radius: var(--radius);
    padding: 32px;
    color: white;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(0,191,166,0.15), transparent);
    top: -50px;
    right: -30px;
    border-radius: 50%;
}

.welcome-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.welcome-card p {
    color: rgba(255,255,255,0.6);
    font-size: 0.95rem;
    position: relative;
}

.welcome-card .btn {
    margin-top: 16px;
    position: relative;
}

/* ========================= */
/* TARJETAS DE ESTADÍSTICAS  */
/* ========================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 16px;
}

.stat-card-number {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================= */
/* TARJETAS DE CURSO (dash)  */
/* ========================= */
.dash-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-section-title i { color: var(--teal); }

.course-progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.course-progress-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.course-progress-card:hover {
    box-shadow: var(--shadow);
    border-color: var(--teal);
}

.cp-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.cp-info { flex: 1; }

.cp-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.cp-info p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.cp-bar {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.cp-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-out;
}

.cp-percentage {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navy);
    min-width: 50px;
    text-align: right;
}

.cp-action {
    flex-shrink: 0;
}

.cp-action .btn {
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* ========================= */
/* ACTIVIDAD RECIENTE        */
/* ========================= */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 32px;
}

.activity-item {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.9rem;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.activity-text { flex: 1; color: var(--text); }
.activity-text strong { color: var(--navy); }

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ========================= */
/* BADGES / LOGROS           */
/* ========================= */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.badge-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px 16px;
    text-align: center;
    transition: var(--transition);
}

.badge-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.badge-card.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.badge-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 10px;
}

.badge-card h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.badge-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========================= */
/* CERTIFICADOS              */
/* ========================= */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.cert-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    transition: var(--transition);
}

.cert-card:hover {
    box-shadow: var(--shadow);
}

.cert-card.locked {
    opacity: 0.5;
    background: var(--bg);
}

.cert-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.cert-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.cert-card .btn {
    width: 100%;
    justify-content: center;
}

/* ========================= */
/* ONBOARDING OVERLAY        */
/* ========================= */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15,27,51,0.85);
    backdrop-filter: blur(8px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.onboarding-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 48px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: fadeInUp 0.4s ease-out;
}

.onboarding-card .logo-icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
    margin: 0 auto 20px;
}

.onboarding-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}

.onboarding-card p {
    color: var(--text-light);
    margin-bottom: 24px;
}

.onboarding-card input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    text-align: center;
    margin-bottom: 16px;
    transition: var(--transition);
}

.onboarding-card input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0,191,166,0.15);
}

.onboarding-card .btn {
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: 16px;
}

/* ========================= */
/* BOTÓN DEMO                */
/* ========================= */
.demo-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gold);
    color: var(--navy);
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255,184,0,0.3);
    transition: var(--transition);
    z-index: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,184,0,0.4);
}

/* ========================= */
/* QUIZ — SELECCIÓN          */
/* ========================= */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.quiz-select-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
}

.quiz-select-card:hover {
    border-color: var(--teal);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.quiz-select-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 4px;
}

.quiz-select-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.quiz-select-card .quiz-meta {
    display: flex;
    gap: 16px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.quiz-select-card .quiz-meta i { color: var(--teal); }

.quiz-mode-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.quiz-mode-badge.practica {
    background: #E8F5E9;
    color: #2E7D32;
}

.quiz-mode-badge.examen {
    background: #FCE4EC;
    color: #C62828;
}

/* ========================= */
/* QUIZ — EN PROGRESO        */
/* ========================= */
.quiz-container {
    max-width: 720px;
    margin: 0 auto;
}

.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.quiz-progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.quiz-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navy);
}

.quiz-timer.warning { color: #F44336; }
.quiz-timer i { font-size: 0.9rem; }

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 32px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark, #00A08B));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Pregunta */
.quiz-question {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 32px;
    margin-bottom: 24px;
}

.quiz-question h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 24px;
    line-height: 1.5;
}

.quiz-question pre {
    background: #1E1E1E;
    color: #D4D4D4;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin: 12px 0;
    overflow-x: auto;
}

/* Opciones */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    background: var(--bg-card);
}

.quiz-option:hover {
    border-color: var(--teal);
    background: rgba(0,191,166,0.03);
}

.quiz-option.selected {
    border-color: var(--teal);
    background: rgba(0,191,166,0.08);
}

.quiz-option.correct {
    border-color: #4CAF50;
    background: rgba(76,175,80,0.08);
    cursor: default;
}

.quiz-option.incorrect {
    border-color: #F44336;
    background: rgba(244,67,54,0.08);
    cursor: default;
}

.quiz-option-letter {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-shrink: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.quiz-option.selected .quiz-option-letter {
    background: var(--teal);
    color: white;
}

.quiz-option.correct .quiz-option-letter {
    background: #4CAF50;
    color: white;
}

.quiz-option.incorrect .quiz-option-letter {
    background: #F44336;
    color: white;
}

/* Explicación */
.quiz-explanation {
    background: #FFF3E0;
    border-left: 4px solid var(--gold);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    animation: fadeInUp 0.3s ease-out;
}

.quiz-explanation strong {
    color: var(--gold);
}

/* Acciones */
.quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================= */
/* QUIZ — RESULTADOS         */
/* ========================= */
.quiz-results {
    text-align: center;
    padding: 48px 32px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.quiz-results-score {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.quiz-results-score.good { color: #4CAF50; }
.quiz-results-score.ok { color: var(--gold); }
.quiz-results-score.bad { color: #F44336; }

.quiz-results h2 {
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 24px;
}

.quiz-results-breakdown {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-bottom: 32px;
}

.quiz-results-breakdown .stat {
    text-align: center;
}

.quiz-results-breakdown .stat-number {
    font-size: 1.5rem;
    color: var(--navy);
}

.quiz-results-breakdown .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quiz-results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================= */
/* SECCIONES DASH (TABS)     */
/* ========================= */
.dash-section {
    display: none;
}

.dash-section.active {
    display: block;
    animation: fadeInUpStagger 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ========================= */
/* DOS COLUMNAS              */
/* ========================= */
.dash-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

/* ========================= */
/* RESPONSIVE                */
/* ========================= */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .dash-two-cols { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Sidebar → Bottom Nav */
    .sidebar {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 64px;
        flex-direction: row;
        padding: 0 8px;
        align-items: center;
        justify-content: space-around;
        z-index: 200;
    }

    .sidebar-profile { display: none; }
    .sidebar-spacer { display: none; }
    .sidebar-footer { display: none; }

    .sidebar-menu {
        flex-direction: row;
        gap: 0;
        width: 100%;
        justify-content: space-around;
    }

    .sidebar-menu li a,
    .sidebar-menu li button {
        flex-direction: column;
        gap: 4px;
        padding: 8px 6px;
        font-size: 0.65rem;
        text-align: center;
        justify-content: center;
        align-items: center;
    }

    .sidebar-menu li a i,
    .sidebar-menu li button i {
        font-size: 1.2rem;
    }

    .sidebar-menu li a .menu-text,
    .sidebar-menu li button .menu-text {
        font-size: 0.65rem;
    }

    .dash-main {
        margin-left: 0;
        padding: 16px;
        padding-bottom: 80px; /* espacio para bottom nav */
    }

    .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .stat-card { padding: 16px; }
    .stat-card-number { font-size: 1.5rem; }

    .course-progress-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cp-percentage { text-align: left; }
    .cp-action { width: 100%; }
    .cp-action .btn { width: 100%; justify-content: center; }

    .welcome-card { padding: 24px; }
    .welcome-card h2 { font-size: 1.2rem; }

    .quiz-grid { grid-template-columns: 1fr; }
    .quiz-question { padding: 20px; }
    .quiz-results-breakdown { flex-direction: column; gap: 16px; }

    .demo-btn { bottom: 76px; }
}
