/* Enhanced Code Coach — Modern Learning Platform */

:root {
  --bg: #0a0e14;
  --bg-alt: #0f1419;
  --panel: #151922;
  --panel-hover: #1a202c;
  --muted: #1e2328;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --text-muted: #6e7681;
  --brand: #4f96ff;
  --brand-2: #32d17a;
  --brand-3: #ff6b6b;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --border: #30363d;
  --border-light: #21262d;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.15);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.25);
  --gradient: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 18px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 12px var(--brand-2);
}

.tag {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
  background: var(--brand);
  color: #fff;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 150, 255, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--gradient);
  font-size: 16px;
  padding: 14px 28px;
  border-radius: var(--radius-lg);
}

.btn.secondary {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--panel-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.stat-chip {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

/* Landing Page */
.landing-section {
  padding: 40px 0;
}

.hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.2rem;
  color: var(--text-dim);
  margin-bottom: 32px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text);
}

.feature-card p {
  color: var(--text-dim);
  line-height: 1.6;
}

/* How It Works */
.how-it-works {
  text-align: center;
  padding: 40px 0;
}

.how-it-works h2 {
  font-size: 2.5rem;
  margin-bottom: 40px;
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  max-width: 1000px;
  margin: 0 auto;
}

.step {
  position: relative;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 auto 16px;
}

.step h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.step p {
  color: var(--text-dim);
}

/* Profile Form */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}

.onb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.onb-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.onb-avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
}

.onb-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onb-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.onb-email {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
}

.label {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.req {
  color: var(--danger);
}

.editor {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.editor:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79, 150, 255, 0.1);
}

.editor:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  min-height: 16px;
}

.editor.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

/* AI Assessment */
.assessment-desc {
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 24px;
}

.assessment-intro {
  text-align: center;
  padding: 32px;
}

.assessment-features {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.feature-item .feature-icon {
  font-size: 1.2rem;
}

.quiz-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 16px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.question-container {
  margin-bottom: 32px;
}

.question-container h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  background: var(--panel-hover);
  border-color: var(--brand);
}

.option-item.selected {
  background: rgba(79, 150, 255, 0.1);
  border-color: var(--brand);
}

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quiz-feedback {
  font-size: 14px;
  color: var(--text-dim);
}

.skills-results {
  padding: 24px;
  background: var(--muted);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

/* Dashboard */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.user-welcome h2 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.user-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-actions {
  display: flex;
  gap: 12px;
}

/* Learning Paths */
.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.path-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.path-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
}

.path-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.path-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.path-info h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
  color: var(--text);
}

.path-info p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.path-progress {
  margin-bottom: 16px;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 4px;
  display: block;
}

.path-subjects {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subject-chip {
  background: var(--muted);
  color: var(--text);
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Learning Area */
.learning-area {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}

.learning-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.current-lesson-info h3 {
  margin: 0;
  font-size: 1.25rem;
}

.current-lesson-info p {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.learning-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 600px;
}

.lessons-sidebar {
  border-right: 1px solid var(--border);
  padding: 24px;
  background: var(--bg-alt);
}

.lessons-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lesson-item:hover {
  background: var(--panel-hover);
  border-color: var(--brand);
}

.lesson-item.active {
  background: rgba(79, 150, 255, 0.1);
  border-color: var(--brand);
}

.lesson-item h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

.lesson-item p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.lesson-content {
  padding: 24px;
  overflow-y: auto;
}

.lesson-display {
  margin-bottom: 24px;
}

.lesson-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

.lesson-placeholder h4 {
  margin-bottom: 8px;
  color: var(--text);
}

/* Code Editor */
.code-editor-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.editor-title {
  font-weight: 600;
  color: var(--text);
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--text-dim);
}

.status.ok {
  background: rgba(40, 167, 69, 0.1);
  border-color: rgba(40, 167, 69, 0.3);
  color: var(--success);
}

.status.error {
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.3);
  color: var(--danger);
}

.code-editor {
  width: 100%;
  min-height: 300px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

.code-editor:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(79, 150, 255, 0.1);
}

.code-results {
  margin-top: 16px;
}

.code-output {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
}

/* Admin Console Styles */
.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--muted);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.admin-tabs {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tab-nav {
  display: flex;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--panel-hover);
  color: var(--text);
}

.tab-btn.active {
  background: var(--panel);
  color: var(--brand);
  border-bottom: 2px solid var(--brand);
}

.tab-content {
  padding: 24px;
  display: none;
}

.tab-content.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.search-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  color: var(--text);
  min-width: 300px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: var(--muted);
  font-weight: 600;
  color: var(--text);
}

