/* CSS Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #0f172a;
  color: #f1f5f9;
  line-height: 1.6;
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  background: #1e293b;
  border-bottom: 1px solid #334155;
  padding: 16px 24px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
}

.progress-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trial-counter {
  font-size: 0.95rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

.progress-bar-bg {
  width: 160px;
  height: 8px;
  background: #334155;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #38bdf8;
  transition: width 0.3s ease;
}

/* Main Content */
.main-content {
  flex: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
}

.screen-card {
  background: #1e293b;
  border-radius: 12px;
  padding: 32px 28px;
  border: 1px solid #334155;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.hidden {
  display: none !important;
}

.section-desc {
  color: #94a3b8;
  margin-bottom: 20px;
  font-size: 1rem;
}

/* Practice Banner */
.practice-alert {
  background: #78350f;
  color: #fef3c7;
  padding: 10px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
  border: 1px solid #b45309;
}

/* Practice Hint Card */
.practice-hint-card {
  background: #1e1b4b;
  border: 1px solid #6366f1;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.hint-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #a5b4fc;
  margin-bottom: 4px;
}

.hint-body {
  font-size: 0.9rem;
  color: #e0e7ff;
  margin-bottom: 8px;
}

.hint-expected {
  font-size: 0.88rem;
  color: #cbd5e1;
}

.badge-expected {
  display: inline-block;
  background: #312e81;
  color: #c7d2fe;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #4f46e5;
  font-weight: 600;
}

/* Calibration Grid */
.calibration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.calib-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.calib-card-good {
  border-color: #059669;
  background: #022c22;
}

.calib-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.calib-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.calib-info {
  padding: 12px 14px;
  flex: 1;
}

.calib-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.calib-title.jerk { color: #f97316; }
.calib-title.blur { color: #a855f7; }
.calib-title.ghosting { color: #818cf8; }
.calib-title.distortion { color: #f43f5e; }
.calib-title.seamless { color: #34d399; }

.calib-info p {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Single Video Arena */
.single-video-arena {
  max-width: 740px;
  margin: 0 auto 16px auto;
}

.single-video-box {
  background: #090d16;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #38bdf8;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

.video-label {
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  background: #1e293b;
  color: #e2e8f0;
  border-bottom: 1px solid #334155;
  text-align: center;
}

.single-video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.single-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-bottom-track {
  width: 100%;
  height: 4px;
  background: #1e293b;
  position: relative;
}

.video-track-fill {
  height: 100%;
  width: 0%;
  background: #38bdf8;
  transition: width 0.05s linear;
}

/* Synchronized Central Timeline */
.timeline-bar-container {
  max-width: 740px;
  margin: 0 auto 16px auto;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 16px;
}

.timeline-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.badge-status.playing {
  background: #064e3b;
  color: #34d399;
  border: 1px solid #059669;
}

.badge-status.looping {
  background: #78350f;
  color: #fbbf24;
  border: 1px solid #d97706;
}

.loop-count-text {
  color: #94a3b8;
  font-weight: 600;
}

.time-readout {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.timeline-track {
  position: relative;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: visible;
}

.timeline-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: #38bdf8;
  border-radius: 3px;
  transition: width 0.05s linear;
}

.timeline-scrubber {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #f8fafc;
  border: 2px solid #0284c7;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  transition: left 0.05s linear;
}

/* Controls Bar */
.video-controls-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* Questionnaire Card */
.questionnaire-card {
  max-width: 740px;
  margin: 0 auto 16px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-block {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 18px 20px;
}

.question-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.q-number {
  background: #38bdf8;
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.q-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
}

.q-guide {
  font-size: 0.85rem;
  color: #94a3b8;
  font-style: italic;
}

/* Choice Buttons */
.q1-choices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.q2-choices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

@media (max-width: 640px) {
  .q1-choices-grid {
    grid-template-columns: 1fr;
  }
  .q2-choices-grid {
    grid-template-columns: 1fr;
  }
}

.btn-choice {
  background: #1e293b;
  border: 1.5px solid #334155;
  border-radius: 8px;
  padding: 12px 14px;
  color: #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  transition: all 0.15s ease;
}

.btn-choice:hover {
  background: #273549;
  border-color: #475569;
}

.choice-icon {
  font-size: 1.15rem;
  line-height: 1.2;
}

.choice-text {
  display: flex;
  flex-direction: column;
}

.choice-text strong {
  font-size: 0.95rem;
  color: #f8fafc;
  margin-bottom: 2px;
}

.choice-text small {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.3;
}

/* Q1 Selected States */
.btn-q1[data-val="none"].selected {
  background: #064e3b;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}
.btn-q1[data-val="none"].selected .choice-text strong { color: #a7f3d0; }
.btn-q1[data-val="none"].selected .choice-text small { color: #d1fae5; }

.btn-q1[data-val="subtle"].selected {
  background: #78350f;
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
.btn-q1[data-val="subtle"].selected .choice-text strong { color: #fde68a; }
.btn-q1[data-val="subtle"].selected .choice-text small { color: #fef3c7; }

.btn-q1[data-val="obvious"].selected {
  background: #881337;
  border-color: #f43f5e;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.35);
}
.btn-q1[data-val="obvious"].selected .choice-text strong { color: #fecdd3; }
.btn-q1[data-val="obvious"].selected .choice-text small { color: #ffe4e6; }

/* Q2 Selected States */
.btn-q2.selected {
  border-width: 2px;
}

.btn-q2[data-val="none"].selected {
  background: #064e3b;
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}
.btn-q2[data-val="jerk"].selected {
  background: #7c2d12;
  border-color: #ea580c;
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.35);
}
.btn-q2[data-val="blur"].selected {
  background: #4c1d95;
  border-color: #a855f7;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}
.btn-q2[data-val="ghosting"].selected {
  background: #312e81;
  border-color: #6366f1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}
.btn-q2[data-val="distortion"].selected {
  background: #881337;
  border-color: #f43f5e;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.35);
}
.btn-q2[data-val="other"].selected {
  background: #1e3a8a;
  border-color: #3b82f6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35);
}

/* Action Submit Card */
.action-submit-card {
  max-width: 740px;
  margin: 0 auto;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 16px 20px;
}

.action-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.hint-text {
  font-size: 0.9rem;
  color: #f59e0b;
}

/* Generic Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: #0284c7;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #0369a1;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: #334155;
  color: #64748b;
  cursor: not-allowed;
}

.btn-secondary {
  background: #334155;
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: #475569;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1.1rem;
}

.btn-group-center {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

/* Survey Choices */
.survey-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.option-btn {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px 18px;
  color: #cbd5e1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s ease;
}

.option-btn:hover {
  background: #1e293b;
  border-color: #475569;
}

.option-btn.selected {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #fff;
  font-weight: 600;
}

.option-btn input[type="radio"] {
  accent-color: #38bdf8;
  width: 18px;
  height: 18px;
}

/* Thank You Box */
.thank-you-box {
  text-align: center;
  padding: 30px 10px;
}

.check-icon {
  width: 64px;
  height: 64px;
  background: #065f46;
  color: #34d399;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 20px auto;
  border: 2px solid #10b981;
}

.subtext {
  color: #94a3b8;
  margin-top: 8px;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  color: #64748b;
  font-size: 0.85rem;
  border-top: 1px solid #1e293b;
  margin-top: auto;
}
