/* ================================================================
   LMS TBLT — Main Design System Stylesheet
   A comprehensive, premium design system for Task-Based Language Teaching LMS
   ================================================================ */

/* ----------------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   ---------------------------------------------------------------- */
:root {
    /* Primary palette */
    --primary-50: #E3F2FD;
    --primary-100: #BBDEFB;
    --primary-200: #90CAF9;
    --primary-300: #64B5F6;
    --primary-400: #42A5F5;
    --primary-500: #1E88E5;
    --primary-600: #1565C0;
    --primary-700: #0D47A1;
    --primary-800: #0A3A8A;
    --primary-900: #072B6B;

    /* Neutrals */
    --white: #FFFFFF;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Semantic colours */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #06B6D4;
    --info-light: #CFFAFE;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* Typography */
    --font-body: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Transitions */
    --transition: all 0.2s ease;
}

/* ----------------------------------------------------------------
   2. RESET & BASE
   ---------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-700);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    font-family: var(--font-body);
}

::selection {
    background-color: var(--primary-100);
    color: var(--primary-900);
}

/* ----------------------------------------------------------------
   3. LAYOUT CLASSES
   ---------------------------------------------------------------- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.student-layout {
    min-height: 100vh;
    padding-top: 70px;
}

.main-content {
    flex: 1;
    padding: 30px;
    background: var(--gray-50);
    overflow-x: hidden;
    min-height: 100vh;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 1.75rem;
    color: var(--gray-900);
    font-family: var(--font-heading);
    font-weight: 700;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   4. BUTTONS
   ---------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    font-family: var(--font-body);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--primary-600);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background-color: var(--gray-300);
    color: var(--gray-800);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
}

.btn-success:hover {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #D97706;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary-500);
    color: var(--primary-600);
}

.btn-outline:hover {
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

/* ----------------------------------------------------------------
   5. CARDS
   ---------------------------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: var(--transition);
}

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

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    background-color: var(--gray-50);
}

/* ----------------------------------------------------------------
   6. FORMS
   ---------------------------------------------------------------- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-body);
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-800);
}

.form-control:focus {
    border-color: var(--primary-400);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.invalid-feedback {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-body);
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-800);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--primary-400);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    accent-color: var(--primary-600);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-text {
    font-size: 12px;
    color: var(--gray-400);
    margin-top: 4px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

/* ----------------------------------------------------------------
   7. TABLES
   ---------------------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

.table th {
    padding: 12px 16px;
    background-color: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    vertical-align: middle;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.table-hover tbody tr:hover {
    background-color: var(--primary-50);
}

/* ----------------------------------------------------------------
   8. ALERTS
   ---------------------------------------------------------------- */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.alert-success {
    background-color: var(--success-light);
    color: #065F46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400E;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: var(--info-light);
    color: #155E75;
    border-left: 4px solid var(--info);
}

/* ----------------------------------------------------------------
   9. BADGES
   ---------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary {
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.badge-success {
    background-color: var(--success-light);
    color: #065F46;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #92400E;
}

.badge-danger {
    background-color: var(--danger-light);
    color: #991B1B;
}

.badge-info {
    background-color: var(--info-light);
    color: #155E75;
}

/* ----------------------------------------------------------------
   10. STATS GRID (Dashboard)
   ---------------------------------------------------------------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue {
    background-color: var(--primary-50);
    color: var(--primary-600);
}

.stat-icon.green {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-icon.orange {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-icon.red {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ----------------------------------------------------------------
   11. STEP INDICATOR (Student Learning Journey)
   ---------------------------------------------------------------- */
.step-indicator {
    display: flex;
    align-items: center;
    overflow-x: auto;
    padding: 20px 0;
    margin-bottom: 30px;
    gap: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex-shrink: 0;
    min-width: 80px;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 18px;
    left: calc(50% + 20px);
    width: calc(100% - 40px);
    height: 3px;
    background-color: var(--gray-200);
    transition: var(--transition);
}

