/* ============================================
   Employee Onboarding - Nexus Learning Design
   Glassmorphism, Dark Theme, Mobile-First
   ============================================ */

/* CSS Variables */
:root {
  /* Colors */
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.2);
  --bg-deep: #0a0c10;
  --bg-card: #1e293b;
  --accent: #4f46e5;
  --accent-hover: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.4);
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.4);
  --warning: #f59e0b;
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.4);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-dim: #94a3b8;
  --text-muted: #64748b;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --sidebar-width: 280px;
  --header-height: 60px;
  --content-padding: 24px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Utility Classes */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Background Orb Effect */
.orb {
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(80px);
  z-index: -1;
  top: -200px;
  left: -200px;
  animation: drift 20s infinite alternate ease-in-out;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate(-20%, -20%) scale(1); }
  to { transform: translate(20%, 20%) scale(1.1); }
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  z-index: 1000;
}

.loading-content {
  text-align: center;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 24px auto;
  animation: spin 1s linear infinite;
}

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

.loading-content p {
  color: var(--text-dim);
  font-size: 14px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.brand-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-page {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  background: var(--glass);
  backdrop-filter: blur(40px) saturate(150%);
  -webkit-backdrop-filter: blur(40px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px var(--glass-highlight);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header .brand {
  justify-content: center;
  margin-bottom: 24px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  color: var(--text-dim);
  font-size: 14px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-link {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-link:hover {
  color: var(--accent);
}

.auth-card .language-toggle {
  margin-top: 24px;
  justify-content: center;
}

/* ============================================
   Form Elements
   ============================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.form-error {
  padding: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 13px;
}

.form-success {
  padding: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-sm);
  color: var(--success);
  font-size: 13px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-primary:disabled {
  background: #334155;
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.btn-full {
  width: 100%;
}

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

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn.pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); }
}

/* Language Toggle */
.language-toggle {
  display: flex;
  gap: 8px;
}

.lang-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--text-main);
}

.lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}


/* ============================================
   Main App Layout
   ============================================ */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--glass-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: capitalize;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 4px;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--glass-border);
  color: var(--text-main);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
}

.nav-section-title {
  display: block;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-logout {
  width: 100%;
  justify-content: flex-start;
  padding: 12px 16px;
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

/* Mobile Header */
.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: var(--header-height);
}

.menu-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.mobile-header .brand {
  font-size: 11px;
}

.mobile-user {
  width: 36px;
  height: 36px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

/* Main Content */
.content {
  flex: 1;
  padding: var(--content-padding);
  padding-top: calc(var(--header-height) + var(--content-padding));
  min-height: 100vh;
  overflow-y: auto;
}

/* ============================================
   Content Components
   ============================================ */

/* Page Header */
.page-header {
  margin-bottom: 32px;
}

.page-header .meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-dim);
  max-width: 600px;
}

/* Cards */
.card {
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--glass-highlight);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
}

.card-grid {
  display: grid;
  gap: 16px;
}

/* Progress Bar */
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width var(--transition-normal);
}

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

/* Stats */
.stat-value {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 13px;
  color: var(--text-dim);
}

/* Chapter List */
.chapter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.chapter-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--glass-highlight);
}

.chapter-item.active {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
}

.chapter-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.chapter-number {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.chapter-item.completed .chapter-number {
  background: var(--success);
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.chapter-meta {
  font-size: 12px;
  color: var(--text-dim);
}

.chapter-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.chapter-status.completed {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.chapter-status.in-progress {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent);
}


/* ============================================
   Video Player
   ============================================ */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.video-js {
  width: 100%;
  height: 100%;
}

.video-js .vjs-big-play-button {
  background: white;
  border: none;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  line-height: 80px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: transform var(--transition-fast);
}

.video-js .vjs-big-play-button:hover {
  transform: translate(-50%, -50%) scale(1.1);
}

.video-js .vjs-big-play-button .vjs-icon-placeholder:before {
  color: black;
}

.video-progress-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent);
  z-index: 10;
  transition: width 0.1s linear;
}

.video-quality-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 4px;
  z-index: 10;
}

/* ============================================
   Test/Quiz
   ============================================ */
.test-container {
  max-width: 700px;
}

.question-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

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

.question-number {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  text-transform: uppercase;
}

.question-progress {
  font-size: 13px;
  color: var(--text-dim);
}

.question-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  line-height: 1.5;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.option-item.selected {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
}

.option-item.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.option-item.incorrect {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.option-item.selected .option-radio {
  border-color: var(--accent);
}

.option-item.selected .option-radio::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
}

.option-text {
  flex: 1;
}

/* Test Results */
.test-results {
  text-align: center;
  padding: 40px;
}

.result-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.result-icon.passed {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.result-icon.failed {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.result-icon svg {
  width: 40px;
  height: 40px;
}

.result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.result-score {
  font-size: 48px;
  font-weight: 800;
  margin: 16px 0;
}

.result-score.passed {
  color: var(--success);
}

.result-score.failed {
  color: var(--error);
}

/* ============================================
   Documents
   ============================================ */
.documents-grid {
  display: grid;
  gap: 16px;
}

.document-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}

.document-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.document-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-dim);
}

.document-icon.uploaded {
  background: rgba(16, 185, 129, 0.2);
}

.document-icon.uploaded svg {
  color: var(--success);
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.document-status {
  font-size: 12px;
  color: var(--text-dim);
}

.document-status.uploaded {
  color: var(--success);
}

.document-actions {
  display: flex;
  gap: 8px;
}

/* File Upload */
.file-upload {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.file-upload:hover {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.05);
}

.file-upload.dragover {
  border-color: var(--accent);
  background: rgba(79, 70, 229, 0.1);
}

.file-upload input {
  display: none;
}

.file-upload-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--text-dim);
}

