@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css');

:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --bg-dark: #090d16;
  --bg-card: #111827;
  --bg-card-hover: #1f293d;
  --bg-surface: #1e293b;
  --bg-glass: rgba(17, 24, 39, 0.75);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-cyan: #0ea5e9;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;

  --border-color: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  font-weight: 700;
}

/* Demo Role Bar */
.role-switcher-bar {
  background: linear-gradient(90deg, #1e1b4b, #31104b, #0f172a);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  font-size: 0.85rem;
}

.role-badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge.Student { background: rgba(14, 165, 233, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.role-badge.Instructor { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.4); }
.role-badge.Admin { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.4); }

/* Navigation */
.navbar-custom {
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  sticky: top;
  z-index: 1050;
  padding: 14px 0;
}

.brand-logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo .logo-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.search-input-group {
  position: relative;
  width: 360px;
}

.search-input-group input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: #fff;
  padding: 10px 18px 10px 42px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  width: 100%;
}

.search-input-group input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  outline: none;
}

.search-input-group .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Category Pill Badges */
.category-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  padding: 8px 18px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.category-pill:hover, .category-pill.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Hero Banner */
.hero-section {
  position: relative;
  padding: 70px 0;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.18) 0%, rgba(9, 13, 22, 1) 70%);
  border-bottom: 1px solid var(--border-color);
  overflow: hidden;
}

.hero-glow-1 {
  position: absolute;
  top: -100px;
  left: 10%;
  width: 400px;
  height: 400px;
  background: rgba(99, 102, 241, 0.25);
  filter: blur(120px);
  border-radius: 50%;
  pointer-events: none;
}

.hero-glow-2 {
  position: absolute;
  bottom: -100px;
  right: 10%;
  width: 450px;
  height: 450px;
  background: rgba(168, 85, 247, 0.2);
  filter: blur(140px);
  border-radius: 50%;
  pointer-events: none;
}

/* Cards */
.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-highlight);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4), 0 0 25px var(--primary-glow);
}

.course-card-img-wrapper {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

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

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

.badge-level {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
}

.badge-bestseller {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.course-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.course-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.instructor-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.instructor-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
}

.instructor-name {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rating-stars {
  color: #fbbf24;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rating-value {
  font-weight: 800;
  color: #fbbf24;
  margin-right: 4px;
}

.review-count {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.price-tag {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
}

.current-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}

.original-price {
  font-size: 0.9rem;
  color: var(--text-dim);
  text-decoration: line-through;
  margin-left: 6px;
}

/* Learning Video Player Portal */
.learn-container {
  display: flex;
  height: calc(100vh - 105px);
  overflow: hidden;
}

.learn-sidebar {
  width: 380px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.learn-sidebar-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.learn-sidebar-content {
  flex-grow: 1;
  overflow-y: auto;
}

.learn-main-stage {
  flex-grow: 1;
  background: #020617;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.video-player-container {
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
  max-height: 540px;
  position: relative;
}

.video-player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.accordion-item-dark {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
}

.accordion-header-dark {
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.92rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header-dark:hover {
  background: rgba(255, 255, 255, 0.05);
}

.lesson-item-row {
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 32px;
  gap: 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.lesson-item-row:hover {
  background: rgba(99, 102, 241, 0.08);
  color: #fff;
}

.lesson-item-row.active {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
  border-left: 3px solid var(--primary);
}

/* Interactive Quiz */
.quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.quiz-option-label {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Certificate Card */
.certificate-frame {
  background: linear-gradient(145deg, #111827, #1e1b4b);
  border: 4px double #d97706;
  border-radius: var(--radius-lg);
  padding: 50px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
  text-align: center;
}

/* Buttons */
.btn-primary-glow {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 30px;
  padding: 10px 24px;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: all 0.3s ease;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
  color: #fff;
}

.btn-outline-custom {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 30px;
  padding: 10px 22px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-custom:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: #fff;
}

/* Footer */
.footer-custom {
  background: #040711;
  border-top: 1px solid var(--border-color);
  padding: 60px 0 30px 0;
  color: var(--text-muted);
}

/* Responsive Media Queries */
@media (max-width: 991.98px) {
  .search-input-group {
    width: 100%;
  }

  .learn-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .learn-sidebar {
    width: 100%;
    order: 2;
    border-right: none;
    border-top: 1px solid var(--border-color);
    max-height: 400px;
  }

  .learn-main-stage {
    order: 1;
    width: 100%;
  }

  .certificate-frame {
    padding: 24px 16px;
  }

  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tabs .nav-link {
    font-size: 0.85rem;
    padding: 10px 14px !important;
  }
}

@media (max-width: 575.98px) {
  .hero-section {
    padding: 40px 0;
  }

  .display-6 {
    font-size: 1.65rem;
  }

  .display-5 {
    font-size: 1.85rem;
  }

  .category-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}