.step-item:last-child::after {
    display: none;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    border: 2.5px solid var(--gray-300);
    color: var(--gray-400);
    background: var(--white);
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.step-label {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 6px;
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
}

/* Active step */
.step-item.step-active .step-number {
    background-color: var(--primary-600);
    color: var(--white);
    border-color: var(--primary-600);
    box-shadow: 0 0 0 4px rgba(30, 136, 229, 0.2);
}

.step-item.step-active .step-label {
    color: var(--primary-600);
    font-weight: 600;
}

/* Completed step */
.step-item.step-completed .step-number {
    background-color: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.step-item.step-completed .step-label {
    color: var(--success);
}

.step-item.step-completed::after {
    background-color: var(--success);
}

/* ----------------------------------------------------------------
   12. MODULE CARDS (Student)
   ---------------------------------------------------------------- */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.module-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: inherit;
}

.module-card-header {
    height: 140px;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 3rem;
}

.module-card-body {
    padding: 20px;
}

.module-card .module-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-900);
}

.module-card .module-desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.module-card .module-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

/* ----------------------------------------------------------------
   13. GRID UTILITIES
   ---------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ----------------------------------------------------------------
   14. SPACING UTILITIES
   ---------------------------------------------------------------- */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 13px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary-600); }

.fw-bold { font-weight: 600; }
.fw-normal { font-weight: 400; }

.w-100 { width: 100%; }

/* ----------------------------------------------------------------
   15. MODAL
   ---------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--gray-100);
    color: var(--gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 18px;
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--gray-700);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ----------------------------------------------------------------
   16. RUBRIC / ASSESSMENT STYLES
   ---------------------------------------------------------------- */
.rubric-section {
    margin-bottom: 30px;
}

.rubric-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-700);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-100);
}

.rubric-criteria {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    margin-bottom: 12px;
    overflow: hidden;
}

.rubric-criteria-header {
    padding: 14px 18px;
    background-color: var(--gray-50);
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-700);
}

.rubric-options {
    padding: 12px 18px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.rubric-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    user-select: none;
}

.rubric-option:hover {
    border-color: var(--primary-300);
    background-color: var(--primary-50);
}

.rubric-option.selected {
    border-color: var(--primary-500);
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.rubric-option input[type="radio"] {
    accent-color: var(--primary-600);
}

.score-display {
    display: flex;
    gap: 20px;
    padding: 20px;
    background-color: var(--primary-50);
    border-radius: var(--radius-md);
    margin-top: 20px;
    flex-wrap: wrap;
}

.score-item {
    text-align: center;
    flex: 1;
    min-width: 100px;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-700);
    font-family: var(--font-heading);
}

.score-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.category-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

.category-excellent {
    background-color: #D1FAE5;
    color: #065F46;
}

.category-good {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.category-fair {
    background-color: #FEF3C7;
    color: #92400E;
}

.category-poor {
    background-color: #FEE2E2;
    color: #991B1B;
}

/* ----------------------------------------------------------------
   17. EMPTY STATE
   ---------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

.empty-state .btn {
    margin-top: 16px;
}

/* ----------------------------------------------------------------
   18. PAGINATION
   ---------------------------------------------------------------- */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 24px;
}

.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
}

.page-link:hover {
    background-color: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-600);
}

.page-link.active {
    background-color: var(--primary-600);
    color: var(--white);
    border-color: var(--primary-600);
}

.page-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ----------------------------------------------------------------
   19. LOGIN PAGE
   ---------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-500) 50%, var(--primary-300) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.5s ease;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-family: var(--font-heading);
    color: var(--primary-700);
    font-size: 1.5rem;
}

.login-logo p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-50);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: var(--primary-600);
}

.login-logo .logo-icon svg {
    width: 28px;
    height: 28px;
}

/* ----------------------------------------------------------------
   20. VOCABULARY CARD (Student)
   ---------------------------------------------------------------- */
.vocab-card {
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

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

.vocab-audio-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--primary-50);
    color: var(--primary-600);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.vocab-audio-btn:hover {
    background-color: var(--primary-600);
    color: var(--white);
}

.vocab-audio-btn.playing {
    background-color: var(--primary-600);
    color: var(--white);
    animation: pulse 1s infinite;
}

.vocab-word {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-900);
}