.file-upload-text {
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.file-upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--error);
}

.toast.warning {
  border-left: 3px solid var(--warning);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--success);
}

.toast.error .toast-icon {
  color: var(--error);
}

.toast-message {
  flex: 1;
  font-size: 14px;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}

/* ============================================
   Modal
   ============================================ */
.modal-container {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/* ============================================
   Action Bar
   ============================================ */
.action-bar {
  margin-top: 32px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.lock-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
}

.lock-hint svg {
  width: 16px;
  height: 16px;
}

.lock-hint.unlocked {
  color: var(--success);
}


/* ============================================
   Admin Styles
   ============================================ */

/* Sidebar Chapter Navigation */
#sidebar-chapters {
  padding: 0 12px;
}

#sidebar-chapters .nav-section-title {
  margin-top: 8px;
}

.chapter-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.chapter-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.chapter-nav-item.active {
  background: var(--glass-border);
  color: var(--text-main);
}

.chapter-nav-item.completed {
  color: var(--success);
}

.chapter-nav-item.in_progress {
  color: var(--accent);
}

.chapter-nav-number {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.chapter-nav-number.completed {
  background: var(--success);
  color: white;
}

.chapter-nav-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-nav-check {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex-shrink: 0;
}

/* User Profile Dropdown */
.user-info {
  position: relative;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  margin-top: 8px;
  z-index: 110;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
}

.user-info.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.user-dropdown-item svg {
  width: 16px;
  height: 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* ============================================
   Admin Panel Styles
   ============================================ */

/* Admin Page Header */
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-header-actions {
  display: flex;
  gap: 12px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 24px;
  overflow-x: auto;
}

.admin-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.admin-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.admin-tab.active {
  background: var(--accent);
  color: white;
}

/* Admin Search Bar */
.admin-search {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.admin-search-input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
}

.admin-search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-search-input::placeholder {
  color: var(--text-muted);
}

.admin-filter-select {
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  min-width: 150px;
}

.admin-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Admin Table */
.admin-table-wrapper {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid var(--glass-border);
}

.admin-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  background: rgba(0, 0, 0, 0.2);
}

.admin-table tbody tr {
  transition: background var(--transition-fast);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Table Actions */
.table-actions {
  display: flex;
  gap: 8px;
}

.table-action-btn {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.table-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--glass-highlight);
}

.table-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-color: var(--error);
}

.table-action-btn svg {
  width: 14px;
  height: 14px;
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.status-badge.inactive {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* Role Badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent);
}

.role-badge.super_admin {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.role-badge.admin {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

/* Admin Form */
.admin-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

@media (min-width: 768px) {
  .admin-form-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Question Card */
.question-card-admin {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.question-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.question-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.question-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-type-badge.multiple_choice {
  background: rgba(79, 70, 229, 0.2);
  color: var(--accent);
}

.question-type-badge.true_false {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.question-text-admin {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.question-options-admin {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-option-admin {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.question-option-admin.correct {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.question-option-admin .option-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.question-option-admin.correct .option-marker {
  background: var(--success);
  color: white;
}

/* Options Editor */
.options-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-editor-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.option-editor-item input[type="text"] {
  flex: 1;
}

.option-editor-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.option-remove-btn {
  padding: 8px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border-color: var(--error);
}

/* User Progress Detail */
.progress-detail-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

.progress-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.progress-detail-avatar {
  width: 56px;
  height: 56px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}

.progress-detail-info h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.progress-detail-info p {
  color: var(--text-dim);
  font-size: 14px;
}

.progress-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.progress-stat-item {
  text-align: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

.progress-stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.progress-stat-label {
  font-size: 12px;
  color: var(--text-dim);
}

/* Responsive Admin Table */
@media (max-width: 768px) {
  .admin-table-wrapper {
    overflow-x: auto;
  }
  
  .admin-table {
    min-width: 600px;
  }
  
  .admin-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-header-actions {
    justify-content: flex-end;
  }
}

/* ============================================
   Empty States
   ============================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  color: var(--text-muted);
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--text-dim);
  margin-bottom: 24px;
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (min-width: 768px) {
  :root {
    --content-padding: 32px;
  }
  
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .documents-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .page-header h1 {
    font-size: 40px;
  }
}

/* ============================================
   Responsive - Desktop
   ============================================ */
@media (min-width: 1024px) {
  :root {
    --content-padding: 48px;
  }
  
  /* Show sidebar on desktop */
  .sidebar {
    transform: translateX(0);
  }
  
  /* Hide mobile header on desktop */
  .mobile-header {
    display: none;
  }
  
  /* Adjust content for sidebar */
  .content {
    margin-left: var(--sidebar-width);
    padding-top: var(--content-padding);
  }
  
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .page-header h1 {
    font-size: 48px;
  }
  
  /* Toast position */
  .toast-container {
    bottom: 32px;
    right: 32px;
  }
}

/* ============================================
   Responsive - Large Desktop
   ============================================ */
@media (min-width: 1280px) {
  :root {
    --sidebar-width: 320px;
    --content-padding: 60px;
  }
  
  .card-grid.stats {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .sidebar,
  .mobile-header,
  .toast-container,
  .modal-container {
    display: none !important;
  }
  
  .content {
    margin-left: 0;
    padding: 20px;
  }
  
  body {
    background: white;
    color: black;
  }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}
