/* ==========================================================================
   Basic Mechanical Engineering - Lecture Reader Styles (lecture.css)
   Detailed notes, formulas, teacher notes, practice questions
   Theme: Netflix Red & Dark Brown
   ========================================================================== */

.lecture-view {
  padding: 2.5rem 0 4rem;
}

.lecture-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 1024px) {
  .lecture-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

/* Sidebar Table of Contents */
.lecture-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .lecture-sidebar {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 1.5rem);
    height: fit-content;
    max-height: calc(100vh - var(--nav-height) - 3rem);
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
  }
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: block;
  line-height: 1.35;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.toc-link:hover, .toc-link.active {
  color: var(--primary-600);
  background: var(--primary-50);
}

body.dark-theme .toc-link:hover, 
[data-theme="dark"] .toc-link:hover,
body.dark-theme .toc-link.active,
[data-theme="dark"] .toc-link.active {
  background: rgba(229, 9, 20, 0.2);
  color: #ff4d52;
}

/* Lecture Header */
.lecture-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.lecture-main-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
  line-height: 1.25;
  color: var(--text-primary);
}

.lecture-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.meta-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.meta-badge.unit {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.meta-badge.co {
  background: var(--primary-50);
  color: var(--primary-600);
  border: 1px solid var(--primary-100);
}

body.dark-theme .meta-badge.co,
[data-theme="dark"] .meta-badge.co {
  background: rgba(229, 9, 20, 0.2);
  color: #ff4d52;
  border-color: rgba(229, 9, 20, 0.35);
}

.meta-badge.read-time {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.lecture-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.mark-completed-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  color: var(--text-primary);
}

.mark-completed-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  cursor: pointer;
}

.action-btns-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-icon-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--primary-600);
  border-color: var(--primary-600);
}

/* Teacher Mode Banner */
.teacher-mode-banner {
  display: none;
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.12), rgba(184, 29, 36, 0.08));
  border: 1px solid rgba(229, 9, 20, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

body.teacher-mode-active .teacher-mode-banner {
  display: block;
}

.teacher-banner-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ff4d52;
  margin-bottom: 0.75rem;
}

.teacher-notes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .teacher-notes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.teacher-note-box {
  background: var(--bg-surface);
  border: 1px solid rgba(229, 9, 20, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.teacher-note-box h6 {
  color: #ff4d52;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Key Takeaways Box */
.takeaways-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--primary-600);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: var(--glass-blur);
}

.takeaways-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary-600);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.takeaways-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.takeaways-list li {
  position: relative;
  padding-left: 1.4rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.takeaways-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-600);
  font-weight: 800;
}

/* Notes Content Typography */
.notes-content {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.notes-content h2 {
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.notes-content h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.notes-content ul, .notes-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.notes-content li {
  margin-bottom: 0.4rem;
}

/* Styled Responsive Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: left;
}

.styled-table th {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-medium);
  white-space: nowrap;
}

.styled-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

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

.styled-table tr:hover {
  background: var(--bg-subtle);
}

/* Formula Cheat Box */
.formula-cheat-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
  backdrop-filter: var(--glass-blur);
}

.formula-cheat-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-amber);
}

.formula-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

.formula-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.formula-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.formula-equation {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  overflow-x: auto;
  color: var(--text-primary);
}

.formula-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Viva Voce Questions Section */
.viva-section {
  margin: 2.5rem 0;
}

.viva-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-600);
}

.viva-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.viva-q {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  gap: 0.5rem;
}

.viva-q-tag {
  color: var(--primary-600);
  font-weight: 800;
}

.viva-a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 1.4rem;
  line-height: 1.5;
}

/* University Practice Questions Section */
.practice-section {
  margin: 3rem 0;
  padding-top: 2rem;
  border-top: 2px solid var(--border-subtle);
}

.practice-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.practice-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.practice-card:hover {
  border-color: var(--border-medium);
}

.practice-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.practice-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: rgba(229, 9, 20, 0.15);
  color: var(--primary-600);
  border-radius: var(--radius-sm);
}

.practice-univ-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.practice-question-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.practice-hint-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--accent-amber);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.solution-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.solution-toggle-btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-600);
}

body.dark-theme .solution-toggle-btn:hover,
[data-theme="dark"] .solution-toggle-btn:hover {
  background: rgba(229, 9, 20, 0.2);
}

.practice-solution-box {
  display: none;
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-medium);
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.practice-solution-box.open {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Next / Previous Lecture Navigation */
.lecture-nav-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

@media (min-width: 640px) {
  .lecture-nav-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.nav-direction-btn {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
  flex: 1;
}

.nav-direction-btn:hover {
  border-color: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.nav-direction-btn.prev {
  text-align: left;
}

.nav-direction-btn.next {
  text-align: right;
}

.nav-dir-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.nav-dir-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-600);
}
