/* Demo page styles — extends theme.css variables */

/* === DEMO HERO === */
.demo-hero {
  padding: 60px 24px 40px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.demo-hero-inner {
  max-width: 800px;
  margin: 0 auto;
}
.demo-sub {
  font-size: 16px;
  color: var(--slate);
  margin-top: 12px;
  line-height: 1.6;
}

/* === DEMO STAGE === */
.demo-stage {
  padding: 48px 24px 80px;
  background: var(--bg);
  min-height: 70vh;
}
.demo-stage-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* === STEP BLOCK === */
.step-block {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 20px;
}

/* === STEP 1: PDF === */
.pdf-picker { display: flex; flex-direction: column; gap: 12px; }

.pdf-file {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  transition: border-color 0.2s;
}

.pdf-icon {
  width: 44px;
  height: 44px;
  background: var(--amber-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
  flex-shrink: 0;
}

.pdf-info { flex: 1; }
.pdf-name { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.pdf-meta { font-size: 12px; color: var(--slate); }

.pdf-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.pdf-badge-done {
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.demo-pdf-hint {
  font-size: 12px;
  color: var(--slate);
  font-style: italic;
  padding-left: 4px;
}

/* === STEP 2: GENERATE === */
.generate-area {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 4px 12px rgba(27,67,50,0.25);
}
.btn-generate:hover { background: #153729; transform: translateY(-1px); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { background: var(--slate); cursor: not-allowed; transform: none; box-shadow: none; }

.demo-privacy { font-size: 12px; color: var(--slate); }

/* === STEP 3: PROCESSING === */
.processing-ui {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.processing-animation {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.processing-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.processing-icon {
  position: relative;
  z-index: 1;
  color: var(--accent);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-steps {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 8px;
}

.pstep {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--slate);
}

.pstep-done { color: var(--accent); }
.pstep-active { color: var(--fg); font-weight: 600; }

.pstep-icon { min-width: 18px; text-align: center; }

.pstep-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* === STEP 4: CARDS === */
.fsrs-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.fsrs-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
}
.fsrs-new { background: #DBEAFE; color: #1D4ED8; }
.fsrs-learning { background: var(--amber-light); color: var(--amber); }
.fsrs-review { background: #D1FAE5; color: #065F46; }

.fsrs-info {
  font-size: 12px;
  color: var(--slate);
  margin-left: 4px;
}

/* FLASHCARD */
.flashcard-container {
  perspective: 1200px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 24px;
  height: 240px;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.flashcard-inner.flipped { transform: rotateY(180deg); }

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.flashcard-front {
  background: var(--accent);
  color: #fff;
}

.flashcard-back {
  background: var(--surface);
  border: 2px solid var(--accent);
  transform: rotateY(180deg);
}

.fc-face-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 16px;
}

.fc-face-content {
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
}

.fc-tap-hint {
  font-size: 11px;
  opacity: 0.5;
  margin-top: auto;
  text-align: center;
}

.flashcard-front .fc-tap-hint { color: rgba(255,255,255,0.6); }
.flashcard-back .fc-tap-hint { color: var(--slate); }

/* Card grid for overview (optional) */
.flashcard-grid {
  display: none; /* show single card view by default */
}

/* CARD NAVIGATION */
.card-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}

.card-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  min-width: 60px;
  text-align: center;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-nav:hover { border-color: var(--accent); }
.btn-nav:disabled { opacity: 0.35; cursor: not-allowed; }

/* FSRS Rating buttons */
.fsrs-ratings {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.rating-btn {
  padding: 8px 18px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--fg);
}
.rating-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.rating-again { border-color: #FCA5A5; background: #FEF2F2; color: #991B1B; }
.rating-hard { border-color: #FDBA74; background: #FFF7ED; color: #9A3412; }
.rating-good { border-color: #86EFAC; background: #F0FDF4; color: #065F46; }
.rating-easy { border-color: #93C5FD; background: #EFF6FF; color: #1E40AF; }

/* === STEP 5: TUTOR === */
.tutor-panel {
  background: var(--bg);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.tutor-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.tutor-avatar {
  width: 40px;
  height: 40px;
  background: var(--amber-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber);
}

.tutor-name { font-size: 14px; font-weight: 600; color: var(--fg); }
.tutor-status { font-size: 12px; color: var(--slate); }

.tutor-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.tutor-q-btn {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.tutor-q-btn:hover { border-color: var(--accent); background: var(--bg); }

.tutor-input-row {
  display: flex;
  gap: 10px;
}

.tutor-input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
.tutor-input:focus { border-color: var(--accent); }

.btn-tutor-ask {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}
.btn-tutor-ask:hover { background: #153729; }
.btn-tutor-ask:disabled { background: var(--slate); cursor: not-allowed; }

.tutor-response {
  margin-top: 16px;
  padding: 16px;
  background: var(--surface);
  border-left: 3px solid var(--amber);
  border-radius: 0 10px 10px 0;
}

.tutor-answer-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
}

/* Tutor CTA */
.tutor-cta {
  background: var(--accent);
  border-radius: 12px;
  padding: 28px;
  color: #fff;
  text-align: center;
}

.tutor-cta h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.tutor-cta p { font-size: 14px; opacity: 0.8; margin-bottom: 20px; }

.btn-signup, .btn-primary {
  display: inline-block;
  padding: 12px 28px;
  background: var(--amber);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn-signup:hover, .btn-primary:hover { background: #B45309; }

.btn-ghost {
  display: inline-block;
  padding: 12px 24px;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: #fff;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s;
}
.btn-ghost:hover { border-color: #fff; }

.cta-actions { display: flex; gap: 12px; justify-content: center; align-items: center; }

/* === UTILS === */
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.4s ease-out; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.error-msg {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  color: #991B1B;
  margin-top: 8px;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
  .processing-ui { flex-direction: column; }
  .flashcard-container { height: 200px; }
  .cta-actions { flex-direction: column; }
  .tutor-input-row { flex-direction: column; }
}