/* Course-specific styles */
.course-sidebar {
  width: 320px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.course-header {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  padding: 1.5rem;
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.course-icon i {
  font-size: 2.5rem;
  color: #60a5fa;
}

.course-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.course-info p {
  opacity: 0.9;
  margin-bottom: 1rem;
}

.progress-bar {
  background: rgba(255, 255, 255, 0.2);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-fill {
  background: #60a5fa;
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.9rem;
  opacity: 0.9;
}

.lesson-list {
  padding: 1rem 0;
}

.lesson-category {
  margin-bottom: 1.5rem;
}

.lesson-category h4 {
  padding: 0.75rem 1.5rem;
  background: #f8fafc;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  border-bottom: 1px solid #e5e7eb;
}

.lesson-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lesson-link {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #6b7280;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}

.lesson-link:hover {
  background: #f3f4f6;
  color: #2563eb;
  border-left-color: #bfdbfe;
}

.lesson-link.active {
  background: #eff6ff;
  color: #2563eb;
  border-left-color: #2563eb;
  font-weight: 600;
}

.lesson-link.completed {
  color: #059669;
}

.lesson-link.completed::after {
  content: "✓";
  float: right;
  color: #059669;
  font-weight: bold;
}

/* Course Content */
.course-content {
  flex: 1;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 0;
  overflow: hidden;
}

.lesson-content {
  padding: 2rem;
}

.lesson-header {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.lesson-header h1 {
  font-size: 2.5rem;
  color: #1f2937;
  margin-bottom: 1rem;
  font-weight: 700;
}

.lesson-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.lesson-number {
  color: #6b7280;
  font-weight: 500;
}

.reading-time {
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lesson-body {
  line-height: 1.8;
  font-size: 1.1rem;
}

.content-section {
  margin-bottom: 3rem;
}

.content-section h2 {
  font-size: 1.8rem;
  color: #1f2937;
  margin-bottom: 1rem;
  font-weight: 600;
}

.content-section h3 {
  font-size: 1.4rem;
  color: #374151;
  margin: 1.5rem 0 1rem;
  font-weight: 600;
}

.content-section p {
  margin-bottom: 1rem;
  color: #4b5563;
}

/* Info Box */
.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.info-box i {
  color: #2563eb;
  font-size: 1.2rem;
  margin-top: 0.2rem;
}

.info-box strong {
  color: #1e40af;
  display: block;
  margin-bottom: 0.5rem;
}

/* Feature List */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: #374151;
}

.feature-list i {
  color: #059669;
  font-size: 0.9rem;
}

/* Code Examples */
.code-example {
  background: #1f2937;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.code-header {
  background: #374151;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
}

.copy-btn {
  background: #4b5563;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.3s ease;
}

.copy-btn:hover {
  background: #6b7280;
}

.code-example pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
  background: #1f2937;
}

.code-example code {
  color: #e5e7eb;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Explanation Box */
.explanation {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.explanation h4 {
  color: #374151;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.explanation ul {
  margin: 0;
  padding-left: 1.5rem;
}

.explanation li {
  margin-bottom: 0.5rem;
  color: #4b5563;
}

.explanation code {
  background: #e5e7eb;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9rem;
  color: #1f2937;
}

/* Interactive Editor */
.interactive-editor {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.editor-tabs {
  background: #f3f4f6;
  display: flex;
  border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background: white;
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
}

.editor-content {
  position: relative;
  height: 300px;
}

.tab-content {
  display: none;
  height: 100%;
}

.tab-content.active {
  display: block;
}

#htmlEditor {
  width: 100%;
  height: 100%;
  border: none;
  padding: 1rem;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  resize: none;
  outline: none;
  background: #1f2937;
  color: #e5e7eb;
}

#preview {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.run-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.3s ease;
  z-index: 10;
}

.run-btn:hover {
  background: #1d4ed8;
}

/* Quiz Styles */
.quiz-container {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.quiz-question h4 {
  color: #2d3748;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.quiz-options {
  margin-bottom: 1rem;
}

.quiz-options label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.quiz-options label:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

.quiz-options input[type="radio"] {
  margin: 0;
}

.quiz-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s ease;
}

.quiz-btn:hover {
  background: #1d4ed8;
}

.quiz-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 6px;
  font-weight: 500;
  display: none;
}

.quiz-result.correct {
  background: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
  display: block;
}

.quiz-result.incorrect {
  background: #fff5f5;
  color: #742a2a;
  border: 1px solid #feb2b2;
  display: block;
}

/* Lesson Footer */
.lesson-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.lesson-navigation {
  display: flex;
  gap: 1rem;
}

.nav-btn {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.nav-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
}

.lesson-actions {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  padding: 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.action-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

/* Responsive Design */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .course-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }

  .lesson-header h1 {
    font-size: 2rem;
  }

  .lesson-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .lesson-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .lesson-navigation {
    justify-content: space-between;
  }

  .lesson-actions {
    justify-content: center;
  }

  .editor-content {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .lesson-content {
    padding: 1rem;
  }

  .lesson-header h1 {
    font-size: 1.5rem;
  }

  .content-section h2 {
    font-size: 1.4rem;
  }

  .nav-btn,
  .action-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
}
