/* eClass School Premium SaaS Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --ink: #0a0e17;
  --ink-soft: #3b4252;
  --paper: #f8fafc;
  --paper-2: #f1f5f9;
  --teal: #6366f1;       /* Indigo */
  --teal-deep: #4338ca;  /* Deep Indigo */
  --coral: #f43f5e;      /* Rose */
  --coral-soft: #ffe4e6;
  --sand: #cbd5e1;       /* Slate border */
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 12px 30px -10px rgba(10, 14, 23, 0.15);
  --shadow-hover: 0 20px 40px -10px rgba(99, 102, 241, 0.25);
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --grad-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --grad-secondary: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.4);
}

/* Premium Utilities */
.hover-lift {
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-deep);
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ——— Landing / Login ——— */
.landing {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
  color: var(--paper);
}

.landing-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(224, 122, 95, 0.45), transparent 55%),
    radial-gradient(ellipse 70% 50% at 15% 80%, rgba(13, 115, 119, 0.55), transparent 50%),
    linear-gradient(145deg, #0a3d40 0%, #0d7377 42%, #1a4a4e 78%, #2c1810 100%);
  animation: bg-drift 18s ease-in-out infinite alternate;
}

.landing-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.9;
}

@keyframes bg-drift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.landing-nav,
.landing-hero,
.role-panel {
  position: relative;
  z-index: 1;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: inherit;
}

.lang-switch {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.25rem;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.lang-switch button {
  border: none;
  background: transparent;
  color: rgba(247, 243, 235, 0.75);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.25s var(--ease), color 0.25s var(--ease);
}

.lang-switch button.active,
.lang-switch button:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 1.75rem 4rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  animation: rise-in 0.9s var(--ease) both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.landing-hero .brand-hero {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 8vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  animation: rise-in 1s var(--ease) 0.1s both;
}

.landing-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 500;
  margin: 0 0 0.75rem;
  max-width: 22ch;
  opacity: 0.95;
  animation: rise-in 1s var(--ease) 0.2s both;
}

.landing-hero .lede {
  font-size: 1.05rem;
  opacity: 0.82;
  max-width: 36ch;
  margin: 0 0 2rem;
  animation: rise-in 1s var(--ease) 0.3s both;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  animation: rise-in 1s var(--ease) 0.4s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 999px;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: all 0.25s var(--ease);
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-google {
  background: #ffffff;
  color: var(--ink);
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(15, 42, 46, 0.08);
}

.btn-google:hover {
  background: #ffffff;
  border-color: rgba(13, 115, 119, 0.3);
  box-shadow: 0 8px 24px rgba(15, 42, 46, 0.14);
}

.btn-google svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-coral {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.btn-coral:hover {
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.5);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--sand);
}

.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(99, 102, 241, 0.04);
}

/* btn-outline on dark backgrounds (white version) */
.btn-outline-light {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* Role chooser overlay */
.role-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(8, 30, 32, 0.72);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fade-in 0.35s var(--ease);
}

.role-panel.open {
  display: flex;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.role-box {
  background: var(--paper);
  color: var(--ink);
  border-radius: calc(var(--radius) + 6px);
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: rise-in 0.5s var(--ease);
}

.role-box h2 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
}

.role-box p {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
}

.role-choices {
  display: grid;
  gap: 0.75rem;
}

.role-choice {
  text-align: left;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--sand);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.role-choice:hover {
  border-color: var(--teal);
  background: #f0faf9;
  transform: translateY(-2px);
}

.role-choice strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}

.role-choice span {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ——— App shell (dashboards) ——— */
.app-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(224, 122, 95, 0.12), transparent),
    radial-gradient(ellipse 50% 35% at 0% 100%, rgba(13, 115, 119, 0.1), transparent),
    var(--paper);
}

.app-header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(10, 14, 23, 0.05);
}

.app-header .brand {
  color: var(--ink);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-chip img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip .meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-chip .meta strong {
  font-size: 0.9rem;
}

.user-chip .meta small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem 3rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.page-sub {
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.course-tile {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(15, 42, 46, 0.06);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  color: inherit;
}

.course-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15, 42, 46, 0.12);
}

