/* ============================================================
   AULA VIRTUAL — ErgWin Academy  
   Tema Claro: Blanco / Azul / Negro
   Archivo COMPLETO con TODOS los estilos de TODA la app
   ============================================================ */

/* ===== Variables ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --success: #10b981;
    --success-dark: #059669;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-input: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --transition: all .2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Form Elements (global) ===== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="search"],
input[type="tel"],
select,
textarea {
    font-family: var(--font);
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-input);
    color: var(--text);
    padding: 10px 14px;
    width: 100%;
    outline: none;
    transition: var(--transition);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Radio & Checkbox — do NOT override width/appearance */
input[type="radio"],
input[type="checkbox"] {
    width: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    appearance: auto;
    cursor: pointer;
}

button {
    font-family: var(--font);
    font-size: 14px;
    cursor: pointer;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-weight: 500;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text);
}

table {
    width: 100%;
    border-collapse: collapse;
}

/* ===== Buttons ===== */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
    padding: 10px 24px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, .25);
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-xs);
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    border-radius: var(--radius-xs);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-small {
    font-size: 12px;
    padding: 6px 14px;
    background: #fff;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-weight: 500;
}

.btn-small:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-back {
    background: rgba(0, 0, 0, .05);
    color: var(--text-muted);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.btn-back:hover {
    background: rgba(0, 0, 0, .1);
    color: var(--text);
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: var(--text-muted);
    font-size: 12px;
    padding: 0;
    margin: 0 2px;
}

.btn-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-action.btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--danger);
}

.btn-action.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-action.btn-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: var(--info);
}

.btn-action.btn-info:hover {
    background: var(--info);
    color: #fff;
}

.btn-action.btn-edit {
    background: #fefce8;
    border-color: #fde68a;
    color: var(--warning);
}

.btn-action.btn-edit:hover {
    background: var(--warning);
    color: #fff;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 60px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-dark);
}

