/* App-style interactive demo — matches CSE Buddy+ mobile UI */
.demo-phone {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.demo-bezel {
  background: #111827;
  border-radius: 32px;
  padding: 10px;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.2);
}

.demo-appbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
}

.demo-appbar img {
  border-radius: 8px;
}

.demo-appbar-title {
  flex: 1;
  font-weight: 700;
  font-size: 0.92rem;
  color: #1f2937;
}

.demo-demo-pill {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #eff6ff;
  color: #2563eb;
  padding: 3px 8px;
  border-radius: 999px;
}

.demo-screen-title {
  background: #fff;
  padding: 10px 14px 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  border-bottom: 1px solid #f3f4f6;
}

.demo-scroll {
  background: #f9fafb;
  min-height: 440px;
  max-height: 440px;
  overflow-y: auto;
  padding: 12px;
}

.demo-bottom-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #fff;
  border-radius: 0 0 22px 22px;
  padding: 6px 4px 8px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.demo-nav-item {
  border: 0;
  background: transparent;
  padding: 4px 2px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #6b7280;
  font: inherit;
}

.demo-nav-item.is-active {
  background: #eff6ff;
  color: #3b82f6;
}

.demo-nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.demo-nav-label {
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
}

.demo-panel {
  animation: demoFade 0.18s ease;
}

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

.demo-welcome {
  background: linear-gradient(135deg, #4f46e5, #9333ea, #ec4899);
  border-radius: 20px;
  padding: 16px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 10px 24px rgba(147, 51, 234, 0.28);
}

.demo-welcome-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.demo-welcome h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.demo-welcome p {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.92;
}

.demo-days-pill {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.demo-group-live {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-radius: 16px;
  padding: 14px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.28);
}

.demo-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  flex-shrink: 0;
}

.demo-group-live-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.demo-group-time {
  font-size: 1.6rem;
  font-weight: 800;
  margin-right: 4px;
}

.demo-group-unit {
  font-size: 0.72rem;
  opacity: 0.95;
}

.demo-btn-join {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ea580c;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.demo-nav-svg {
  width: 20px;
  height: 20px;
  display: block;
}

.demo-showcase {
  padding: 56px 0 64px;
  background: linear-gradient(180deg, #fff 0%, #eff6ff 50%, var(--bg) 100%);
}

.demo-showcase-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.demo-showcase-wrap {
  max-width: 360px;
  margin: 24px auto 0;
}

.demo-scroll-btn {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #bfdbfe;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.demo-scroll-btn:hover {
  background: #eff6ff;
  text-decoration: none;
}

.phone-mock {
  text-align: center;
}

.demo-group-live-head {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.demo-group-live-head span:first-child {
  font-size: 1.3rem;
}

.demo-group-live-head p {
  margin: 4px 0 0;
  font-size: 0.72rem;
  opacity: 0.92;
}

.demo-group-live strong {
  font-size: 0.88rem;
}

.demo-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.demo-action-card {
  border: 0;
  border-radius: 14px;
  padding: 14px 10px;
  text-align: left;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.demo-action-card strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.demo-action-card span {
  font-size: 0.68rem;
  opacity: 0.9;
}

.demo-action-pink {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
}

.demo-action-blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.demo-section-label {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f2937;
}

.demo-study-banner {
  width: 100%;
  border: 0;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  color: #fff;
  cursor: pointer;
  font: inherit;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.demo-study-banner strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.demo-study-banner span {
  display: block;
  font-size: 0.72rem;
  opacity: 0.92;
  margin-bottom: 8px;
}

.demo-study-banner em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 700;
}

.demo-overlay {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: flex-end;
  padding: 12px;
  border-radius: 12px;
  z-index: 2;
}

.demo-home {
  position: relative;
}

.demo-overlay-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  width: 100%;
  max-height: 85%;
  overflow-y: auto;
}

.demo-overlay-close {
  float: right;
  border: 0;
  background: #f3f4f6;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}

.demo-subject-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.demo-subject-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #6b7280;
}

.demo-subject-chip.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.demo-exam-modes {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.demo-exam-mode {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
}

.demo-exam-mode.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.demo-q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.demo-chip-subject {
  font-size: 0.68rem;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  padding: 3px 8px;
  border-radius: 999px;
}

.demo-q-count {
  font-size: 0.65rem;
  color: #6b7280;
}

.demo-question {
  margin: 0 0 12px;
  font-size: 0.86rem;
  line-height: 1.45;
  font-weight: 600;
  color: #1f2937;
}

.demo-options {
  display: grid;
  gap: 8px;
}

.demo-option {
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  color: #1f2937;
}

.demo-option:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.demo-option.is-correct {
  border-color: #34d399;
  background: #ecfdf5;
}

.demo-option.is-wrong {
  border-color: #f87171;
  background: #fef2f2;
}

.demo-option.is-muted {
  opacity: 0.5;
}

.demo-option:disabled {
  cursor: default;
}

.demo-option-label {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e5e7eb;
  font-weight: 700;
  font-size: 0.68rem;
  margin-right: 6px;
}

.demo-explanation {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #eff6ff;
  font-size: 0.78rem;
  color: #1e40af;
}

.demo-result-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.demo-score {
  font-size: 1.6rem;
  font-weight: 800;
  color: #2563eb;
  margin: 8px 0;
}

.demo-note {
  font-size: 0.72rem;
  color: #6b7280;
  margin: 8px 0 0;
}

.demo-btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  cursor: pointer;
  margin-top: 8px;
  width: 100%;
}

.demo-btn-light {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.demo-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.demo-timer-bar {
  font-size: 0.72rem;
  color: #6b7280;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.demo-leaderboard {
  list-style: none;
  margin: 0;
  padding: 0;
}

.demo-leader-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  background: #fff;
  margin-bottom: 6px;
  border: 1px solid #e5e7eb;
}

.demo-leader-row.is-you {
  background: #eff6ff;
  border-color: #93c5fd;
  font-weight: 600;
}

.demo-create-card {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  border-radius: 18px;
  padding: 16px;
  color: #fff;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.28);
}

.demo-create-card strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.demo-create-card p {
  margin: 0 0 10px;
  font-size: 0.72rem;
  opacity: 0.92;
}

.demo-create-card-inner .demo-btn {
  margin-top: 0;
}

.demo-exam-list-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
}

.demo-exam-list-section {
  border-color: #c4b5fd;
  background: #faf5ff;
}

.demo-exam-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.demo-exam-list-head strong {
  font-size: 0.86rem;
  color: #1f2937;
}

.demo-exam-list-meta {
  margin: 0 0 10px;
  font-size: 0.72rem;
  color: #6b7280;
}

.demo-badge-official,
.demo-badge-section {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
}

.demo-badge-official {
  background: #dbeafe;
  color: #1d4ed8;
}

.demo-badge-section {
  background: #ede9fe;
  color: #6d28d9;
}

.demo-back-link {
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 8px;
  margin-bottom: 4px;
}

.demo-form-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
}

.demo-form-title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: #1f2937;
}

