/* =========================================================
   VidNote AI — Design tokens
   Palette: lavender, light purple, soft pink, white, light blue,
   dark purple text — soft gradients, glassmorphism, rounded cards.
   ========================================================= */
:root {
  --bg: #FAF8FF;
  --bg-alt: #F3EEFF;

  --lavender: #EDE9FE;
  --purple: #A78BFA;
  --purple-strong: #7C3AED;
  --purple-dark: #4C2E8A;
  --pink: #F5A8D0;
  --pink-soft: #FCE4F1;
  --blue-soft: #DCEBFF;

  --text: #3B2A5A;
  --text-muted: #6E5D91;
  --white: #FFFFFF;

  --border: rgba(124, 58, 237, 0.12);
  --shadow: 0 20px 45px -20px rgba(124, 58, 237, 0.28);
  --shadow-sm: 0 8px 20px -10px rgba(124, 58, 237, 0.25);

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--purple-dark);
  margin: 0 0 .5em;
  line-height: 1.2;
}

p { line-height: 1.65; color: var(--text-muted); margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.accent { color: var(--purple-strong); }

.text-gradient {
  background: linear-gradient(120deg, var(--purple-strong), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================================
   Background blobs (soft gradients, ambient)
   ========================================================= */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
}
.blob-1 { width: 480px; height: 480px; background: var(--lavender); top: -160px; left: -120px; }
.blob-2 { width: 420px; height: 420px; background: var(--pink-soft); top: 220px; right: -140px; }
.blob-3 { width: 380px; height: 380px; background: var(--blue-soft); bottom: -160px; left: 30%; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(120deg, var(--purple-strong), var(--pink));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: rgba(124, 58, 237, 0.08);
  color: var(--purple-dark);
}
.btn-ghost:hover { background: rgba(124, 58, 237, 0.15); }

.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn-block { width: 100%; }

/* =========================================================
   Glassmorphism card
   ========================================================= */
.glass-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 255, 0.75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--purple-dark);
}
.logo-mark { display: flex; }
.nav-links {
  display: flex;
  gap: 32px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover { color: var(--purple-strong); }
.nav-cta { flex-shrink: 0; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--purple-dark); border-radius: 2px; }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding: 90px 0 60px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-strong);
  background: rgba(124, 58, 237, 0.09);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 { font-size: 48px; letter-spacing: -0.02em; }
.hero-sub { font-size: 17px; max-width: 480px; }
.hero-actions { display: flex; gap: 14px; margin: 28px 0 40px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 36px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-display); font-size: 24px; color: var(--purple-dark); }
.hero-stats span { font-size: 13px; color: var(--text-muted); }