.course-tile .thumb {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  object-fit: cover;
  width: 100%;
}

.course-tile .body {
  padding: 1rem 1.1rem 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-tile h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.4rem;
  line-height: 1.25;
}

.course-tile .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: auto;
  padding-top: 0.75rem;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--paper-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-soft);
}

.empty-state h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.5rem;
}

/* Forms */
.form-panel {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(15, 42, 46, 0.06);
  max-width: 640px;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--sand);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--teal);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.tile-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Course watch page */
.course-layout {
  display: grid;
  gap: 1.75rem;
}

@media (min-width: 900px) {
  .course-layout {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

.video-container {
  display: flex;
  flex-direction: column;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  resize: vertical;
  min-height: 280px;
  max-height: 85vh;
  box-shadow: var(--shadow);
}

.video-container video {
  flex: 1;
  width: 100%;
  height: calc(100% - 40px);
  background: #000;
  object-fit: contain;
  display: block;
}

.player-wrap {
  background: #0a1f22;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player-wrap video {
  width: 100%;
  display: block;
  max-height: 70vh;
  background: #000;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  background: #122a2e;
  color: #fff;
}

.player-controls button {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s;
}

.player-controls button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.progress-track {
  flex: 1;
  min-width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--coral);
  border-radius: 999px;
  pointer-events: none;
}

.time-label {
  font-size: 0.75rem;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.volume-slider {
  width: 80px;
  accent-color: var(--coral);
}

.course-info h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin: 0 0 0.5rem;
}

.course-info .stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.lesson-text {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.06);
  white-space: pre-wrap;
  line-height: 1.65;
}

.reviews-section {
  margin-top: 1.5rem;
}

.reviews-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 1rem;
}

.review-form {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.06);
  margin-bottom: 1.25rem;
}

.stars {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.stars button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--sand);
  padding: 0;
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.stars button.on,
.stars button:hover {
  color: var(--coral);
}

.stars button:hover {
  transform: scale(1.1);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.review-item {
  background: #fff;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.06);
}

.review-item .head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.review-item .head img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.review-item .rating {
  color: var(--coral);
  font-size: 0.85rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fde8e6;
  color: var(--danger);
}

.alert-ok {
  background: #e6f6f3;
  color: var(--success);
}

.hidden {
  display: none !important;
}

.lang-switch--dark {
  background: rgba(15, 42, 46, 0.08);
  border: 1px solid rgba(15, 42, 46, 0.12);
}

.lang-switch--dark button {
  color: var(--ink-soft);
  font-weight: 600;
}

.lang-switch--dark button.active,
.lang-switch--dark button:hover {
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

@media (max-width: 600px) {
  .user-chip .meta {
    display: none;
  }
  .landing-nav {
    padding: 1rem;
  }
}

/* ——— ProSkills dashboard & player upgrades ——— */
.app-main--wide {
  max-width: 1280px;
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.25rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.dash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}

.search-bar {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
  background: #fff;
}

.dash-section {
  margin-bottom: 2.25rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.course-top {
  margin-bottom: 1rem;
}

.course-top h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 0 0 0.5rem;
}

.player-stage {
  display: grid;
  gap: 1rem;
  position: relative;
}

@media (min-width: 960px) {
  .player-stage {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
  .notes-panel {
    display: block;
  }
  .notes-panel:not(.open) {
    display: block;
  }
}

.player-wrap--lg {
  border-radius: calc(var(--radius) + 4px);
}

.player-wrap--lg video {
  max-height: min(78vh, 720px);
  min-height: 280px;
  width: 100%;
  object-fit: contain;
  background: #000;
}

.btn-notes-toggle {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.notes-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.08);
  padding: 1rem;
  max-height: 78vh;
  overflow: auto;
}

@media (max-width: 959px) {
  .notes-panel {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    max-height: 55vh;
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: 0 -12px 40px rgba(15, 42, 46, 0.2);
  }
  .notes-panel.open {
    display: block;
  }
}

.notes-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.notes-panel-head h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0;
}

.quiz-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 30, 32, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 5;
}

.player-wrap {
  position: relative;
}

.quiz-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: rise-in 0.35s var(--ease);
}

