/* ==========================================================================
   DASHBOARD & CLASSROOM LAYOUT STYLES - 100% MOBILE OPTIMIZED
   ========================================================================== */

/* Hero Banner */
.hero-section {
  padding: 3.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: var(--accent-gradient);
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
}

.hero-content {
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border-glow);
  border-radius: 30px;
  color: var(--accent-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 2.8rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
}

/* Filter Controls */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.category-pills {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pill-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.pill-btn:hover, .pill-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
  box-shadow: var(--accent-glow);
}

.search-box {
  position: relative;
  min-width: 280px;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-main);
  font-size: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Course Grid & Cards */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.course-card:hover .card-thumb {
  transform: scale(1.06);
}

.card-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  color: var(--accent-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.card-body {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.card-description {
  color: var(--text-muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
  margin-top: auto;
}

.card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Progress bar inside card */
.card-progress-wrapper {
  margin-bottom: 1rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* CLASSROOM VIEW (Single Course Player Page) */
.classroom-container {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* Classroom Sidebar */
.classroom-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

.sidebar-course-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.sidebar-progress-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.chapter-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chapter-header {
  padding: 0.75rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.chapter-header:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-left: 0.5rem;
  margin-top: 0.5rem;
}

.lesson-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.lesson-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.lesson-item.active {
  background: rgba(99, 102, 241, 0.18);
  color: #ffffff;
  border-left: 3px solid var(--accent-primary);
  font-weight: 600;
}

.lesson-icon {
  font-size: 0.9rem;
}

.lesson-item.completed .lesson-icon {
  color: var(--success);
}

/* Classroom Main Content */
.classroom-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lesson-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.lesson-tabs-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.tab-content {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.tab-content.active {
  display: block;
}

/* Quiz Box */
.quiz-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.quiz-question {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.quiz-option-label {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.quiz-option-label:hover {
  background: rgba(255, 255, 255, 0.08);
}

.quiz-option-label.selected {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.15);
}

/* Instructor Studio (Admin Page) */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE BREAKPOINTS (100% Mobile Ready)
   ========================================================================== */

@media (max-width: 992px) {
  .classroom-container {
    grid-template-columns: 1fr;
  }

  .classroom-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2.2rem 1.25rem;
    border-radius: var(--radius-lg);
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
    min-width: unset;
  }

  .courses-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  #app-header {
    padding: 0.75rem 1rem;
  }

  .nav-container {
    gap: 0.5rem;
  }

  .brand-logo span {
    font-size: 1.1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }

  .admin-card {
    padding: 1.25rem;
  }

  /* Make forms stack vertically on small screens */
  .admin-card form div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .main-wrapper {
    padding: 1rem 0.85rem 3rem 0.85rem;
  }

  .modal-card {
    padding: 1.5rem 1.15rem;
    margin: 0 0.85rem;
  }

  .lesson-header-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
