/**
 * Centralized CSS for top-level pages: Home (index), Discover, Login.
 * Reduces repetition and keeps hero, search, categories, CTA consistent.
 */

/* ---------------------------------------------------------------------------
   Landing page variables (apply when this file is loaded)
   --------------------------------------------------------------------------- */
:root {
  --landing-primary: #ff6b6b;
  --landing-secondary: #4ecdc4;
  --landing-accent: #ffe66d;
  --landing-dark: #292f36;
  --landing-text: #333;
  --landing-text-muted: #666;
  --landing-text-secondary: #4a5568;
  --landing-text-tertiary: #5f6b7a;
  --landing-font-heading: "Baloo 2", cursive;
  --landing-font-body: "Inter", "Nunito", sans-serif;
  --landing-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  --landing-radius: 20px;

  /* Spacing scale for consistency */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
  --spacing-4xl: 5rem;

  /* Transition durations */
  --transition-fast: 0.2s;
  --transition-normal: 0.3s;
  --transition-slow: 0.4s;
}

/* Override base vars for landing pages so .highlight, .btn-primary etc. match */
.page-landing {
  --primary-color: var(--landing-primary);
  --secondary-color: var(--landing-secondary);
  --accent-color: var(--landing-accent);
  --dark-color: var(--landing-dark);
  --text-color: var(--landing-text);
  --font-heading: var(--landing-font-heading);
  --font-body: var(--landing-font-body);
  --shadow: var(--landing-shadow);
  --radius: var(--landing-radius);
}

/* ---------------------------------------------------------------------------
   Page layout: full-width sections, no extra main padding
   --------------------------------------------------------------------------- */
.page-landing .wrapper {
  padding: 0 !important;
  margin: 0 !important;
}

.page-landing main {
  padding: 0;
}

