/*
 * Quiz history cards (CSS-only styling; avoids JS inline styles)
 * Used by quiz/history.js
 */

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

.history-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  gap: 12px;

  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  min-height: 110px;
}

.history-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.history-type {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  font-size: 0.85rem;
  font-weight: 700;
  color: #3b82f6;
  white-space: nowrap;
}

.history-score {
  grid-column: 1 / -1;
  grid-row: 2 / 3;
  justify-self: center;
  align-self: center;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.history-score.score--good { color: #16a34a; }
.history-score.score--ok { color: #2563eb; }
.history-score.score--warn { color: #f59e0b; }
.history-score.score--bad { color: #ef4444; }

.history-improvement {
  grid-column: 1 / -1;
  grid-row: 2 / 3;
  justify-self: center;
  align-self: end;

  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  margin-top: 8px;
}

.history-improvement.improve--up {
  background: rgba(22, 163, 74, 0.15);
  color: #16a34a;
}

.history-improvement.improve--down {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.history-improvement.improve--same {
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
}

.history-improvement.improve--first {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.history-date {
  grid-column: 1 / 2;
  grid-row: 3 / 4;
  font-size: 0.75rem;
  color: #64748b;
  white-space: nowrap;
  align-self: end;
}

.history-details {
  grid-column: 2 / 3;
  grid-row: 3 / 4;

  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  align-items: end;
  justify-content: end;
}

.history-chip {
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  white-space: nowrap;
  color: #64748b;
  font-weight: 500;
}

.history-chip.chip--correct {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  font-weight: 600;
}

.history-chip.chip--wrong {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  font-weight: 600;
}

@media (max-width: 520px) {
  .history-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
  }

  .history-details {
    grid-column: 1 / -1;
    justify-content: start;
    flex-wrap: wrap;
  }
}