.quiz-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--coral);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.quiz-card h3 {
  font-family: var(--font-display);
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.quiz-options {
  display: grid;
  gap: 0.5rem;
}

.quiz-option {
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--sand);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.quiz-option:hover {
  border-color: var(--teal);
  background: #f0faf9;
}

.quiz-feedback {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.quiz-feedback.ok {
  color: var(--success);
}

.score-banner {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #0d7377, #085558);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1.05rem;
}

.course-below {
  margin-top: 2rem;
}

.live-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .live-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.chat-panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 360px;
  max-height: 520px;
}

.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(15, 42, 46, 0.08);
}

.chat-messages {
  flex: 1;
  overflow: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chat-msg strong {
  margin-right: 0.35rem;
  color: var(--teal-deep);
}

.chat-msg--system {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(15, 42, 46, 0.08);
}

.chat-form input {
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--sand);
  border-radius: 999px;
}

.role-choices {
  display: grid;
  gap: 0.75rem;
}

.role-choice {
  text-align: left;
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--sand);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
  width: 100%;
}

.role-choice:hover {
  border-color: var(--teal);
  background: #f0faf9;
  transform: translateY(-2px);
}

.role-choice strong {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 0.2rem;
}


/* Category Pills Bar */
.category-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.25rem 0 1rem;
  margin-bottom: 1.25rem;
  scrollbar-width: thin;
}

.category-pill {
  border: 1.5px solid var(--sand);
  background: #fff;
  color: var(--ink-soft);
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.category-pill:hover,
.category-pill.active {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(13, 115, 119, 0.25);
}

/* Tutor Grid & Cards */
.tutor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.tutor-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid rgba(15, 42, 46, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.tutor-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 42, 46, 0.12);
}

.tutor-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--paper-2);
  margin-bottom: 0.75rem;
}

.tutor-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
}

.tutor-card .subjects {
  font-size: 0.8rem;
  color: var(--teal-deep);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.tutor-card .rating-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--coral);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.price-tag {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.8rem;
}

.price-tag--free {
  background: #e6f6f3;
  color: var(--success);
}

.price-tag--paid {
  background: #fdf0ec;
  color: var(--coral);
}

/* Modal Overlay & Box */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 30, 32, 0.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: var(--paper);
  color: var(--ink);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: rise-in 0.35s var(--ease);
}

.modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-soft);
}

/* Lesson Playlist styling */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.lesson-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(15, 42, 46, 0.08);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lesson-item:hover,
.lesson-item.active {
  border-color: var(--teal);
  background: #f0faf9;
}

.preview-tag {
  background: #e6f6f3;
  color: var(--teal);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.lock-tag {
  background: var(--paper-2);
  color: var(--ink-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Tabbed Sidebar Controls */
.notes-panel-tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--paper-2);
  padding: 0.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.notes-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}

.notes-tab-btn:hover,
.notes-tab-btn.active {
  background: #fff;
  color: var(--teal-deep);
  box-shadow: 0 2px 8px rgba(15, 42, 46, 0.08);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fade-in 0.25s var(--ease);
}

/* Premium Card & Hero Animations */
.course-tile,
.tutor-card,
.form-panel,
.review-item {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.course-tile:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 20px 40px rgba(13, 115, 119, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--coral), #d46a4f);
  box-shadow: 0 4px 14px rgba(224, 122, 95, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(224, 122, 95, 0.45);
  transform: translateY(-2px);
}

/* Drag & Dropzone & Selected File Cards */
.file-dropzone {
  border: 2px dashed rgba(13, 115, 119, 0.35);
  background: var(--paper-2);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.25s ease;
}

.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--teal);
  background: rgba(230, 246, 243, 0.6);
  transform: scale(1.01);
}

.dropzone-icon {
  font-size: 2.75rem;
  margin-bottom: 0.5rem;
}