.page-landing section {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Ensure containers use Bootstrap's responsive widths, not legacy 600px */
.page-landing .container {
  max-width: 1140px !important;
  width: 100% !important;
  background-color: transparent !important;
  border-radius: 0 !important;
}

@media (min-width: 1200px) {
  .page-landing .container {
    max-width: 1320px !important;
  }
}

@media (max-width: 992px) {
  .page-landing .container {
    max-width: 960px !important;
  }
}

@media (max-width: 768px) {
  .page-landing .container {
    max-width: 720px !important;
  }
}

@media (max-width: 576px) {
  .page-landing .container {
    max-width: 100% !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Typography and base styles for landing pages */
.page-landing {
  font-family: var(--landing-font-body);
  font-size: 1rem;
  line-height: 1.6;
  /* Light mode background - warm gradient */
  background: linear-gradient(180deg, #fefefe 0%, #f8fafc 50%, #f0f4f8 100%) !important;
  background-attachment: fixed;
  min-height: 100vh;
}

/* Ensure body has light background in light mode */
body.bg-svg.page-landing:not(.dark-mode) {
  background: linear-gradient(135deg, #fef9f3 0%, #e8f4f8 50%, #f0f9fc 100%) !important;
  background-attachment: fixed;
}

/* Light mode section backgrounds */
.page-landing .bg-white,
.page-landing section.bg-white {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%) !important;
}

.page-landing .container-fluid.bg-white {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
}

/* Category button styles for Explore Categories section */
.page-landing .category-btn {
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  border-width: 2px;
}

.page-landing .category-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.page-landing .btn-outline-primary.category-btn {
  color: #4a5568;
  border-color: #e2e8f0;
  background: white;
}

.page-landing .btn-outline-primary.category-btn:hover {
  color: white;
  background: linear-gradient(135deg, var(--landing-primary) 0%, #ff5252 100%);
  border-color: var(--landing-primary);
}

.page-landing .hero h1,
.page-landing .hero .hero-text p,
.page-landing .search-section h2,
.page-landing section h1,
.page-landing section h2,
.page-landing .card-title,
.page-landing .stat-label {
  font-family: var(--landing-font-heading);
  font-weight: 700;
}

.page-landing .hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
}

.page-landing .hero .hero-text p {
  font-family: var(--landing-font-body);
  font-weight: 400;
  font-size: 1.15rem;
}

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.page-landing .hero,
.hero {
  background: linear-gradient(135deg, #fff5f5 0%, #f0f9ff 50%, #f0fdf4 100%);
  padding-top: 80px;
  position: relative;
  overflow: hidden;
  padding-bottom: 140px;
  margin-top: 0;
  /* CSS Containment for performance */
  contain: layout style paint;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 40px;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  padding-right: clamp(1rem, 5vw, 3.125rem);
}

.badge {
  background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
  color: #00695c;
  padding: 8px 20px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0, 150, 136, 0.15);
}

.hero h1 {
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--landing-dark, #292f36);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.hero h1 .highlight,
.highlight {
  color: var(--landing-primary, #ff6b6b);
  position: relative;
}

.hero p {
  font-size: 1.25rem;
  color: #4a5568;
  margin-bottom: 32px;
  max-width: 540px;
  line-height: 1.7;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  padding: 14px 32px;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.hero-buttons .btn-primary {
  background: linear-gradient(135deg, var(--landing-primary, #ff6b6b) 0%, #ff5252 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.hero-buttons .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.hero-buttons .btn-secondary {
  background: white;
  border: 2px solid #e2e8f0;
  color: var(--landing-dark, #292f36);
}

.hero-buttons .btn-secondary:hover {
  background: #f8fafc;
  border-color: var(--landing-secondary, #4ecdc4);
  color: var(--landing-secondary, #4ecdc4);
}

.stats {
  display: flex;
  gap: 2.5rem;
  padding: 1.5rem 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-number {
  font-family: var(--landing-font-heading, var(--font-heading));
  font-size: 2rem;
  font-weight: 800;
  color: var(--landing-dark, #292f36);
  line-height: 1;
}

.stat-label {
  font-size: 0.95rem;
  color: #64748b;
  font-weight: 500;
  margin-top: 4px;
}

.hero-image {
  flex: 1;
  position: relative;
}

.hero-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  border-radius: var(--landing-radius, var(--radius));
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.1));
}

.floating-image {
  animation: landing-float 6s ease-in-out infinite;
}

@keyframes landing-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

.float-element {
  position: absolute;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border-radius: 50%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-size: 2rem;
  animation: landing-float 4s ease-in-out infinite;
  transition: transform 0.3s ease;
  border: 3px solid white;
}

.float-element:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.float-1 {
  top: 10%;
  right: 15%;
  background: linear-gradient(135deg, #ffe5e5 0%, var(--landing-primary) 100%);
}

.float-1 i {
  color: var(--landing-primary);
}

.float-2 {
  bottom: 25%;
  right: 5%;
  animation-delay: 1.5s;
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #e0f7fa 0%, var(--landing-secondary) 100%);
}

.float-2 i {
  color: var(--landing-secondary);
}

.float-3 {
  top: 45%;
  right: 25%;
  animation-delay: 3s;
  width: 65px;
  height: 65px;
  background: linear-gradient(135deg, #fff9c4 0%, var(--landing-accent) 100%);
}

.float-3 i {
  color: #fbc02d;
}

.wave-bottom {
  position: absolute;
  bottom: -40px;
  left: 0;
  width: 100%;
  line-height: 0;
  z-index: 1;
}

/* ---------------------------------------------------------------------------
   Buttons & highlight (landing style)
   --------------------------------------------------------------------------- */
.page-landing .btn,
.hero .btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  border: none;
  font-family: var(--landing-font-heading);
  font-size: 1.1rem;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
  transition: transform var(--transition-normal) ease,
    box-shadow var(--transition-normal) ease,
    background-color var(--transition-normal) ease;
}

.page-landing .btn:hover,
.hero .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.page-landing .btn:focus-visible,
.hero .btn:focus-visible {
  outline: 2px solid var(--landing-primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
}

.page-landing .btn-primary,
.hero .btn-primary {
  background-color: var(--landing-primary);
  color: white;
}

.page-landing .btn-secondary,
.hero .btn-secondary {
  background-color: white;
  color: var(--landing-primary);
  border: 2px solid var(--landing-primary);
}

.page-landing .btn-white,
.hero .btn-white {
  background-color: white;
  color: var(--landing-primary);
}

.page-landing .btn-outline,
.hero .btn-outline {
  border: 2px solid var(--landing-secondary);
  color: var(--landing-secondary);
  background: transparent;
  padding: 8px 20px;
  font-size: 0.9rem;
}

.page-landing .btn-outline:hover,
.hero .btn-outline:hover {
  background: var(--landing-secondary);
  color: white;
}

.page-landing .highlight,
.highlight {
  color: var(--landing-primary);
  position: relative;
  display: inline-block;
}

.page-landing .highlight::after,
.highlight::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: var(--landing-accent);
  z-index: -1;
  opacity: 0.6;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------------
   Search section
   --------------------------------------------------------------------------- */
.search-section {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 60px 0 80px;
  position: relative;
  /* CSS Containment for performance */
  contain: layout style;
}

.search-form {
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.search-cluster {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  padding: 24px 28px 20px;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.search-bar-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-input-wrapper-large {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 8px;
  margin-bottom: 0;
  position: relative;
  min-height: auto;
  border: 2px solid #e2e8f0;
  transition: box-shadow var(--transition-normal) ease,
    border-color var(--transition-normal) ease;
  width: 100%;
}

.search-input-wrapper-large:focus-within {
  border-color: rgba(255, 107, 107, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
}

.search-icon-large {
  position: absolute;
  left: 24px;
  color: #94a3b8;
  font-size: 1.5rem;
  z-index: 2;
  pointer-events: none;
}

.search-input-large {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 24px 24px 24px 64px;
  font-size: 1.25rem;
  font-family: var(--landing-font-body);
  border-radius: 60px;
  font-weight: 500;
  min-height: 72px;
  width: 100%;
}

.search-input-large::placeholder {
  color: #94a3b8;
  font-size: 1.5rem;
}

.search-btn-large {
  padding: 28px 56px;
  font-size: 1.35rem;
  white-space: nowrap;
  font-weight: 700;
  border-radius: 60px;
  margin-left: 12px;
  min-height: 80px;
  background: linear-gradient(135deg, var(--landing-primary) 0%, #ff5252 100%);
  border: none;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.35);
  transition: all var(--transition-normal) ease;
}

.search-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.45);
}

.search-btn-large:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 8px 24px rgba(255, 107, 107, 0.45);
}

.filters-group {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid #e2e8f0;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-md);
}

.filter-select {
  padding: 12px 18px;
  border-radius: 20px;
  border: 1.5px solid #e0e0e0;
  background: white;
  font-family: var(--landing-font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--landing-text);
  cursor: pointer;
  transition: all var(--transition-normal) ease;
  width: 100%;
}

.filter-select:hover {
  border-color: var(--landing-primary);
  background: #fff5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.filter-select:focus {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
  border-color: var(--landing-primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.filter-select:focus-visible {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.15);
}

.advanced-toggle-wrapper {
  text-align: center;
  margin-top: var(--spacing-md);
}

.advanced-toggle-btn {
  color: var(--landing-text-muted, #666);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all var(--transition-normal) ease;
}

.advanced-toggle-btn:focus-visible {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

.advanced-toggle-btn:hover {
  color: var(--landing-primary);
  background: #fff5f5;
  text-decoration: none;
}

.advanced-toggle-btn i {
  margin-right: 6px;
}

/* ---------------------------------------------------------------------------
   Section header & category grid
   --------------------------------------------------------------------------- */
.section-header {
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header p {
  font-size: 1.0625rem;
  color: var(--landing-text-secondary, #4a5568);
  /* Improved contrast from #5f6b7a for better readability */
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  /* CSS Containment for performance */
  contain: layout;
}

.category-card,
.category-card-colorful {
  display: block;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: transform var(--transition-normal) cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow var(--transition-normal) ease,
    border-color var(--transition-fast) ease;
  position: relative;
  overflow: hidden;
  min-height: 160px;
}

.category-card::before,
.category-card-colorful::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  border-radius: 16px 16px 0 0;
  transition: height var(--transition-fast) ease;
}

.category-card:hover,
.category-card-colorful:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.08);
}

.category-card:focus-visible,
.category-card-colorful:focus-visible {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
}

.color-1.category-card-colorful::before,
.color-1.category-card::before {
  background: #e85d5d;
}

.color-2.category-card-colorful::before,
.color-2.category-card::before {
  background: #3dbdb5;
}

.color-3.category-card-colorful::before,
.color-3.category-card::before {
  background: #e6c93d;
}

.color-4.category-card-colorful::before,
.color-4.category-card::before {
  background: #e08a1a;
}

.color-5.category-card-colorful::before,
.color-5.category-card::before {
  background: #28a99e;
}

.color-6.category-card-colorful::before,
.color-6.category-card::before {
  background: #c41830;
}

.color-7.category-card-colorful::before,
.color-7.category-card::before {
  background: #5f0799;
}

.color-8.category-card-colorful::before,
.color-8.category-card::before {
  background: #2563eb;
}

.category-card-colorful:hover::before,
.category-card:hover::before {
  height: 6px;
}

.category-card .icon-wrapper,
.category-card-colorful .icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 1rem;
  transition: transform var(--transition-fast) ease;
}

.category-card:hover .icon-wrapper,
.category-card-colorful:hover .icon-wrapper {
  transform: scale(1.08);
}

.category-card h3,
.category-card-colorful h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #1a1d21;
  line-height: 1.3;
}

.category-card p,
.category-card-colorful p {
  font-size: 0.875rem;
  color: var(--landing-text-tertiary, #5f6b7a);
  margin: 0;
  line-height: 1.4;
}

.category-card-colorful .card-cta,
.category-card .card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: inherit;
  margin-top: 0.75rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast) ease,
    gap var(--transition-fast) ease;
}

.category-card-colorful:hover .card-cta,
.category-card:hover .card-cta {
  opacity: 1;
  gap: 0.5rem;
}

.color-1 .icon-wrapper {
  background: #fef2f2;
  color: #dc2626;
}

.color-2 .icon-wrapper {
  background: #ecfeff;
  color: #0d9488;
}

.color-3 .icon-wrapper {
  background: #fefce8;
  color: #ca8a04;
}

.color-4 .icon-wrapper {
  background: #fff7ed;
  color: #c2410c;
}

.color-5 .icon-wrapper {
  background: #f0fdfa;
  color: #0f766e;
}

.color-6 .icon-wrapper {
  background: #fef2f2;
  color: #b91c1c;
}

.color-7 .icon-wrapper {
  background: #faf5ff;
  color: #7e22ce;
}

.color-8 .icon-wrapper {
  background: #eff6ff;
  color: #2563eb;
}

/* ---------------------------------------------------------------------------
   Teachers section
   --------------------------------------------------------------------------- */
.teachers {
  padding: 80px 0;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}

.teacher-card {
  background: white;
  border-radius: var(--landing-radius, 20px);
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-slow) cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow var(--transition-slow) ease;
}

.teacher-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.teacher-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.teacher-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow) ease;
}

.teacher-card:hover .teacher-img {
  transform: scale(1.1);
}

.teacher-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--landing-primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.teacher-info {
  padding: 20px;
  text-align: center;
}

.teacher-info h3 {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.teacher-info .subject {
  color: var(--landing-primary);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.teacher-info .bio {
  font-size: 0.9rem;
  color: var(--landing-text-muted, #666);
  margin-bottom: 15px;
  line-height: 1.4;
}

.tags {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tags span {
  background: #e5e7eb;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  color: #374151;
  /* Improved contrast from #555 on darker background */
}

/* ---------------------------------------------------------------------------
   Features section
   --------------------------------------------------------------------------- */
.features {
  padding: 80px 0;
  background: linear-gradient(180deg, #ffffff 0%, #fefefe 100%);
}

.feature-list {
  list-style: none;
  margin-top: 30px;
}

.feature-list li {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.feature-icon-small {
  width: 50px;
  height: 50px;
  background: #fff0f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--landing-primary);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.feature-text h4 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.feature-text p {
  font-size: 0.95rem;
  color: var(--landing-text-muted, #666);
}

/* ---------------------------------------------------------------------------
   CTA section
   --------------------------------------------------------------------------- */
.cta {
  padding: 80px 24px 100px;
  background: linear-gradient(135deg, var(--landing-primary) 0%, #ff8e8e 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

.cta .container {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cta-box {
  text-align: center;
  max-width: 640px;
  padding: 48px 40px 56px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.cta-title,
.cta h2 {
  color: var(--landing-dark);
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.cta-subtitle,
.cta p {
  color: var(--landing-text-secondary);
  font-size: 1.2rem;
  margin-bottom: 32px;
  font-weight: 500;
  line-height: 1.5;
}

.cta .btn-white {
  background-color: var(--landing-primary);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 16px 40px;
  border-radius: 50px;
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
  transition: all var(--transition-normal) ease;
  border: none;
  text-decoration: none;
  display: inline-block;
}

.cta .btn-white:hover {
  background-color: #ff5252;
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 107, 107, 0.4);
}

.cta-shapes {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cta-shapes .shape {
  position: absolute;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  opacity: 0.6;
}

.shape-1 {
  width: 250px;
  height: 250px;
  top: -80px;
  left: -80px;
  animation: landing-float 8s ease-in-out infinite;
}

.shape-2 {
  width: 180px;
  height: 180px;
  bottom: -50px;
  right: -50px;
  animation: landing-float 10s ease-in-out infinite;
  animation-delay: 2s;
}

/* ---------------------------------------------------------------------------
   Auth page (login/signup): compact hero, card, buttons
   --------------------------------------------------------------------------- */
.auth-page .hero {
  background: linear-gradient(135deg, #fef9f3 0%, #e8f4f8 100%);
  padding-top: 60px;
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

.auth-page .wave-bottom {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  line-height: 0;
  z-index: 1;
}

.auth-page .login-card {
  border-radius: var(--landing-radius);
  box-shadow: var(--landing-shadow);
  border: none;
  overflow: hidden;
  min-width: 400px;
  max-width: 520px;
  margin: 0 auto;
}

@media (max-width: 576px) {
  .auth-page .login-card {
    min-width: auto;
    max-width: 100%;
  }
}

.auth-page .card-header-custom {
  background: linear-gradient(135deg, var(--landing-primary) 0%, #e85555 100%);
  color: white;
  padding: 1.25rem 1.5rem;
  font-family: var(--landing-font-heading);
  font-weight: 700;
  border: none;
}

.auth-page .btn-primary {
  background-color: var(--landing-primary);
  border-color: var(--landing-primary);
  font-weight: 600;
  border-radius: 50px;
  padding: 12px 24px;
}

.auth-page .btn-primary:hover {
  background-color: #e85555;
  border-color: #e85555;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 107, 107, 0.35);
}

.auth-page .btn-outline-primary {
  border-color: var(--landing-primary);
  color: var(--landing-primary);
  border-radius: 50px;
  font-weight: 600;
}

.auth-page .btn-outline-primary:hover {
  background-color: var(--landing-primary);
  color: white;
  border-color: var(--landing-primary);
}

.auth-page .form-control:focus {
  border-color: var(--landing-secondary);
  box-shadow: 0 0 0 0.2rem rgba(78, 205, 196, 0.25);
}

.auth-page .demo-card {
  border-radius: var(--landing-radius);
  border: 2px solid var(--landing-secondary);
  background: rgba(78, 205, 196, 0.08);
}

.auth-page .hero-text-center {
  padding-right: 0;
}

.auth-hero-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.auth-hero-subtitle {
  margin-bottom: 0;
}

.bg-light-section {
  background: #f8fafc;
}

/* ---------------------------------------------------------------------------
   Discover page: card hover, favorites
   --------------------------------------------------------------------------- */
.discover-card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.discover-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.discover-card .card-img-top {
  border-radius: 0.375rem 0.375rem 0 0;
}

.favorite-btn {
  transition: all 0.2s;
}

.favorite-btn:hover {
  transform: scale(1.05);
}

.text-warning .fas.fa-star {
  color: #ffc107;
}

.text-warning .far.fa-star {
  color: #dee2e6;
}

/* Discover page: compact hero strip */
.discover-hero {
  background: linear-gradient(135deg, #fef9f3 0%, #e8f4f8 100%);
}

.discover-hero-title {
  font-family: var(--landing-font-heading);
  color: var(--landing-dark);
}

/* ---------------------------------------------------------------------------
   Category buttons (Explore Categories grid on index)
   --------------------------------------------------------------------------- */
.category-btn {
  border-radius: 50px;
  font-weight: 600;
  transition: all var(--transition-normal) ease;
}

.category-btn:focus-visible {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.1);
}

/* ---------------------------------------------------------------------------
   Responsive: landing pages
   --------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .filter-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 992px) {
  .category-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  .hero-content {
    flex-direction: column;
    text-align: center;
    padding-bottom: 50px;
  }

  .hero-text {
    padding-right: 0;
    margin-bottom: var(--spacing-xl);
  }

  .hero-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .stats {
    justify-content: center;
  }

  .float-element {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }

  .float-2 {
    width: 55px;
    height: 55px;
  }

  .float-3 {
    width: 50px;
    height: 50px;
  }

  .search-cluster {
    padding: 22px 24px 20px;
  }

  .search-input-wrapper-large {
    padding: 10px;
    min-height: 88px;
  }

  .search-input-large {
    font-size: 1.2rem;
    padding: 22px 22px 22px 70px;
    min-height: 68px;
  }

  .search-btn-large {
    font-size: 1.2rem;
    padding: 22px 40px;
    min-height: 68px;
  }

  .filter-row {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .features .row {
    flex-direction: column-reverse;
  }

  .features img {
    margin-bottom: var(--spacing-xl);
  }
}

@media (max-width: 880px) {

  /* Intermediate breakpoint for better tablet experience */
  .section-header h2 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
  }

  .hero h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  }

  .search-cluster {
    padding: 20px 22px 18px;
  }

  .filter-row {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
}

@media (max-width: 768px) {
  .cta {
    padding: 48px 16px 64px;
  }

  .cta-box {
    padding: 32px 24px 40px;
    border-radius: 20px;
  }

  .cta-title,
  .cta h2 {
    font-size: 1.75rem;
    margin-bottom: 12px;
  }

  .cta-subtitle,
  .cta p {
    font-size: 1.05rem;
    margin-bottom: var(--spacing-lg);
  }

  .cta .btn-white {
    font-size: 1rem;
    padding: 14px 30px;
  }

  .float-element {
    display: none;
  }

  .search-section {
    padding: var(--spacing-xl) 0;
  }

  .search-cluster {
    padding: 18px 16px 16px;
    border-radius: 20px;
  }

  .search-input-wrapper-large {
    flex-direction: column;
    border-radius: 24px;
    padding: 12px;
    min-height: auto;
  }

  .search-icon-large {
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
  }

  .search-input-large {
    font-size: 1.1rem;
    padding: 20px 20px 20px 56px;
    min-height: 56px;
    margin-bottom: 10px;
    width: 100%;
  }

  .search-input-large::placeholder {
    font-size: 1rem;
  }

  .search-btn-large {
    width: 100%;
    margin-left: 0;
    padding: 18px 32px;
    font-size: 1.1rem;
    min-height: 56px;
  }

  .filter-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .filter-select {
    padding: 10px 14px;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .category-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .teacher-grid {
    grid-template-columns: 1fr;
  }

  .search-cluster {
    padding: 16px 14px 14px;
    border-radius: 18px;
  }

  .filter-row {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--spacing-xs);
  }

  .filter-select {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* Index: hidden panels (toggled by JS; avoid inline styles) */
.search-suggestions-dropdown {
  display: none;
  position: absolute;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin-top: 8px;
}

.search-suggestions-dropdown.is-open {
  display: block;
}

.search-suggestions-dropdown[aria-busy="true"] {
  opacity: 0.7;
}

.search-suggestions-dropdown .dropdown-item {
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color var(--transition-fast) ease;
}

.search-suggestions-dropdown .dropdown-item:hover,
.search-suggestions-dropdown .dropdown-item:focus {
  background-color: #f8fafc;
  outline: none;
}

.search-suggestions-dropdown .dropdown-item[tabindex="0"] {
  background-color: #fff5f5;
  outline: 2px solid var(--landing-primary);
  outline-offset: -2px;
}

.advanced-filters-panel {
  display: none;
}

.advanced-filters-panel.is-open {
  display: block;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Screen reader only class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--landing-primary, #007bff);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 0;
  position: fixed;
}

/* Skeleton loader styles */
.skeleton-loader {
  pointer-events: none;
}

.skeleton-img {
  width: 100%;
  height: 200px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 12px;
}

.skeleton-text {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 4px;
  height: 16px;
  margin-bottom: 8px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {

  .skeleton-img,
  .skeleton-text {
    animation: none;
    background: #f0f0f0;
  }
}

/* Clear search button */
.clear-search-btn {
  position: absolute;
  right: 120px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 8px;
  color: #666;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 10;
}

.clear-search-btn:hover {
  color: #333;
}

.clear-search-btn:focus {
  outline: 2px solid var(--landing-primary);
  outline-offset: 2px;
}

/* Mobile search improvements */
@media (max-width: 768px) {
  .search-input-wrapper-large {
    position: relative;
  }

  .search-input-large {
    padding-right: 100px;
    font-size: 16px;
    /* Prevents zoom on iOS */
  }

  .clear-search-btn {
    right: 80px;
  }

  .search-btn-large {
    min-height: 44px;
    /* Better touch target */
    min-width: 60px;
  }

  /* Sticky search bar on scroll for mobile */
  .search-section {
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

/* Noscript message styling */
noscript .alert {
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background-color: #e7f3ff;
  border-left: 4px solid #007bff;
  color: #004085;
}

noscript .alert i {
  margin-right: 8px;
}

/* ---------------------------------------------------------------------------
   Accessibility: Reduced Motion Support (WCAG 2.1 - Guideline 2.3.3)
   Disable animations for users who prefer reduced motion
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .floating-image,
  .float-element,
  .float-1,
  .float-2,
  .float-3,
  .shape-1,
  .shape-2 {
    animation: none !important;
  }

  .page-landing .btn:hover,
  .hero .btn:hover,
  .search-btn-large:hover,
  .category-card:hover,
  .category-card-colorful:hover,
  .teacher-card:hover {
    transform: none !important;
  }

  .advanced-filters-panel.is-open {
    animation: none !important;
  }
}

/* Print styles */
@media print {

  .hero-image,
  .float-element,
  .cta-shapes,
  .search-section,
  nav,
  footer,
  .hero-buttons {
    display: none !important;
  }

  .hero-text,
  .teacher-card,
  .category-card {
    page-break-inside: avoid;
  }

  .page-landing {
    background: white !important;
  }

  .hero,
  .teachers,
  .features,
  .cta {
    background: white !important;
    color: black !important;
  }
}

/* ---------------------------------------------------------------------------
   Dark Mode Overrides for Landing Pages
   --------------------------------------------------------------------------- */
body.dark-mode .page-landing,
body.dark-mode {
  --landing-text: #e0e0e0;
  --landing-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Page Background */
body.dark-mode .page-landing {
  background: #121212;
}

/* Hero Section */
body.dark-mode .page-landing .hero,
body.dark-mode .hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

body.dark-mode .hero h1 {
  color: #f0f0f0;
}

body.dark-mode .hero-text p,
body.dark-mode .hero p {
  color: #b0b0b0;
}

body.dark-mode .badge {
  background-color: #2c2c2c;
  color: #4ecdc4;
  border: 1px solid #444;
}

/* Floating Elements in Dark Mode */
body.dark-mode .float-element {
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  border-color: #444;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .float-1 {
  background: linear-gradient(135deg, #442222 0%, #ff6b6b 100%);
}

body.dark-mode .float-2 {
  background: linear-gradient(135deg, #1a3a3a 0%, #4ecdc4 100%);
}

body.dark-mode .float-3 {
  background: linear-gradient(135deg, #444422 0%, #ffe66d 100%);
}

/* Stats */
body.dark-mode .stat-number {
  color: #fff;
}

body.dark-mode .stat-label {
  color: #888;
}

/* Wave Bottom */
body.dark-mode .wave-bottom path {
  fill: #1a1a1a;
}

/* Search Section */
body.dark-mode .search-section {
  background-color: #1a1a1a !important;
}

body.dark-mode .search-cluster {
  background: #252525;
  border-color: #333;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

body.dark-mode .search-input-wrapper-large {
  background: #2c2c2c;
  border-color: #444;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .search-input-large {
  color: #ffffff;
}

body.dark-mode .search-icon-large {
  color: #a0a0a0;
}

body.dark-mode .search-input-large::placeholder {
  color: #777;
}

body.dark-mode .search-btn-large {
  background-color: #ff6b6b;
  border-color: #ff6b6b;
}

body.dark-mode .filters-group {
  border-top-color: #333;
}

body.dark-mode .filter-select {
  background-color: #2c2c2c;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .filter-select:hover {
  border-color: #ff6b6b;
  background: #2d1f1f;
}

body.dark-mode .advanced-toggle-btn {
  color: #aaa;
}

body.dark-mode .advanced-toggle-btn:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

/* Section Headers */
body.dark-mode .section-header h2,
body.dark-mode section h2 {
  color: #f0f0f0;
}

body.dark-mode .section-header p {
  color: #aaa;
}

/* Category Grid - bg-white sections */
body.dark-mode .bg-white,
body.dark-mode section.bg-white {
  background-color: #1a1a1a !important;
}

body.dark-mode .category-card,
body.dark-mode .category-card-colorful {
  background: #252525;
  border-color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

body.dark-mode .category-card h3,
body.dark-mode .category-card-colorful h3 {
  color: #fff;
}

body.dark-mode .category-card p,
body.dark-mode .category-card-colorful p {
  color: #aaa;
}

body.dark-mode .category-card:hover,
body.dark-mode .category-card-colorful:hover {
  background: #2c2c2c;
  border-color: #444;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

/* Category buttons */
body.dark-mode .category-btn {
  background-color: #252525;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .category-btn:hover {
  background-color: #333;
  border-color: #ff6b6b;
  color: #fff;
}

/* Teacher Section */
body.dark-mode .teachers {
  background-color: #121212 !important;
}

body.dark-mode .teacher-card {
  background: #252525;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .teacher-info h3 {
  color: #fff;
}

body.dark-mode .teacher-info .subject {
  color: #4ecdc4;
}

body.dark-mode .teacher-info .bio {
  color: #aaa;
}

body.dark-mode .tags span {
  background: #333;
  color: #bbb;
}

body.dark-mode .teacher-badge {
  background: rgba(37, 37, 37, 0.9);
  color: #4ecdc4;
}

/* Features Section */
body.dark-mode .features {
  background-color: #1a1a1a !important;
}

body.dark-mode .features h2 {
  color: #f0f0f0;
}

body.dark-mode .feature-icon-small {
  background: #2d1f1f;
  color: #ff6b6b;
}

body.dark-mode .feature-text h4 {
  color: #fff;
}

body.dark-mode .feature-text p {
  color: #aaa;
}

body.dark-mode .feature-list li {
  color: #e0e0e0;
}

/* CTA Section */
body.dark-mode .cta {
  background: linear-gradient(135deg, #ff5252 0%, #c43e3e 100%);
}

body.dark-mode .cta-box {
  background: rgba(30, 30, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .cta-title,
body.dark-mode .cta-subtitle {
  color: #fff;
}

body.dark-mode .cta .btn-white {
  background-color: #fff;
  color: var(--landing-primary);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

body.dark-mode .cta .btn-white:hover {
  background-color: #f0f0f0;
  color: #ff5252;
}

/* Buttons */
body.dark-mode .btn-secondary,
body.dark-mode .hero .btn-secondary {
  background-color: #2c2c2c;
  color: #eee;
  border-color: #444;
}

body.dark-mode .btn-secondary:hover,
body.dark-mode .hero .btn-secondary:hover {
  background-color: #333;
  color: #fff;
  border-color: #ff6b6b;
}

body.dark-mode .btn-outline {
  border-color: #4ecdc4;
  color: #4ecdc4;
}

body.dark-mode .btn-outline:hover {
  background-color: rgba(78, 205, 196, 0.2);
  color: #6ee7df;
}

/* Highlight text */
body.dark-mode .highlight {
  color: #ff6b6b;
}

/* Advanced Filters Panel */
body.dark-mode .advanced-filters-panel .card {
  background-color: #252525;
  border-color: #333;
}

body.dark-mode .advanced-filters-panel .card-body {
  background-color: #252525;
}

body.dark-mode .advanced-filters-panel .card-title {
  color: #f0f0f0;
}

body.dark-mode .advanced-filters-panel .font-weight-bold {
  color: #e0e0e0;
}

body.dark-mode .advanced-filters-panel .form-control {
  background-color: #2c2c2c;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .advanced-filters-panel .form-check-label {
  color: #d0d0d0;
}