/* Serial Position Effect Demo Styles */

.serial-instructions {
  text-align: center;
  padding: var(--space-8);
}

.serial-instructions .instruction-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.serial-instructions .instruction-subtext {
  color: var(--fg-muted);
  line-height: 1.6;
}

/* Word Display */
.serial-display {
  text-align: center;
  padding: var(--space-8);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.current-word {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.current-word.visible {
  opacity: 1;
  transform: translateY(0);
}

.word-position {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Input Area */
.serial-input {
  text-align: center;
  padding: var(--space-6);
}

.input-prompt {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.input-hint-top {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
}

.words-input {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: var(--space-4);
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  width: 100%;
  max-width: 400px;
  resize: none;
  border-radius: 0;
}

.words-input:focus {
  outline: none;
  border-color: var(--fg);
}

#submitBtn {
  margin-top: var(--space-4);
}

/* Feedback */
.serial-feedback {
  text-align: center;
  padding: var(--space-6);
}

.feedback-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-5);
}

.feedback-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.feedback-word {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
}

.feedback-word.recalled {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

.feedback-word.missed {
  opacity: 0.5;
}

.position-chart {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  height: 120px;
  margin-bottom: var(--space-5);
  padding: 0 var(--space-4);
}

.position-bar {
  width: 24px;
  background: var(--border);
  transition: height 0.5s ease, background 0.3s ease;
}

.position-bar.recalled {
  background: var(--fg);
}

.position-bar.primacy {
  background: var(--fg);
}

.position-bar.recency {
  background: var(--fg);
}

.position-bar.middle {
  background: var(--fg-muted);
}

.feedback-summary {
  color: var(--fg-muted);
}

/* Results */
.serial-results {
  text-align: center;
  padding: var(--space-6);
}

.results-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
}

.results-chart-container {
  margin-bottom: var(--space-5);
}

.results-chart {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 6px;
  height: 150px;
  margin-bottom: var(--space-3);
  padding: 0 var(--space-4);
}

.result-bar {
  width: 28px;
  transition: height 0.5s ease;
}

.result-bar.primacy {
  background: var(--fg);
}

.result-bar.middle {
  background: var(--fg-muted);
}

.result-bar.recency {
  background: var(--fg);
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* Legend */
.results-legend {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.legend-bar {
  width: 16px;
  height: 16px;
}

.legend-bar.primacy,
.legend-bar.recency {
  background: var(--fg);
}

.legend-bar.middle {
  background: var(--fg-muted);
}

.results-insight {
  color: var(--fg-muted);
  line-height: 1.6;
  max-width: 450px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 600px) {
  .current-word {
    font-size: 2rem;
  }

  .position-chart,
  .results-chart {
    gap: 3px;
  }

  .position-bar {
    width: 18px;
  }

  .result-bar {
    width: 20px;
  }

  .results-legend {
    gap: var(--space-4);
  }
}