.dropzone-hint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.dropzone-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.selected-file-card {
  background: #fff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--teal);
  box-shadow: 0 4px 16px rgba(13, 115, 119, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}



/* ══════════════════════════════════════
   Dark shell btn-outline fix
   (course.html, and other dark-bg pages)
══════════════════════════════════════ */
[data-dark-header] .app-header .btn-outline,
.app-header--dark .btn-outline {
  color: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
}

[data-dark-header] .app-header .btn-outline:hover,
.app-header--dark .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

/* Edit-course & create-course header on light bg — keep btn-outline dark */
.app-shell:not([data-dark-header]) .app-header .btn-outline {
  color: var(--ink-soft);
  border-color: var(--sand);
}

.app-shell:not([data-dark-header]) .app-header .btn-outline:hover {
  color: var(--teal);
  border-color: var(--teal);
  background: rgba(99, 102, 241, 0.06);
}

/* ══════════════════════════════════════════════════
   SETTINGS SIDEBAR — Hamburger slide-in panel
══════════════════════════════════════════════════ */

/* Hamburger trigger button */
.settings-trigger {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid rgba(15, 42, 46, 0.12);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.22s ease;
  flex-shrink: 0;
}

.settings-trigger:hover {
  background: rgba(13, 115, 119, 0.08);
  border-color: var(--teal);
  transform: scale(1.05);
}

.settings-trigger .bar {
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.settings-trigger.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.settings-trigger.open .bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.settings-trigger.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop overlay */
.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(8, 30, 32, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.settings-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar panel */
.settings-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  width: 320px;
  max-width: 90vw;
  background: var(--settings-bg, #fff);
  box-shadow: -12px 0 48px rgba(8, 30, 32, 0.18);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid rgba(15, 42, 46, 0.08);
}

.settings-sidebar.open {
  transform: translateX(0);
}

/* Sidebar header */
.settings-head {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(15, 42, 46, 0.07);
  background: linear-gradient(135deg, #0d4b4e 0%, #0d7377 100%);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-head h3 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.settings-close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.settings-close-btn:hover { background: rgba(255,255,255,0.25); }

/* Sidebar body */
.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.settings-section {
  margin-bottom: 1.25rem;
}

.settings-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
  padding: 0 0.1rem;
}

/* Setting row */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--settings-row-bg, #f8fafc);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(15, 42, 46, 0.06);
  transition: background 0.2s;
}

.setting-row:hover {
  background: var(--settings-row-hover, rgba(13, 115, 119, 0.04));
}

.setting-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 0.1rem;
}

.setting-info small {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

/* iOS-style toggle */
.ios-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ios-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.25s;
}

.ios-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.ios-toggle input:checked + .ios-slider { background: var(--teal); }
.ios-toggle input:checked + .ios-slider::before { transform: translateX(22px); }

/* Sidebar lang switcher */
.sidebar-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
}

.sidebar-lang-btn {
  border: 1.5px solid rgba(15, 42, 46, 0.12);
  background: var(--settings-row-bg, #f8fafc);
  color: var(--ink-soft);
  padding: 0.5rem 0.25rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.sidebar-lang-btn.active,
.sidebar-lang-btn:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* Sidebar user info card */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(13, 115, 119, 0.08), rgba(99, 102, 241, 0.05));
  border-radius: 12px;
  border: 1px solid rgba(13, 115, 119, 0.12);
  margin-bottom: 1.25rem;
}

.sidebar-user-card img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(13, 115, 119, 0.2);
}

.sidebar-user-card .suc-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink);
  display: block;
}

.sidebar-user-card .suc-role {
  font-size: 0.75rem;
  color: var(--teal-deep);
  font-weight: 600;
}

/* Sidebar footer */
.settings-foot {
  padding: 1rem;
  border-top: 1px solid rgba(15, 42, 46, 0.07);
}