.header-brand i {
    font-size: 22px;
    color: var(--primary);
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav>a {
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-nav>a:hover {
    color: var(--primary);
    background: var(--bg-card-hover);
}

.btn-login {
    background: transparent !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-weight: 600;
}

.btn-login:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

.btn-register {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    font-weight: 600;
}

/* User Dropdown */
.header-user-dropdown {
    position: relative;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
}

.header-user-info:hover {
    background: var(--bg-card-hover);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.header-user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-width: 200px;
    padding: 8px;
    margin-top: 4px;
    display: none;
    box-shadow: var(--shadow-md);
    z-index: 200;
}

.header-user-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 13px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-message {
    padding: 0 24px;
    position: relative;
    z-index: 90;
}

.flash-content {
    max-width: 1400px;
    margin: 12px auto;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: auto;
    color: inherit;
    opacity: .6;
    padding: 0;
}

.flash-close:hover {
    opacity: 1;
}

.flash-success .flash-content {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.flash-error .flash-content {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ============================================================
   AUTH PAGES (Login / Register)
   ============================================================ */
.auth-page {
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin: 20px;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
}

.login-brand {
    position: relative;
    z-index: 2;
}

.brand-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, .2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #fff;
    margin: 0 auto 16px;
    backdrop-filter: blur(10px);
}

.login-brand h1 {
    font-size: 28px;
    color: #fff;
    font-weight: 800;
}

.login-brand p {
    color: rgba(255, 255, 255, .9);
}

.login-illustration {
    margin-top: 40px;
}

.floating-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.float-card {
    background: rgba(255, 255, 255, .2);
    backdrop-filter: blur(10px);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: float 3s ease-in-out infinite;
}

.fc1 {
    animation-delay: 0s;
}

.fc2 {
    animation-delay: .3s;
}

.fc3 {
    animation-delay: .6s;
}

.fc4 {
    animation-delay: .9s;
}

.fc5 {
    animation-delay: 1.2s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.login-right {
    flex: 1;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.login-form-container {
    width: 100%;
    max-width: 380px;
}

.login-tabs {
    display: flex;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-input);
}

.login-tab.active {
    background: var(--primary);
    color: #fff;
}

.login-tab:hover:not(.active) {
    background: var(--bg-card-hover);
    color: var(--text);
}

.auth-form h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.form-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px;
    border-radius: var(--radius-xs);
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 10px;
    border-radius: var(--radius-xs);
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.toggle-pass {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    padding: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkbox-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    cursor: pointer;
}

.checkbox-item:last-child {
    border-bottom: none;
}

.checkbox-item:hover {
    background: var(--bg-card-hover);
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

/* ============================================================
   DASHBOARD (Estudiante)
   ============================================================ */
.dashboard-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.welcome-banner {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    box-shadow: var(--shadow-sm);
}

.welcome-text h2 {
    font-size: 22px;
    font-weight: 700;
}

.welcome-text h2 span {
    color: var(--primary);
}

.welcome-text p {
    color: var(--text-muted);
    margin-top: 4px;
}

.welcome-stats {
    display: flex;
    gap: 32px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.courses-section {
    margin-bottom: 32px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.course-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.course-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--primary-light);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-progress-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.card-badge-completed {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--success);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-body {
    padding: 16px;
    flex: 1;
}

.card-body h4 {
    color: var(--text);
    font-weight: 700;
    margin-bottom: 6px;
}

.card-body p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 10px;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width .4s ease;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-card-hover);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    opacity: .4;
}

.empty-state p {
    margin-bottom: 16px;
}

.empty-text {
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    font-size: 14px;
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-title {
    padding: 0 20px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.admin-nav a:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.admin-nav a.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
    border-right: 3px solid var(--primary);
}

.admin-nav a i {
    width: 18px;
    text-align: center;
}

.admin-main {
    flex: 1;
    padding: 24px;
    overflow-x: auto;
}

.admin-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.admin-header-row h1 {
    font-size: 22px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-primary .stat-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-success .stat-icon {
    background: #ecfdf5;
    color: var(--success);
}

.stat-warning .stat-icon {
    background: #fffbeb;
    color: var(--warning);
}

.stat-info .stat-icon {
    background: #eff6ff;
    color: var(--info);
}

.stat-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
}

.stat-lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Admin Grid & Cards */
.admin-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.admin-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.admin-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-card-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-body {
    padding: 16px 20px;
}

/* Admin Table */
.admin-table {
    width: 100%;
}

.admin-table th {
    text-align: left;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 2px solid var(--border);
    background: #f8fafc;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    font-size: 13px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.actions-cell {
    white-space: nowrap;
}

.cell-with-img {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-thumb {
    width: 48px;
    height: 36px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Search & Filter inline */
.search-inline {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
}

.search-inline input {
    flex: 1;
}

.search-inline button {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-xs);
    padding: 10px 16px;
}

.filter-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.filter-inline label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-inline select {
    max-width: 300px;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.badge-success {
    background: #d1fae5;
    color: #047857;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   COURSE EDITOR (admin/curso_editor.php)
   ============================================================ */

/* Navbar (shared between editor & course view) */
.navbar {
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 50px;
    box-shadow: var(--shadow-sm);
}

.editor-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.nav-brand i {
    color: var(--primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Editor Layout */
.editor-layout {
    display: flex;
    height: calc(100vh - 50px);
}

.editor-sidebar {
    width: 280px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}

.editor-main {
    flex: 1;
    background: var(--bg);
    overflow-y: auto;
    padding: 24px;
}

.sidebar-header-editor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-header-editor h3 {
    font-size: 14px;
    font-weight: 700;
}

.btn-add-module {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-add-module:hover {
    background: var(--primary-dark);
}

/* Module Items */
.module-item {
    border-bottom: 1px solid var(--border-light);
}

.module-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
}

.module-header-bar:hover {
    background: var(--bg-card-hover);
}

.module-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    flex: 1;
    min-width: 0;
}

.module-name i {
    flex-shrink: 0;
}

.module-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.module-actions {
    display: flex;
    gap: 4px;
}

.module-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 4px 6px;
    font-size: 12px;
    border-radius: 4px;
}

.module-actions button:hover {
    color: var(--danger);
    background: #fef2f2;
}

.module-chevron {
    transition: transform .2s;
    font-size: 11px;
}

.module-item.expanded .module-chevron {
    transform: rotate(90deg);
}

.module-classes {
    display: none;
}

.module-item.expanded .module-classes {
    display: block;
}

/* Class & Exam Items in Sidebar */
.class-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px 8px 32px;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.class-item:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.class-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.class-item i {
    flex-shrink: 0;
    width: 16px;
    text-align: center;
    font-size: 12px;
}

.class-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.class-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
    opacity: 0;
    transition: opacity .2s;
}

.class-item:hover .class-actions {
    opacity: 1;
}

.class-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 4px;
}

.class-actions button:hover {
    color: var(--danger);
    background: #fef2f2;
}

.exam-item {
    color: var(--primary) !important;
    font-weight: 500;
}

.btn-add-class {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px 6px 32px;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
}

.btn-add-class:hover {
    color: var(--primary);
    background: var(--bg-card-hover);
}

/* Editor Content Area */
.editor-content {
    max-width: 900px;
    margin: 0 auto;
}

.editor-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 80px 20px;
}

.editor-placeholder i {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
    opacity: .3;
}

.editor-placeholder h3 {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.editor-placeholder p {
    font-size: 14px;
}

.editor-toolbar-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.input-large {
    font-size: 18px;
    font-weight: 600;
    padding: 12px 16px;
}

/* Inline Edit */
.inline-edit-input {
    background: #fff;
    border: 2px solid var(--primary);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: .9rem;
    width: 80%;
    outline: none;
}

.new-item-container {
    padding: 4px 16px 8px 32px;
}

.new-item-container input {
    font-size: 12px;
    padding: 6px 10px;
}

/* Quill Editor overrides */
.editor-content .ql-toolbar {
    background: #fff;
    border-color: var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.editor-content .ql-container {
    background: #fff;
    border-color: var(--border);
    color: var(--text);
    min-height: 400px;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.ql-container {
    font-family: inherit !important;
    font-size: 1rem !important;
}

/* ============================================================
   EXAM EDITOR (inside curso_editor)
   ============================================================ */
.pregunta-block {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 16px;
}

.pregunta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pregunta-header strong {
    font-size: 14px;
    color: var(--text);
}

.pregunta-input {
    font-size: 14px;
    font-weight: 500;
}

.opcion-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.opcion-row:last-child {
    border-bottom: none;
}

/* FIX: option inputs must be visible and writable  */
.opcion-input {
    flex: 1 !important;
    width: auto !important;
    padding: 8px 12px !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xs) !important;
    font-size: 13px !important;
    background: #fff !important;
    color: var(--text) !important;
}

.opcion-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .15) !important;
}

/* ============================================================
   CATÁLOGO PÚBLICO
   ============================================================ */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 60px 24px;
    text-align: center;
    color: #fff;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero-content h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
}

.hero-content p {
    font-size: 16px;
    opacity: .9;
    margin-bottom: 24px;
}

.hero-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, .15);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    max-width: 500px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
}

.hero-search input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 14px;
    padding: 8px;
    outline: none;
    width: auto;
}

.hero-search input::placeholder {
    color: rgba(255, 255, 255, .6);
}

.hero-search button {
    background: #fff;
    color: var(--primary);
    border: none;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.courses-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

.courses-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.courses-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.courses-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.courses-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.no-courses {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    grid-column: 1/-1;
}

.no-courses i {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: .3;
}

.pub-course-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.pub-course-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.pub-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: var(--primary-light);
}

.pub-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-card-duration {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pub-card-body {
    padding: 16px;
    flex: 1;
}

.pub-card-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.pub-card-body p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.pub-card-meta {
    display: flex;
    gap: 12px;
    color: var(--text-light);
    font-size: 12px;
    margin-bottom: 8px;
}

.pub-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pub-card-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-tag {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
}

.btn-inscribirse {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.btn-inscribirse:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-continuar {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-xs);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-continuar:hover {
    background: var(--success-dark);
    color: #fff;
}

.btn-inscrito {
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   COURSE VIEW (curso.php — Student)
   ============================================================ */
.course-page {
    background: var(--bg);
}

.course-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
}

.course-navbar .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Progress bar in navbar */
.course-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

/* Course Layout */
.course-layout {
    display: flex;
    min-height: calc(100vh - 50px);
}

.course-sidebar {
    width: 300px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-header img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.sidebar-header h3 {
    padding: 16px 16px 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.sidebar-header p {
    padding: 0 16px 16px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.sidebar-content {
    padding: 0;
}

.sidebar-unit {
    border-bottom: 1px solid var(--border-light);
}

.unit-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    background: #f8fafc;
}

.unit-header i {
    color: var(--warning);
    font-size: 14px;
}

.unit-topics {
    padding: 0;
}

.topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px 10px 28px;
    font-size: 13px;
    color: var(--text-muted);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.topic-item:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.topic-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
}

.topic-item.completed {
    color: var(--success);
}

.topic-item.completed i {
    color: var(--success);
}

.topic-item i {
    width: 16px;
    text-align: center;
    font-size: 12px;
    flex-shrink: 0;
}

.topic-item span {
    flex: 1;
}

.topic-exam {
    color: var(--primary);
    font-weight: 500;
}

/* Course Main Content */
.course-main {
    flex: 1;
    overflow-y: auto;
}

.content-area {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px;
}

.content-header {
    margin-bottom: 24px;
}

.content-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.content-breadcrumb i {
    font-size: 10px;
}

.content-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.content-body {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 32px;
    margin-bottom: 24px;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.content-body h1,
.content-body h2,
.content-body h3,
.content-body h4 {
    margin: 16px 0 8px;
    color: var(--text);
}

.content-body p {
    margin-bottom: 12px;
}

.content-body ul,
.content-body ol {
    padding-left: 24px;
    margin-bottom: 12px;
}

.content-body img {
    border-radius: var(--radius-sm);
    margin: 12px 0;
}

.content-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.completed-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--success);
    font-weight: 600;
    font-size: 15px;
    background: #ecfdf5;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: 1px solid #a7f3d0;
}

.content-placeholder {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-light);
}

.content-placeholder i {
    font-size: 64px;
    display: block;
    margin-bottom: 16px;
    opacity: .3;
}

.content-placeholder h3 {
    font-size: 20px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.content-placeholder p {
    font-size: 14px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: #fff;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand h3 {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-social a:hover {
    background: var(--primary);
    color: #fff;
}

.footer-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-lg {
    max-width: 750px;
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ============================================================
   HELPERS
   ============================================================ */
.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.full-width {
    width: 100%;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .admin-grid-2col {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .course-sidebar {
        width: 250px;
    }
}

@media (max-width: 768px) {

    /* Admin */
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 12px 0;
    }

    .admin-nav {
        flex-direction: row;
        overflow-x: auto;
    }

    .admin-nav a {
        white-space: nowrap;
        padding: 8px 14px;
        font-size: 12px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Auth */
    .login-container {
        flex-direction: column;
    }

    .login-left {
        display: none;
    }

    .login-right {
        padding: 24px;
    }

    /* Dashboard */
    .welcome-banner {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .welcome-stats {
        justify-content: center;
    }

    /* Catalog */
    .courses-list {
        grid-template-columns: 1fr;
    }

    .courses-grid {
        grid-template-columns: 1fr;
    }

    /* Footer */
    .footer-container {
        grid-template-columns: 1fr;
    }

    /* Editor */
    .editor-layout {
        flex-direction: column;
        height: auto;
    }

    .editor-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 250px;
    }

    /* Course View */
    .course-layout {
        flex-direction: column;
    }

    .course-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 300px;
    }

    .sidebar-header img {
        height: 120px;
    }

    .header-nav .nav-text {
        display: none;
    }

    .hero-content h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .admin-header-row {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}

/* ============================================================
   EXAM TAKING UI (curso.php — Student)
   ============================================================ */

/* Info bar */
.exam-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.exam-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.exam-info-item i {
    color: var(--primary);
}

.exam-info-item.info-success {
    color: var(--success);
}

.exam-info-item.info-success i {
    color: var(--success);
}

.exam-info-item.info-danger {
    color: var(--danger);
}

.exam-info-item.info-danger i {
    color: var(--danger);
}

/* Question cards */
.exam-question-card {
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.exam-question-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.exam-question-card.question-unanswered {
    border-color: var(--danger);
    background: #fef2f2;
    animation: shake .3s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.question-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.question-content {
    flex: 1;
}

.question-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Option labels — custom radios */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
}

.option-label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: var(--transition);
}

.option-label input[type="radio"]:checked~.option-radio {
    border-color: var(--primary);
}

.option-label input[type="radio"]:checked~.option-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.option-label input[type="radio"]:checked~.option-text {
    color: var(--primary);
    font-weight: 600;
}

.option-label:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}

.option-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.4;
}

/* Submit area */
.exam-submit-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    box-shadow: var(--shadow-sm);
}

.exam-submit-info {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.exam-submit-info i {
    color: var(--info);
}

.btn-submit-exam {
    font-size: 15px;
    padding: 12px 32px;
}

.btn-submit-exam:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Result cards */
.exam-result-card {
    text-align: center;
    padding: 40px 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.exam-result-card.result-approved {
    border-color: #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.exam-result-card.result-failed {
    border-color: #fecaca;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.result-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.result-approved .result-icon {
    color: var(--success);
}

.result-failed .result-icon {
    color: var(--danger);
}

.exam-result-card h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-approved h3 {
    color: var(--success-dark);
}

.result-failed h3 {
    color: #991b1b;
}

.exam-result-card p {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.result-date {
    font-size: 12px !important;
    color: var(--text-light) !important;
}

.result-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.score-number {
    font-size: 48px;
    font-weight: 800;
}

.result-approved .score-number {
    color: var(--success);
}

.result-failed .score-number {
    color: var(--danger);
}

.score-detail {
    font-size: 16px;
    color: var(--text-muted);
}

.result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

/* Responsive exam */
@media (max-width: 768px) {
    .exam-question-card {
        flex-direction: column;
        gap: 8px;
    }

    .question-number {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .exam-submit-area {
        flex-direction: column;
        gap: 12px;
    }

    .result-score {
        flex-direction: column;
        gap: 4px;
    }

    .result-actions {
        flex-direction: column;
    }

    .exam-info-bar {
        flex-direction: column;
        gap: 8px;
    }
}

/* ============================================================
   IMAGE UPLOAD AREA  
   ============================================================ */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .25s ease;
    background: var(--bg);
    position: relative;
}

.upload-area:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-area.upload-dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.upload-area-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.upload-icon {
    font-size: 40px;
    color: var(--primary);
    opacity: .6;
}

.upload-text {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.upload-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

.upload-hint {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
}

/* Preview */
.upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 120px;
}

.upload-preview img {
    max-height: 180px;
    max-width: 100%;
    border-radius: var(--radius-sm);
    object-fit: contain;
    box-shadow: var(--shadow);
}

.upload-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: 2px solid #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: transform .15s ease;
}

.upload-remove:hover {
    transform: scale(1.15);
}

/* ============================================================
   VIDEO INPUT ROWS  
   ============================================================ */
.video-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-input-row input[type="text"] {
    flex: 1;
}

.btn-upload-video {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--primary);
    transition: all .2s ease;
    flex-shrink: 0;
}

.btn-upload-video:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-add-video {
    background: var(--primary-light) !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    padding: 3px 10px !important;
    border-radius: 20px !important;
    transition: all .2s ease;
}

.btn-add-video:hover {
    background: var(--primary) !important;
    color: #fff !important;
}

/* ============================================================
   COURSE LANDING PAGE - VISTA PREVIA / INICIO DEL CURSO
   ============================================================ */
.course-landing {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.course-landing-header {
    text-align: center;
    margin-bottom: 30px;
}

.course-landing-header img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.course-landing-header h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 8px;
}

.course-landing-header p {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.course-info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.course-info-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.course-info-card i {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 8px;
}

.course-info-card .info-label {
    font-size: 12px;
    color: var(--text-light);
    display: block;
}

.course-info-card .info-value {
    font-size: 16px;
    font-weight: 700;
    display: block;
    margin-top: 2px;
}

.course-temario {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 30px;
}

.course-temario h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
}

.course-temario .temario-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-line;
}

.course-module-overview {
    margin-bottom: 30px;
}

.course-module-overview h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 16px;
}

.module-overview-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-overview-item .module-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.module-overview-item .module-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.module-overview-item .module-info span {
    font-size: 13px;
    color: var(--text-light);
}

/* Module Intro Content (student view) */
.module-intro-content {
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
}

.module-intro-content h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--primary);
}

