/**
 * History Scoring CSS - F-072
 * Styles for HistoryRenderer: describe-two inputs, essay inputs,
 * interpretation panels, live feedback sidebar, post-submit feedback.
 */

/* ==================== DESCRIBE-TWO INPUTS ==================== */

.history-describe-two {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}

.history-feature-box {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px;
}

.history-feature-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-feature-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.95rem;
  margin-bottom: 8px;
  box-sizing: border-box;
}

.history-feature-detail {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}

.history-feature-input:focus,
.history-feature-detail:focus {
  outline: none;
  border-color: var(--amber-500, #f59e0b);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

/* ==================== ESSAY INPUT ==================== */

.history-essay-container {
  position: relative;
  margin: 12px 0;
}

.history-essay-input {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #e2e8f0);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  box-sizing: border-box;
}

.history-essay-input:focus {
  outline: none;
  border-color: var(--amber-500, #f59e0b);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.history-word-count {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin-top: 4px;
}

/* ==================== INTERPRETATION PANELS ==================== */

.history-interpretations {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0;
}

.history-interp-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.history-interp-box strong {
  color: var(--amber-400, #fbbf24);
  display: block;
  margin-bottom: 6px;
}

.history-interp-box blockquote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--amber-500, #f59e0b);
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
}

/* ==================== SPaG INDICATOR ==================== */

.history-spag-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin: 8px 0;
  padding: 6px 10px;
  background: rgba(245, 158, 11, 0.08);
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

/* ==================== LIVE FEEDBACK SIDEBAR ==================== */

.history-live-feedback {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}

.history-live-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--amber-400, #fbbf24);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-live-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.history-live-item:last-child {
  border-bottom: none;
}

.history-live-label {
  color: var(--text-secondary, #94a3b8);
}

.history-live-value {
  color: var(--text-primary, #e2e8f0);
  font-weight: 500;
}

/* ==================== POST-SUBMIT FEEDBACK PANEL ==================== */

.history-post-submit {
  margin-top: 16px;
  animation: histFadeIn 0.3s ease-out;
}

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

.history-result-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 12px;
}

.history-result-score {
  font-size: 1.3rem;
  font-weight: 700;
}

.history-score-earned {
  color: var(--amber-400, #fbbf24);
}

.history-score-sep {
  color: var(--text-muted, #64748b);
  margin: 0 2px;
}

.history-score-max {
  color: var(--text-secondary, #94a3b8);
}

.history-spag-score {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}

.history-result-level {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.history-level-0 { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.history-level-1 { background: rgba(249, 115, 22, 0.2); color: #fdba74; }
.history-level-2 { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.history-level-3 { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.history-level-4 { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }

.history-level-desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
}

.history-result-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.history-result-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 8px 0;
}

/* Check items */
.history-check-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 3px 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.history-check-matched {
  color: var(--text-primary, #e2e8f0);
}

.history-check-missed {
  color: var(--text-muted, #64748b);
}

.history-missed-label {
  font-size: 0.78rem;
  color: #ef4444;
}

/* Evidence */
.history-evidence-found {
  font-size: 0.88rem;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 4px;
}

.history-evidence-comment {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
}

/* Explanation */
.history-explain-comment {
  font-size: 0.88rem;
  color: var(--text-primary, #e2e8f0);
  margin-bottom: 4px;
}

.history-causal-found {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
}

/* Argument structure */
.history-argument-items {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
}

.history-arg-check {
  font-size: 0.88rem;
  font-weight: 500;
}

.history-arg-yes { color: #22c55e; }
.history-arg-no { color: #ef4444; }

.history-arg-tip {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  font-style: italic;
  padding: 2px 0;
}

/* SPaG detail */
.history-spag-detail {
  display: flex;
  gap: 20px;
  font-size: 0.88rem;
  color: var(--text-primary, #e2e8f0);
}

/* Teaching feedback */
.history-teaching {
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.15);
}

.history-teaching .history-result-title {
  color: var(--amber-400, #fbbf24);
}

.history-teaching-text {
  font-size: 0.9rem;
  color: var(--text-primary, #e2e8f0);
  line-height: 1.5;
}

/* Model answer */
.history-model-answer {
  margin-top: 8px;
}

.history-model-toggle {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-secondary, #94a3b8);
  padding: 6px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.history-model-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.history-model-text {
  margin-top: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ==================== DISABLED STATE ==================== */

.history-feature-input:disabled,
.history-feature-detail:disabled,
.history-essay-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==================== MOBILE RESPONSIVE ==================== */

@media (max-width: 640px) {
  .history-result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .history-result-score {
    font-size: 1.1rem;
  }

  .history-argument-items {
    flex-direction: column;
    gap: 4px;
  }

  .history-spag-detail {
    flex-direction: column;
    gap: 4px;
  }

  .history-live-feedback {
    font-size: 0.82rem;
  }
}