.hero-art { position: relative; height: 460px; }
.hero-video-mock {
  position: absolute;
  inset: 40px 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #6D3FC0, #B166C9 55%, #E88CB6);
  box-shadow: var(--shadow);
  padding: 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-video-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; opacity: .95; }
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #FF7A9C; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.hero-video-bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; }
.hero-video-bars span {
  flex: 1;
  height: var(--h);
  background: rgba(255,255,255,0.55);
  border-radius: 6px;
  animation: bar-bounce 2.4s ease-in-out infinite;
}
.hero-video-bars span:nth-child(odd) { animation-delay: .3s; }
@keyframes bar-bounce { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(.65); } }
.hero-video-caption { font-size: 13px; font-weight: 500; opacity: .95; }

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-dark);
  animation: floaty 5s ease-in-out infinite;
}
.card-a { top: 10px; left: -10px; animation-delay: 0s; }
.card-b { bottom: 90px; right: -18px; animation-delay: 1.2s; }
.card-c { bottom: 10px; left: 20px; animation-delay: .6s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot-pink { background: var(--pink); }
.dot-blue { background: #7FA8F0; }

/* =========================================================
   Section headings
   ========================================================= */
.section-head { text-align: center; max-width: 620px; margin: 0 auto 48px; }
.section-head.left { text-align: left; margin: 0 0 40px; max-width: 640px; }
.section-head h2 { font-size: 34px; }

/* =========================================================
   Features
   ========================================================= */
.features { padding: 40px 0 90px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-sm); }
.feature-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  margin-bottom: 16px;
}
.grad-1 { background: linear-gradient(135deg, var(--lavender), #DCD1FB); }
.grad-2 { background: linear-gradient(135deg, var(--pink-soft), #FBD2E7); }
.grad-3 { background: linear-gradient(135deg, var(--blue-soft), #CFE3FF); }
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; margin: 0; }

/* =========================================================
   How it works
   ========================================================= */
.how-it-works { padding: 40px 0 90px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 50px; }
.step-card {
  background: linear-gradient(160deg, var(--white), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 30px 24px;
}
.step-num {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  color: var(--pink);
  margin-bottom: 10px;
}
.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(120deg, var(--purple-strong), #C069B0);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  color: #fff;
}
.cta-banner h3 { color: #fff; margin-bottom: 4px; }
.cta-banner p { color: rgba(255,255,255,0.85); margin: 0; }
.cta-banner .btn-primary { background: #fff; color: var(--purple-strong); }

/* =========================================================
   About
   ========================================================= */
.about { padding: 20px 0 100px; }
.about-inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
.about-card { padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.about-row { display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--text); }
.about-row span { font-size: 20px; }

/* =========================================================
   Footer
   ========================================================= */
.footer { border-top: 1px solid var(--border); padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-logo { font-size: 16px; }
.footer p { margin: 0; font-size: 13px; }

/* =========================================================
   DASHBOARD
   ========================================================= */
.dashboard-main { padding: 50px 0 100px; min-height: 70vh; }
.panel-section { animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 900px;
}
.input-card { padding: 30px; }
.input-card h3 { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 6px; }
.input-icon { font-size: 20px; }
.input-help { font-size: 13px; margin-bottom: 18px; }

.text-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text);
  margin-bottom: 16px;
  outline: none;
  transition: border-color .15s ease;
}
.text-input:focus { border-color: var(--purple); }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 90px;
  border: 2px dashed var(--purple);
  border-radius: var(--radius-sm);
  background: rgba(167, 139, 250, 0.06);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
  padding: 14px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.dropzone.dragover { background: rgba(167, 139, 250, 0.15); border-color: var(--purple-strong); }

.upload-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--lavender);
  overflow: hidden;
  margin-bottom: 16px;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--purple-strong), var(--pink));
  transition: width .2s ease;
}

/* Processing screen */
.processing-card {
  max-width: 520px;
  margin: 40px auto;
  padding: 48px 40px;
  text-align: center;
}
.loader {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 5px solid var(--lavender);
  border-top-color: var(--purple-strong);
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-steps { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; display: inline-flex; flex-direction: column; gap: 12px; }
.processing-steps li {
  font-size: 14.5px;
  color: var(--text-muted);
  opacity: .4;
  transition: opacity .3s ease, color .3s ease;
}
.processing-steps li.active { opacity: 1; color: var(--purple-dark); font-weight: 600; }
.processing-steps li.done { opacity: .75; color: var(--text); }
.processing-hint { font-size: 12.5px; margin-top: 20px; }

/* Error screen */
.error-card { max-width: 480px; margin: 40px auto; padding: 46px 36px; text-align: center; }
.error-icon { font-size: 40px; margin-bottom: 10px; }

/* Results */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}
.results-header h2 { font-size: 26px; margin: 4px 0 0; max-width: 640px; }
.results-actions { display: flex; align-items: center; gap: 10px; }
.lang-select {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 999px 999px 0 0;
  position: relative;
  transition: color .15s ease;
}
.tab-btn:hover { color: var(--purple-strong); }
.tab-btn.active { color: var(--purple-strong); }
.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -7px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(120deg, var(--purple-strong), var(--pink));
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadein .3s ease; }

.panel-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.icon-btn {
  background: #fff;
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-dark);
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: var(--lavender); }
.icon-btn:active { transform: scale(.96); }

.content-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  min-height: 160px;
}