.settings-foot .btn {
  width: 100%;
  justify-content: center;
  padding: 0.7rem;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════════
   DARK MODE — body.dark-mode
══════════════════════════════════════════════════ */
body.dark-mode {
  --ink: #e8eaf0;
  --ink-soft: #94a3b8;
  --paper: #0f1923;
  --paper-2: #151f2e;
  --sand: #2a3a50;
  --settings-bg: #1a2535;
  --settings-row-bg: #1f2d40;
  --settings-row-hover: rgba(13, 115, 119, 0.12);
  background: #0f1923;
  color: #e8eaf0;
}

body.dark-mode .app-shell {
  background: radial-gradient(ellipse 60% 40% at 100% 0%, rgba(244, 63, 94, 0.08), transparent),
              radial-gradient(ellipse 50% 35% at 0% 100%, rgba(13, 115, 119, 0.08), transparent),
              #0f1923;
}

body.dark-mode .app-header {
  background: rgba(15, 25, 35, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .app-header .brand { color: #e8eaf0; }

body.dark-mode .settings-trigger {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-trigger .bar { background: #e8eaf0; }
body.dark-mode .settings-trigger:hover { background: rgba(13, 115, 119, 0.18); }

body.dark-mode .course-tile,
body.dark-mode .form-panel,
body.dark-mode .review-item,
body.dark-mode .chat-panel,
body.dark-mode .notes-panel,
body.dark-mode .lesson-item,
body.dark-mode .tutor-card,
body.dark-mode .course-tile .body {
  background: #1a2535;
  border-color: rgba(255, 255, 255, 0.06);
  color: #e8eaf0;
}

body.dark-mode .course-tile:hover,
body.dark-mode .tutor-card:hover {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

body.dark-mode .btn-outline {
  color: rgba(232, 234, 240, 0.8);
  border-color: rgba(255, 255, 255, 0.18);
}

body.dark-mode .btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

body.dark-mode .lang-switch--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .lang-switch--dark button { color: rgba(232, 234, 240, 0.6); }

body.dark-mode .form-group input,
body.dark-mode .form-group textarea,
body.dark-mode .form-group select,
body.dark-mode .search-bar input,
body.dark-mode .chat-form input {
  background: #1f2d40;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8eaf0;
}

body.dark-mode .category-pill {
  background: #1a2535;
  border-color: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}

body.dark-mode .section-title,
body.dark-mode .page-title { color: #e8eaf0; }

body.dark-mode .page-sub,
body.dark-mode .empty-state { color: #64748b; }

body.dark-mode .modal-box { background: #1a2535; color: #e8eaf0; }

body.dark-mode .role-choice {
  background: #1f2d40;
  border-color: rgba(255,255,255,0.1);
  color: #e8eaf0;
}

body.dark-mode .alert-error { background: rgba(239, 68, 68, 0.12); }
body.dark-mode .alert-ok { background: rgba(16, 185, 129, 0.12); }

body.dark-mode .promo-panel,
body.dark-mode .create-card,
body.dark-mode .form-panel {
  background: #1a2535;
  border-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .promo-panel-head {
  background: linear-gradient(135deg, #1f2d40 0%, #1a2535 100%);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

body.dark-mode .ad-type-card {
  background: #1f2d40;
  border-color: rgba(255,255,255,0.1);
}

body.dark-mode .ad-type-card:hover,
body.dark-mode .ad-type-card.selected {
  background: rgba(13, 115, 119, 0.15);
}

body.dark-mode .field-group select,
body.dark-mode .field-group input[type=text],
body.dark-mode .field-group input[type=url],
body.dark-mode .field-group input[type=file],
body.dark-mode .dur-tab,
body.dark-mode .pay-method-card {
  background: #1f2d40;
  border-color: rgba(255, 255, 255, 0.1);
  color: #e8eaf0;
}

body.dark-mode .bank-info-box {
  background: rgba(13, 115, 119, 0.08);
  border-color: rgba(13, 115, 119, 0.2);
  color: #94a3b8;
}

body.dark-mode .price-summary {
  background: rgba(13, 115, 119, 0.08);
  border-color: rgba(13, 115, 119, 0.15);
}

/* ══════════════════════════════════════
   FOOTER - Blends seamlessly with background
══════════════════════════════════════ */
.app-footer {
  background: transparent;
  color: var(--text-secondary);
  padding: 1rem 2rem;
  margin-top: 2rem;
  position: relative;
}

.app-footer::before {
  display: none;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.footer-col h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--primary-color); }

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted, rgba(0, 0, 0, 0.5));
}

.footer-badges {
  display: flex;
  gap: 0.5rem;
}

.footer-badge {
  background: var(--surface-bg, rgba(0, 0, 0, 0.05));
  color: var(--text-secondary, rgba(0, 0, 0, 0.6));
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

body.dark-mode .app-footer {
  background: transparent;
}