.demo-form-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #374151;
}

.demo-form-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.demo-form-toggle-btn {
  flex: 1;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
}

.demo-form-toggle-btn.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.demo-subject-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.demo-subject-pick {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  color: #6b7280;
}

.demo-subject-pick.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.demo-section-list {
  margin-bottom: 12px;
}

.demo-section-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.demo-section-banner {
  font-size: 0.68rem;
  font-weight: 700;
  color: #6d28d9;
  background: #ede9fe;
  padding: 6px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.demo-group-exam-card {
  margin-bottom: 10px;
}

.demo-group-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  margin-bottom: 10px;
  opacity: 0.95;
}

.demo-btn-join-full {
  width: 100%;
  text-align: center;
}

.demo-flashcard {
  width: 100%;
  min-height: 150px;
  border: 2px solid #bfdbfe;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  font: inherit;
  color: #1f2937;
  margin-bottom: 10px;
}

.demo-flashcard-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  color: #3b82f6;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.demo-flashcard p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.demo-flashcard-hint {
  display: block;
  margin-top: 10px;
  font-size: 0.68rem;
  color: #6b7280;
}

.demo-deck-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 8px;
}

.demo-sr-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.demo-sr-btn {
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.demo-study-body {
  font-size: 0.82rem;
  color: #4b5563;
  line-height: 1.5;
}

.demo-tip {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.78rem;
}

.demo-profile-head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  border: 1px solid #e5e7eb;
}

.demo-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.demo-profile-head p {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: #6b7280;
}

.demo-streak {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: #ea580c;
}

.demo-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.demo-stat {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
}

.demo-stat strong {
  display: block;
  font-size: 0.95rem;
  color: #2563eb;
}

.demo-stat span {
  font-size: 0.62rem;
  color: #6b7280;
}

.demo-bar-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 6px;
  align-items: center;
  font-size: 0.65rem;
  margin-bottom: 6px;
  background: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.demo-bar {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.demo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 999px;
}

.demo-bar-pct-50 { width: 50%; }
.demo-bar-pct-55 { width: 55%; }
.demo-bar-pct-60 { width: 60%; }
.demo-bar-pct-65 { width: 65%; }
.demo-bar-pct-70 { width: 70%; }
.demo-bar-pct-71 { width: 71%; }
.demo-bar-pct-75 { width: 75%; }
.demo-bar-pct-78 { width: 78%; }
.demo-bar-pct-80 { width: 80%; }
.demo-bar-pct-82 { width: 82%; }
.demo-bar-pct-84 { width: 84%; }
.demo-bar-pct-85 { width: 85%; }
.demo-bar-pct-90 { width: 90%; }
.demo-bar-pct-95 { width: 95%; }
.demo-bar-pct-100 { width: 100%; }

.demo-loading,
.demo-error {
  text-align: center;
  color: #6b7280;
  padding: 48px 16px;
  font-size: 0.88rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.store-btn.secondary {
  background: #fff;
  color: #2563eb;
  border: 2px solid #bfdbfe;
}

.demo-hero-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 8px;
}

@media (max-width: 800px) {
  .demo-showcase-wrap {
    max-width: 100%;
  }

  .demo-phone {
    max-width: 100%;
  }

  .demo-scroll {
    min-height: min(400px, 56vh);
    max-height: min(400px, 56vh);
  }

  .demo-bezel {
    border-radius: 24px;
    padding: 8px;
  }

  .demo-nav-label {
    font-size: 0.5rem;
  }
}

@media (max-width: 380px) {
  .demo-scroll {
    min-height: min(340px, 50vh);
    max-height: min(340px, 50vh);
  }

  .demo-nav-item {
    padding: 3px 1px;
  }

  .demo-option {
    font-size: 0.75rem;
    padding: 9px 10px;
  }
}