.vocab-definition {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.vocab-pronunciation {
    font-size: 13px;
    color: var(--primary-500);
    font-style: italic;
}

/* ----------------------------------------------------------------
   21. LEARNING CONTENT AREA (Student)
   ---------------------------------------------------------------- */
.learning-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.learning-content h2 {
    font-size: 1.3rem;
    color: var(--primary-700);
    margin-bottom: 16px;
}

.learning-content h3 {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: 12px;
}

.learning-content p {
    margin-bottom: 12px;
    line-height: 1.7;
}

.learning-content img {
    border-radius: var(--radius-md);
    margin: 16px 0;
    max-width: 100%;
}

.learning-content ul,
.learning-content ol {
    padding-left: 24px;
    margin-bottom: 12px;
    list-style: revert;
}

.learning-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.learning-content blockquote {
    border-left: 4px solid var(--primary-200);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--gray-50);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--gray-600);
    font-style: italic;
}

.learning-content pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.5;
}

.learning-content code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary-700);
}

.learning-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ----------------------------------------------------------------
   22. STUDENT PROFILE
   ---------------------------------------------------------------- */
.profile-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    border: 4px solid var(--primary-100);
}

.profile-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gray-900);
}

.profile-nim {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

.profile-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-100);
}

.profile-stat-item {
    text-align: center;
}

.profile-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-600);
    font-family: var(--font-heading);
}

.profile-stat-label {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* ----------------------------------------------------------------
   23. VIDEO EMBED
   ---------------------------------------------------------------- */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin: 16px 0;
    background: var(--gray-900);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ----------------------------------------------------------------
   24. STEP NAVIGATION BUTTONS
   ---------------------------------------------------------------- */
.step-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 12px;
}

.step-nav .btn {
    min-width: 140px;
    justify-content: center;
}

/* ----------------------------------------------------------------
   25. ANIMATIONS
   ---------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease;
}

.slide-up {
    animation: slideUp 0.4s ease;
}

.slide-in-left {
    animation: slideInLeft 0.4s ease;
}

/* ----------------------------------------------------------------
   26. RICH TEXT CONTENT RENDERING
   ---------------------------------------------------------------- */
.rich-content {
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--gray-800);
}

.rich-content h1 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    margin-top: 32px;
    color: var(--gray-900);
}

.rich-content h2 {
    font-size: 1.4rem;
    margin-bottom: 14px;
    margin-top: 28px;
    color: var(--gray-900);
}

.rich-content h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    margin-top: 24px;
    color: var(--gray-900);
}

.rich-content h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    margin-top: 20px;
    color: var(--gray-900);
}

.rich-content h5 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    margin-top: 16px;
}

.rich-content h6 {
    font-size: 0.85rem;
    margin-bottom: 8px;
    margin-top: 16px;
    color: var(--gray-600);
}

.rich-content p {
    margin-bottom: 14px;
    line-height: 1.7;
}

.rich-content ul,
.rich-content ol {
    padding-left: 28px;
    margin-bottom: 14px;
    list-style: revert;
}

.rich-content li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.rich-content blockquote {
    border-left: 4px solid var(--primary-200);
    padding: 14px 20px;
    margin: 16px 0;
    background: var(--gray-50);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--gray-600);
    font-style: italic;
}

.rich-content pre {
    background: var(--gray-800);
    color: var(--gray-100);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
}

.rich-content code {
    background: var(--gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--primary-700);
}

.rich-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.rich-content table th,
.rich-content table td {
    border: 1px solid var(--gray-200);
    padding: 10px 14px;
    text-align: left;
}

.rich-content table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.rich-content a {
    color: var(--primary-600);
    text-decoration: underline;
}

.rich-content a:hover {
    color: var(--primary-700);
}

.rich-content hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 24px 0;
}

/* ----------------------------------------------------------------
   27. PROGRESS BAR
   ---------------------------------------------------------------- */
.progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-500);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.progress-bar.green {
    background: var(--success);
}

.progress-bar.orange {
    background: var(--warning);
}

.progress-bar.red {
    background: var(--danger);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

/* ----------------------------------------------------------------
   28. LOADING SPINNER
   ---------------------------------------------------------------- */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

/* ----------------------------------------------------------------
   29. TABS
   ---------------------------------------------------------------- */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 24px;
    gap: 0;
    overflow-x: auto;
}