/* Skeleton loader */
.skeleton-loader {
  height: 16px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--lavender) 25%, #f5f0ff 37%, var(--lavender) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  margin-bottom: 12px;
}
.skeleton-loader:nth-child(2) { width: 85%; }
.skeleton-loader:nth-child(3) { width: 70%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* Summary */
.summary-block { margin-bottom: 22px; }
.summary-block h4 { font-size: 15px; color: var(--purple-strong); text-transform: uppercase; letter-spacing: .04em; font-size: 12.5px; margin-bottom: 8px; }
.summary-block p { color: var(--text); }

/* Notes */
.note-section { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px dashed var(--border); }
.note-section:last-child { border-bottom: none; margin-bottom: 0; }
.note-section h4 { font-size: 17px; color: var(--purple-dark); margin-bottom: 10px; }
.note-section ul { margin: 0 0 12px; padding-left: 20px; color: var(--text); }
.note-section li { margin-bottom: 6px; }
.definition-chip {
  background: var(--pink-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
.definition-chip strong { color: var(--purple-dark); }

/* Key points */
.keypoint-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.keypoint-item:last-child { border-bottom: none; }
.keypoint-num {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--purple-strong);
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.keypoint-item h4 { font-size: 15px; margin: 0 0 4px; color: var(--text); }
.keypoint-item p { margin: 0; font-size: 13.5px; }

/* Quiz */
.quiz-question { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.quiz-question:last-child { border-bottom: none; }
.quiz-question h4 { font-size: 15.5px; color: var(--text); margin-bottom: 12px; }
.quiz-options { display: flex; flex-direction: column; gap: 8px; }
.quiz-option {
  text-align: left;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background .15s ease, border-color .15s ease;
}
.quiz-option:hover { background: var(--lavender); }
.quiz-option.selected { border-color: var(--purple); background: var(--lavender); }
.quiz-option.correct { border-color: #4CAF7D; background: #E4F7EC; font-weight: 600; }
.quiz-option.incorrect { border-color: #E4576B; background: #FCE8EA; }
.quiz-option:disabled { cursor: default; }
.quiz-explanation {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: none;
}
.quiz-explanation.show { display: block; }
.quiz-score {
  font-weight: 700;
  color: var(--purple-strong);
  font-size: 14px;
}

/* Flashcards */
.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
  background: transparent;
  border: none;
  padding: 0;
}
.flashcard { perspective: 1200px; height: 170px; cursor: pointer; }
.flashcard-inner {
  position: relative;
  width: 100%; height: 100%;
  transition: transform .5s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.flashcard-front { background: linear-gradient(150deg, var(--lavender), #E9E1FE); color: var(--purple-dark); }
.flashcard-back { background: linear-gradient(150deg, var(--pink-soft), #FCE0EF); color: var(--purple-dark); transform: rotateY(180deg); font-weight: 500; }
.flashcard-hint { font-size: 13px; color: var(--text-muted); }

/* Chapters */
.chapter-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.chapter-item:last-child { border-bottom: none; }
.chapter-time {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--purple-strong), var(--pink));
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  height: fit-content;
}
.chapter-item h4 { margin: 0 0 4px; font-size: 15px; }
.chapter-item p { margin: 0; font-size: 13px; }

/* Transcript */
.transcript-box { max-height: 480px; overflow-y: auto; font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }

.empty-state { text-align: center; padding: 30px 10px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 32px; margin-bottom: 10px; }

/* =========================================================
   Toasts
   ========================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}
.toast {
  background: var(--purple-dark);
  color: #fff;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in .25s ease;
  max-width: 320px;
}
.toast.error { background: #C0435A; }
.toast.success { background: #3F9967; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
  .about-inner { grid-template-columns: 1fr; }
  .input-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .hero h1 { font-size: 32px; }
  .hero-stats { gap: 22px; }
  .feature-grid { grid-template-columns: 1fr; }
  .cta-banner { flex-direction: column; text-align: center; }
  .results-header { flex-direction: column; }
  .navbar.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 62px; left: 0; right: 0;
    background: var(--bg);
    padding: 18px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }
  .navbar.menu-open .nav-cta { display: inline-flex; }
}
