/* ==========================================================================
   LEARNER2DRIVER - VIDEO COURSE HUB & STUDENT LMS CSS
   Admin Academy Content & Fleet Hotspot Editor, Student Login Without PIN
   Restructured Admin Hub Layout & Tab Navigation Styles
   ========================================================================== */

.course-hero {
  text-align: center;
  padding: 3.5rem 0 2rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.course-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 3rem 0;
}

@media (min-width: 992px) {
  .course-layout {
    grid-template-columns: 340px 1fr;
  }
}

/* 1. ACTUAL STUDENT LOGIN PORTAL OVERLAY & MODAL BACKDROPS */
.student-portal-gate {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.student-portal-card {
  background: var(--bg-surface);
  border: 2px solid var(--color-green);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.portal-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  outline: none;
  transition: var(--transition-fast);
}

.portal-input:focus {
  border-color: var(--color-green);
  box-shadow: var(--shadow-glow);
}

/* 2. RESTRUCTURED UNIFIED ADMIN HUB (.admin-hub-container) */
.admin-hub-container {
  background: var(--bg-surface);
  border: 2px solid var(--color-green);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
}

.admin-hub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.admin-user-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background: rgba(46, 125, 50, 0.15);
  border: 1px solid var(--color-green);
  border-radius: var(--radius-full);
  color: var(--color-green);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ADMIN TAB NAVIGATION BAR */
.admin-nav-bar {
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.75rem;
}

.admin-tab-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-tab-btn {
  padding: 0.75rem 1.25rem;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition-fast);
  outline: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  min-height: 44px;
}

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

.admin-tab-btn.active {
  color: var(--color-green);
  border-bottom-color: var(--color-green);
  background: rgba(46, 125, 50, 0.08);
}

.admin-tab-btn:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: -2px;
}

.admin-tab-panel {
  animation: fadeInTab 0.3s ease forwards;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-tab-panel[hidden] {
  display: none !important;
}

/* 3. TRANSMISSION & ACCESS BADGES */
.badge-transmission-manual {
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

.badge-transmission-auto {
  background: rgba(124, 58, 237, 0.12);
  color: #7C3AED;
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.badge-transmission-all {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

/* 4. MODULE & LESSON EDITOR CARDS (.module-editor-card, .lesson-editor-table) */
.module-editor-card {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: var(--transition-fast);
}

.module-editor-card:hover {
  border-color: var(--color-green);
}

.module-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.lesson-editor-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

.lesson-editor-table th,
.lesson-editor-table td {
  padding: 0.75rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.lesson-editor-table th {
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-surface);
}

.insta-guide-box {
  background: rgba(46, 125, 50, 0.06);
  border: 1px solid var(--color-green);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

/* ADMIN ACADEMY CONTENT & FLEET HOTSPOT EDITOR PANEL (.admin-editor-panel) */
.admin-editor-panel {
  background: var(--bg-surface);
  border: 2px solid var(--color-green);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-md);
  text-align: left;
}

.admin-editor-section {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.editor-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

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

/* Curriculum Sidebar Tree */
.curriculum-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 90px;
}

.curriculum-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.module-group {
  margin-bottom: 1rem;
}

.module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.module-header:hover {
  border-color: var(--color-green);
}

.lesson-list {
  list-style: none;
  padding: 0.5rem 0 0.5rem 1.25rem;
  border-left: 2px solid var(--border-color);
  margin-left: 0.75rem;
}

.btn,
.review-filter-btn,
.danger-spot-btn,
.lesson-item {
  min-height: 44px;
}

.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.lesson-item:hover,
.lesson-item.active {
  background: rgba(46, 125, 50, 0.1);
  color: var(--text-main);
  font-weight: 600;
}

/* Syllabus Filter Segmented Toggle */
.syllabus-toggle-btn {
  padding: 0.35rem 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
  min-height: 32px;
}

.syllabus-toggle-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.syllabus-toggle-btn.active {
  background: var(--color-green);
  color: #FFFFFF;
  border-color: var(--color-green);
  box-shadow: var(--shadow-glow);
}

/* Track Matching & Highlighting */
.lesson-item.track-match-manual {
  border-left: 3px solid #2563EB;
  background: rgba(37, 99, 235, 0.05);
}

.lesson-item.track-match-auto {
  border-left: 3px solid #7C3AED;
  background: rgba(124, 58, 237, 0.05);
}

.lesson-item.track-universal {
  border-left: 3px solid #059669;
}

.lesson-item.track-off {
  opacity: 0.65;
  border-left: 3px solid var(--border-color);
}


/* Video Theater View */
.video-theater-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.video-frame-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.video-frame-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.lesson-content-panel {
  padding: 2rem;
}

.lesson-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

/* Student LMS Bar & Checkbox */
.student-lms-bar {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.complete-lesson-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  border: 2px solid var(--color-green);
  background: transparent;
  color: var(--color-green);
  transition: var(--transition-fast);
}

.complete-lesson-btn.completed {
  background: var(--color-green);
  color: #FFF;
}

/* Admin Student Progress Table */
.student-progress-table-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  overflow-x: auto;
}

.student-progress-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.student-progress-table th,
.student-progress-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
}

.student-progress-table th {
  font-weight: 700;
  color: var(--text-main);
  background: var(--bg-body);
}

/* Instructor Admin Toolbar */
.admin-toolbar {
  background: var(--bg-body);
  border: 2px solid var(--color-green);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ==========================================================================
   MOBILE RESPONSIVE OPTIMIZATIONS (course.html)
   ========================================================================== */
@media (max-width: 768px) {
  .course-hero {
    padding: 2rem 1rem 1.5rem;
  }

  .course-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem 0;
  }

  .course-layout > aside,
  .curriculum-sidebar {
    order: 1 !important;
    position: relative !important;
    top: 0 !important;
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .course-layout > main,
  .course-layout > #lmsMainCourseContainer,
  .video-theater-box {
    order: 2 !important;
    scroll-margin-top: 80px;
  }

  .curriculum-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .syllabus-toggle-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .syllabus-toggle-btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.45rem 0.2rem;
  }

  /* Admin Hub & Horizontal Tab ScrollBar on Mobile */
  .admin-hub-container,
  .admin-editor-panel,
  .student-progress-table-box {
    padding: 1rem !important;
    border-radius: var(--radius-md) !important;
  }

  .admin-tab-group {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
  }

  .admin-tab-btn {
    white-space: nowrap;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
  }

  .admin-hub-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  /* Video Theater & Lesson Content Panel on Mobile */
  .lesson-content-panel {
    padding: 1rem;
  }

  .lesson-title-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .student-lms-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .student-lms-bar .complete-lesson-btn {
    width: 100%;
    justify-content: center;
  }

  /* Student Portal Gate Modal on Mobile */
  .student-portal-card {
    padding: 1.5rem 1rem;
  }

  /* Responsive Tables */
  .lesson-editor-table,
  .student-progress-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