/* Course landing button */
.course-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
    box-shadow: var(--shadow);
}

.course-start-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Additional videos section */
.additional-videos {
    margin-top: 24px;
}

.additional-videos h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px;
    color: var(--text);
}

.additional-video-item {
    margin-bottom: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.additional-video-item .video-label {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-light);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border);
}

/* ============================================================
   MATERIAL FILE ITEMS (Admin Editor)
   ============================================================ */
.material-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all .2s ease;
}

.material-file-item:hover {
    border-color: var(--primary);
    background: var(--bg);
}

.material-file-item.uploading {
    opacity: .6;
    pointer-events: none;
}

/* ============================================================
   MATERIAL FILES (Student View)
   ============================================================ */
.class-material-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.class-material-section h4 {
    font-size: 15px;
    color: var(--text);
    margin: 0 0 12px;
    font-weight: 600;
}

.material-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.material-download-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all .25s ease;
}

.material-download-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.material-download-card .mat-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.material-download-card .mat-icon.pdf {
    color: #e53e3e;
}

.material-download-card .mat-icon.ppt {
    color: #dd6b20;
}

.material-download-card .mat-info {
    flex: 1;
    min-width: 0;
}

.material-download-card .mat-info .mat-name {
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
    line-height: 1.3;
}

.material-download-card .mat-info .mat-type {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    margin-top: 2px;
}

.material-download-card .mat-download {
    color: var(--primary);
    font-size: 16px;
    flex-shrink: 0;
}

/* ============================================================
   PDF VIEWER MODAL
   ============================================================ */
.pdf-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.pdf-viewer-container {
    width: 90%;
    height: 90%;
    background: #fff;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transform: scale(0.95);
    animation: scaleIn 0.3s forwards;
}

.pdf-viewer-header {
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.pdf-viewer-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-viewer-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.pdf-viewer-btn:hover {
    background: var(--bg-input);
    color: var(--primary);
}

.pdf-viewer-close:hover {
    background: #fee2e2;
    color: #e53e3e;
}

.pdf-viewer-body {
    flex: 1;
    background: #525659;
    /* Color de fondo típico de visores PDF */
    position: relative;
    overflow: hidden;
}

.pdf-viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

/* Ajuste responsive para móviles */
@media (max-width: 768px) {
    .pdf-viewer-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }
}