.tab-link {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: var(--font-body);
    text-decoration: none;
}

.tab-link:hover {
    color: var(--primary-600);
}

.tab-link.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ----------------------------------------------------------------
   30. BREADCRUMB
   ---------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary-600);
}

.breadcrumb .separator {
    color: var(--gray-300);
}

.breadcrumb .current {
    color: var(--gray-700);
    font-weight: 500;
}

/* ----------------------------------------------------------------
   31. TOOLTIP
   ---------------------------------------------------------------- */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 50;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

/* ----------------------------------------------------------------
   32. RESPONSIVE BREAKPOINTS
   ---------------------------------------------------------------- */
@media (max-width: 1024px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-layout .sidebar {
        transform: translateX(-100%);
    }

    .admin-layout .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .stat-card {
        padding: 16px 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .step-indicator {
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
        padding: 16px 0;
    }

    .rubric-options {
        flex-direction: column;
    }

    .score-display {
        flex-direction: column;
    }

    .login-card {
        margin: 20px;
        padding: 24px;
    }

    .table th,
    .table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .learning-content {
        padding: 20px;
    }

    .main-content {
        padding: 16px;
    }

    .content-wrapper {
        padding: 0;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .step-nav {
        flex-direction: column;
    }

    .step-nav .btn {
        min-width: auto;
    }

    .modal {
        width: 95%;
        margin: 20px;
    }

    .profile-stats {
        gap: 20px;
    }

    /* Profile card mobile fix */
    .profile-card .card-body {
        padding: 20px 16px;
        overflow: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .profile-avatar {
        width: 80px !important;
        height: 80px !important;
        font-size: 2rem !important;
    }

    .profile-name {
        font-size: 1.2rem;
        word-break: break-word;
    }

    .text-muted.text-small {
        font-size: 0.8rem;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    h1, .page-title {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 14px 16px;
    }

    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }

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

    .stat-card {
        padding: 12px 10px;
        flex-direction: column;
        text-align: center;
        gap: 6px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .main-content {
        padding: 12px;
    }

    .profile-avatar {
        width: 70px !important;
        height: 70px !important;
        font-size: 1.8rem !important;
    }

    .student-layout {
        padding-top: 60px;
    }
}

/* ----------------------------------------------------------------
   33. PRINT STYLES
   ---------------------------------------------------------------- */
@media print {
    .sidebar,
    .sidebar-toggle,
    .sidebar-overlay,
    .student-navbar,
    .btn,
    .step-nav,
    .alert {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
        color: black !important;
    }
}

/* ----------------------------------------------------------------
   34. SCROLLBAR CUSTOMIZATION
   ---------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ----------------------------------------------------------------
   35. FOCUS VISIBLE (Accessibility)
   ---------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--primary-400);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
}

/* ----------------------------------------------------------------
   36. STUDENT NAVBAR STYLES
   ---------------------------------------------------------------- */
.student-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 30px;
}

.navbar-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-700);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand span {
    color: var(--primary-400);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.navbar-link {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.navbar-link:hover {
    background: var(--primary-50);
    color: var(--primary-700);
}

.navbar-link.active {
    background: var(--primary-50);
    color: var(--primary-700);
    font-weight: 600;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    cursor: pointer;
}

.navbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.navbar-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.navbar-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    display: none;
    z-index: 200;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.navbar-dropdown.active {
    display: block;
}

.navbar-dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-600);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
}

.navbar-dropdown-link:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.navbar-dropdown-link.danger {
    color: var(--danger);
}

.navbar-dropdown-link.danger:hover {
    background: var(--danger-light);
}

.navbar-dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 4px 0;
}

.navbar-mobile-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--gray-700);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .student-navbar {
        padding: 0 16px;
    }

    .navbar-nav {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--gray-200);
        flex-direction: column;
        padding: 12px;
        box-shadow: var(--shadow-md);
    }

    .navbar-nav.active {
        display: flex;
    }

    .navbar-link {
        width: 100%;
        padding: 12px 16px;
    }

    .navbar-mobile-toggle {
        display: flex;
    }

    .navbar-user-name {
        display: none;
    }
}