.admin-table tr:hover {
  background: var(--panel-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.level-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
}

.assessment-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.assessment-status.completed {
  background: rgba(40, 167, 69, 0.2);
  color: var(--success);
}

.assessment-status.pending {
  background: rgba(255, 193, 7, 0.2);
  color: var(--warning);
}

.actions-cell {
  display: flex;
  gap: 4px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition: all 0.2s ease;
}

.btn-small.secondary {
  background: var(--muted);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-small.danger {
  background: var(--danger);
  color: #fff;
}

.loading, .no-data, .error {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-style: italic;
}

.error {
  color: var(--danger);
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 60px;
}

/* Utilities */
.hide {
  display: none !important;
}

.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; }

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-desc {
    font-size: 1.1rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .steps {
    grid-template-columns: 1fr;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .paths-grid {
    grid-template-columns: 1fr;
  }
  
  .learning-content {
    grid-template-columns: 1fr;
  }
  
  .lessons-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .container {
    padding: 0 16px;
  }
  
  .panel {
    padding: 20px;
  }
  
  .assessment-features {
    flex-direction: column;
    gap: 16px;
  }
  
  .admin-overview {
    grid-template-columns: 1fr;
  }
  
  .tab-nav {
    flex-direction: column;
  }
  
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-controls {
    flex-direction: column;
  }
  
  .search-input {
    min-width: auto;
  }
}
/* Enhanced Learning Page Styles */
.learning-progress-header {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}

.progress-stats {
  display: flex;
  align-items: center;
  gap: 32px;
}

.progress-circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) 0deg, var(--muted) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-circle::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--panel);
}

.progress-text {
  position: relative;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand);
}

.track-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}

.stat-item {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.stat-item strong {
  color: var(--text);
}

/* Learning Sections */
.learning-sections {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.learning-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
}

.learning-section.locked {
  opacity: 0.6;
  pointer-events: none;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.section-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.section-info {
  flex: 1;
}

.section-info h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--text);
}

.section-info p {
  margin: 0 0 12px;
  color: var(--text-dim);
}

.section-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-points {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(79, 150, 255, 0.1);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(79, 150, 255, 0.2);
}

/* Lessons List */
.lessons-list {
  padding: 0;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.lesson-item:last-child {
  border-bottom: none;
}

.lesson-item:hover:not(.locked) {
  background: var(--panel-hover);
}

.lesson-item.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.lesson-item.completed {
  background: rgba(40, 167, 69, 0.05);
  border-left: 4px solid var(--success);
}

.lesson-item.project-lesson {
  background: var(--bg-alt);
  border-left: 4px solid var(--brand);
}

.lesson-icon {
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--muted);
  border-radius: 12px;
  flex-shrink: 0;
}

.lesson-content {
  flex: 1;
}

.lesson-content h4 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: var(--text);
}

.lesson-content p {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.lesson-meta {
  display: flex;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lesson-time::before {
  content: '⏱ ';
}

.lesson-points {
  color: var(--brand);
  font-weight: 600;
}

.lesson-status {
  flex-shrink: 0;
}

.status-icon {
  font-size: 1.2rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--muted);
  color: var(--text-dim);
}

/* Lesson Modal */
.lesson-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.lesson-modal-content {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1400px;
  height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lesson-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.lesson-modal-header h3 {
  margin: 0;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.modal-close:hover {
  background: var(--panel-hover);
}

.lesson-modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

.lesson-content-area {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

.lesson-instructions {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.lesson-instructions h2 {
  color: var(--text);
  margin-top: 0;
}

.lesson-instructions h3 {
  color: var(--brand);
  margin: 24px 0 12px;
}

.lesson-instructions pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
}

.instruction-box {
  background: rgba(79, 150, 255, 0.1);
  border: 1px solid rgba(79, 150, 255, 0.2);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.instruction-box h4 {
  margin: 0 0 8px;
  color: var(--brand);
}

.lesson-editor {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 300px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.lesson-preview {
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--muted);
  border-bottom: 1px solid var(--border);
}

.preview-frame {
  flex: 1;
  border: none;
  background: white;
}

.lesson-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

/* Points Animation */
@keyframes pointsEarn {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translateY(-20px) scale(1.2);
    opacity: 1;
  }
  100% {
    transform: translateY(-40px) scale(1);
    opacity: 0;
  }
}

.points-animation {
  animation: pointsEarn 1s ease-out forwards;
  position: absolute;
  color: var(--brand);
  font-weight: 700;
  pointer-events: none;
  z-index: 1000;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .lesson-modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1fr;
  }
  
  .lesson-content-area {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 768px) {
  .progress-stats {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  
  .track-stats {
    justify-content: center;
  }
  
  .section-header {
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .lesson-item {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .lesson-modal {
    padding: 10px;
  }
  
  .lesson-modal-content {
    height: 95vh;
  }
}
/* Toast Notifications (non-blocking UI feedback) */
#toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: toastIn .18s ease-out forwards;
}

.toast .toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toast .toast-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.toast .toast-msg {
  font-size: 0.88rem;
  color: var(--text-dim);
}

.toast .toast-close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 6px;
}
.toast .toast-close:hover {
  background: var(--panel-hover);
}

.toast-success { border-color: rgba(50, 209, 122, 0.45); }
.toast-error   { border-color: rgba(220, 53, 69, 0.45); }
.toast-info    { border-color: rgba(79, 150, 255, 0.45); }

@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
/* Access Denied styling for Admin Console */
.access-denied {
  max-width: 640px;
  margin: 60px auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  box-shadow: var(--shadow);
}

.access-icon {
  font-size: 3rem;
  display: inline-block;
  margin-bottom: 12px;
}

.access-denied h3 {
  margin: 8px 0 6px;
  font-size: 1.5rem;
  color: var(--text);
}

.access-denied p {
  color: var(--text-dim);
}