@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --bg-card: #ffffff;
    
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --accent-dark: #0f172a;
    --accent-dark-hover: #020617;
    --accent-accent: #2563eb;

    --text-primary: #0f172a;
    --text-muted: #475569;
    --text-subtle: #64748b;

    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08);

    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* NAVBAR LUMINOSA & MINIMALISTA */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.brand-mark {
    width: 36px;
    height: 36px;
    background: var(--text-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.user-nav-profile {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-badge {
    border: 1px solid var(--border-color);
    padding: 0.45rem 0.95rem;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
}

.btn-logout {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.5rem 1.1rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn-logout:hover, .btn-logout:active {
    background: var(--text-primary);
    color: #ffffff;
    border-color: var(--text-primary);
}

/* LAYOUT CONTAINER LUMINOSO */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    width: 100%;
    flex: 1;
}

/* LOGIN & PRIMER ACCESO EN MODO CLARO */
.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2.25rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.auth-header h1 {
    font-size: 1.65rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-subtle);
    font-size: 0.92rem;
    font-weight: 400;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 1.35rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.45rem;
}

.form-input {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    color: var(--text-primary);
    font-size: 16px; /* Previene el zoom en móviles */
    outline: none;
    transition: var(--transition);
    min-height: 48px;
}

.form-input:focus {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.btn-primary {
    width: 100%;
    background: var(--text-primary);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover, .btn-primary:active {
    background: #020617;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.4;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* HERO DASHBOARD LUMINOSO */
.welcome-hero {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.welcome-hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.welcome-hero p {
    color: var(--text-subtle);
    font-size: clamp(0.95rem, 3.5vw, 1.05rem);
    max-width: 650px;
    line-height: 1.6;
}

.section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* TARJETAS DE CURSOS SIMPLIFICADAS Y LIMPIAS (SIN BANNERS NI FONDOS NEGROS) */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2rem;
}

.course-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    position: relative;
}

.course-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.course-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.course-body h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
    line-height: 1.3;
    color: var(--text-primary);
}

.course-body p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    flex: 1;
}

.course-meta {
    display: flex;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-subtle);
    margin-bottom: 1.5rem;
}

/* REPRODUCTOR AULA VIRTUAL (MODO CLARO) */
.player-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
}

.video-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.vimeo-responsive-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.vimeo-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-info-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.video-title {
    font-size: 1.45rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.video-desc {
    color: var(--text-muted);
    line-height: 1.65;
    font-size: 0.95rem;
}

/* LISTA DE LECCIONES AULA VIRTUAL (MODO CLARO) */
.lessons-sidebar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-md);
}

.sidebar-title {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.lessons-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
}

.lesson-item {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    min-height: 52px;
}

.lesson-item:hover, .lesson-item:active {
    border-color: var(--border-strong);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.lesson-item.active {
    border-color: var(--text-primary);
    background: var(--text-primary);
    color: #ffffff;
}

.lesson-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
}

.lesson-item.active .lesson-num {
    background: #ffffff;
    color: var(--text-primary);
    border-color: #ffffff;
}

.lesson-details h4 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    line-height: 1.35;
}

.lesson-item.active .lesson-details p {
    color: #cbd5e1;
}

.lesson-details p {
    font-size: 0.78rem;
    color: var(--text-subtle);
}

/* ADMIN PANEL LIGHT MODE */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
}

.stat-val {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.stat-lbl {
    font-size: 0.78rem;
    color: var(--text-subtle);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.users-table-box {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 500px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
    min-width: 600px;
}

th {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.status-pill {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

.status-active {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #15803d;
}

.status-pending {
    background: #fef3c7;
    border: 1px solid #fde047;
    color: #b45309;
}

/* MEDIA QUERIES RESPONSIVE */
@media (max-width: 1024px) {
    .player-container {
        grid-template-columns: 1fr;
    }
    .lessons-sidebar {
        max-height: none;
        position: static;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 0.9rem 1.25rem;
    }
    .brand-logo {
        font-size: 1.1rem;
    }
    .user-badge {
        max-width: 160px;
        font-size: 0.78rem;
    }
    .container {
        padding: 1.75rem 1rem;
    }
    .courses-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .course-card {
        padding: 1.5rem;
    }
    .auth-card {
        padding: 2.25rem 1.5rem;
    }
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    .table-header input {
        width: 100% !important;
    }
}

/* FOOTER */
.footer {
    border-top: 1px solid var(--border-color);
    background: #ffffff;
    padding: 2.25rem 1rem;
    text-align: center;
    color: var(--text-subtle);
    font-size: 0.85rem;
    margin-top: auto;
}
