/**
 * Lesson View Styles - ChatGPT Dark Theme
 * Three-column layout: Sidebar | Content | Editor
 */

/* Lesson Panel Container */
.lesson-panel {
  flex: 1;
  display: none;
  overflow: hidden;
  background: #212121;
}

.lesson-panel.active {
  display: flex;
}

/* Override light theme when in lesson mode */
body:has(.lesson-panel.active) {
  background: #212121;
  color: #ececf1;
}

/* Simple two-panel layout: Content | Editor */
/* No middle sidebar - lessons are in main app sidebar */

#lessonMainContent {
  color: #ececf1;
  line-height: 1.7;
}

#lessonMainContent h2 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #ececf1;
}

#lessonMainContent h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: #ececf1;
}

#lessonMainContent p {
  margin-bottom: 16px;
  color: #c5c5d2;
  font-size: 15px;
}

#lessonMainContent pre {
  background: #000;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 16px 0;
}

#lessonMainContent code {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 14px;
  color: #e6e6e6;
}

.lesson-editor {
  flex: 1;
  background: #2f2f2f;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.lesson-editor.active {
  opacity: 1;
}

/* Sidebar Components */
.course-header {
  padding: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.back-to-chat-btn {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #ececf1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.back-to-chat-btn:hover {
  background: #2a2a2f;
}

.course-progress {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: #424242;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: #19c37d;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 12px;
  color: #8e8ea0;
  text-align: center;
}

/* Module List */
.modules-list {
  padding: var(--spacing-md);
}

.module-item {
  margin-bottom: var(--spacing-sm);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.module-header {
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #c5c5d2;
  cursor: pointer;
  transition: background 0.15s ease;
}

.module-header:hover {
  background: #2a2a2f;
}

.module-item.current .module-header {
  background: #343541;
  color: #ececf1;
  font-weight: 600;
}

.module-item.completed .module-header {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

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

/* Lessons List */
.lessons-list {
  padding: var(--spacing-sm) 0 var(--spacing-sm) var(--spacing-lg);
}

.lesson-item {
  padding: 6px 12px;
  font-size: 13px;
  color: #8e8ea0;
  margin-bottom: 2px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.lesson-item.current {
  background: #2a2a2f;
  color: #ececf1;
  font-weight: 600;
}

.lesson-item.completed {
  color: #19c37d;
}

.lesson-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Lesson Content Area */
.lesson-header h2 {
  font-size: 24px;
  color: #ececf1;
  margin-bottom: 8px;
  font-weight: 600;
}

.lesson-meta {
  font-size: 14px;
  color: #8e8ea0;
  margin-bottom: 24px;
}

.lesson-explanation {
  margin-bottom: 24px;
  line-height: 1.7;
  color: #ececf1;
}

.lesson-explanation p {
  margin-bottom: 16px;
}

.code-example {
  margin: 24px 0;
  padding: 16px;
  background: #000000;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

.example-label {
  font-size: 12px;
  color: #8e8ea0;
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-example pre {
  background: transparent;
  padding: 0;
  margin: 0;
  overflow-x: auto;
}

.code-example code {
  color: #d4d4d4;
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

/* Challenge Section */
.lesson-challenge {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-xl);
  background: var(--brand-light);
  border: 2px solid var(--brand-primary);
  border-radius: var(--radius-lg);
}

.lesson-challenge h3 {
  color: var(--brand-primary);
  margin-bottom: var(--spacing-md);
}

.start-challenge-btn {
  padding: 12px 24px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--spacing-md);
}

.start-challenge-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 163, 127, 0.3);
}

/* Knowledge Check */
.knowledge-check {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-xl);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.knowledge-check h3 {
  margin-bottom: var(--spacing-md);
}

.quiz-options {
  margin: var(--spacing-lg) 0;
}

.quiz-option {
  display: block;
  padding: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  background: white;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-option:hover {
  border-color: var(--brand-primary);
  background: var(--brand-light);
}

.quiz-option input[type="radio"] {
  margin-right: var(--spacing-md);
}

.check-answer-btn {
  padding: 10px 24px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
}

.check-answer-btn:hover {
  background: var(--brand-hover);
}

/* Lesson Complete */
.lesson-complete {
  margin: var(--spacing-xl) 0;
  padding: var(--spacing-2xl);
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: var(--radius-xl);
  text-align: center;
}

.celebration {
  margin-bottom: var(--spacing-xl);
}

.celebration-emoji {
  font-size: 64px;
  margin-bottom: var(--spacing-md);
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.celebration h2 {
  color: var(--brand-primary);
  margin-bottom: var(--spacing-sm);
}

.celebration-message {
  color: var(--text-primary);
  font-size: var(--font-lg);
}

.results-card {
  background: white;
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  margin: var(--spacing-xl) auto;
  max-width: 400px;
  text-align: left;
}

.score-breakdown {
  margin: var(--spacing-lg) 0;
}

.score-item {
  display: flex;
  justify-content: space-between;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

.score-item.final {
  border-bottom: none;
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 2px solid var(--brand-primary);
  font-weight: 600;
  font-size: var(--font-lg);
  color: var(--brand-primary);
}

.learning-summary {
  background: white;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  margin: var(--spacing-lg) auto;
  max-width: 400px;
  text-align: left;
}

.learning-summary ul {
  list-style: none;
  padding: 0;
}

.learning-summary li {
  padding: var(--spacing-sm) 0;
  color: #166534;
}

.progress-update {
  margin: var(--spacing-xl) 0;
}

.unlock-message {
  font-size: var(--font-lg);
  color: var(--brand-primary);
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.next-lesson-btn {
  padding: 16px 32px;
  background: var(--brand-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--font-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--spacing-lg);
}

.next-lesson-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(16, 163, 127, 0.4);
}

/* Editor Components */
.editor-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #2f2f2f;
}

.editor-header h3 {
  font-size: 16px;
  color: #ececf1;
  font-weight: 600;
}

.attempt-counter {
  font-size: 13px;
  color: #8e8ea0;
}

.editor-toolbar {
  padding: 12px 16px;
  background: #2f2f2f;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  gap: 8px;
  align-items: center;
}

.language-select {
  padding: 6px 12px;
  background: #424242;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: #ececf1;
  font-size: 14px;
  cursor: pointer;
  outline: none;
}

.language-select:hover {
  background: #4a4a4a;
}

/* Video Recommendations */
.video-recommendations {
  margin: 32px 0;
  padding: 24px;
  background: #2a2a2f;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
}

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

.video-card {
  background: #343438;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.2s ease;
  cursor: pointer;
}

.video-card:hover {
  border-color: #19c37d;
  background: #3a3a3f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(25, 195, 125, 0.15);
}

.video-card:active {
  transform: translateY(0);
}

/* Course Sidebar Highlights (Clean Rebuild) */
.active-course > div {
  background: rgba(25, 195, 125, 0.1) !important;
  border-color: rgba(25, 195, 125, 0.3) !important;
}

.lesson-item.current {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ececf1 !important;
  font-weight: 600;
}

.lesson-item.completed {
  color: #19c37d !important;
}

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

.sidebar-course-item:hover > div {
  background: rgba(255, 255, 255, 0.08) !important;
}

