/**
 * lernkarten-review.css — FSRS Spaced Repetition Review Styles
 * Uses CSS variables from custom.css for theme consistency
 */

/* ── Page Layout ─────────────────────────────────────── */
.lr-page {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.lr-container {
  background: var(--card-bg, #ffffff);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.lr-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  margin: 0 0 0.25rem;
  text-align: center;
}

.lr-subtitle {
  text-align: center;
  color: var(--text-muted, #666);
  margin: 0 0 1.5rem;
  font-size: 1rem;
}

/* ── Stats Bar ───────────────────────────────────────── */
.lr-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary, #f8f9fa);
  border-radius: 12px;
}

.lr-stat {
  text-align: center;
}

.lr-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lr-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-primary, #1b5e20);
}

/* ── Card ────────────────────────────────────────────── */
.lr-card-wrapper {
  perspective: 1000px;
  margin-bottom: 1.5rem;
}

.lr-card {
  cursor: pointer;
  min-height: 260px;
}

.lr-card-inner {
  position: relative;
  width: 100%;
  min-height: 260px;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.lr-card-flipped {
  transform: rotateY(180deg);
}

.lr-card-front,
.lr-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 260px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 2px solid var(--border-color, #e0e0e0);
  background: var(--card-bg, #ffffff);
}

.lr-card-front {
  z-index: 2;
}

.lr-card-back {
  transform: rotateY(180deg);
  z-index: 1;
  border-color: var(--success-color, #4caf50);
  background: #f0fdf4;
}

.lr-card-content {
  width: 100%;
  text-align: center;
}

.lr-card-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  background: var(--bg-primary, #f0f0f0);
  color: var(--text-muted, #888);
}

.lr-card-back .lr-card-label {
  background: #d4edda;
  color: #155724;
}

.lr-card-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary, #333);
  line-height: 1.6;
  margin: 0;
  word-break: break-word;
}

.lr-card-hint {
  position: absolute;
  bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted, #999);
  margin: 0;
}

/* ── Topic Badge ─────────────────────────────────────── */
.lr-topic-badge {
  display: inline-block;
  padding: 4px 12px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ── Score Buttons ───────────────────────────────────── */
.lr-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.lr-btn {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #fff;
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.lr-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lr-btn:active {
  transform: translateY(0);
}

.lr-btn-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Button Colors */
.lr-btn-wiederholen {
  background: #dc3545;
}
.lr-btn-wiederholen:hover {
  background: #c82333;
}

.lr-btn-schwer {
  background: #f59e0b;
}
.lr-btn-schwer:hover {
  background: #d97706;
}

.lr-btn-gut {
  background: #10b981;
}
.lr-btn-gut:hover {
  background: #059669;
}

.lr-btn-leicht {
  background: #3b82f6;
}
.lr-btn-leicht:hover {
  background: #2563eb;
}

.lr-btn-primary {
  background: var(--brand-primary, #1b5e20);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.lr-btn-primary:hover {
  background: var(--brand-secondary, #2e7d32);
}

/* ── Loading ──────────────────────────────────────────── */
.lr-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted, #999);
  display: none;
}

/* ── Empty State ──────────────────────────────────────── */
.lr-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.lr-empty-icon {
  font-size: 3rem;
  color: var(--success-color, #4caf50);
  margin-bottom: 1rem;
}

.lr-empty-title {
  font-size: 1.5rem;
  color: var(--text-primary, #333);
  margin: 0 0 0.5rem;
}

.lr-empty-text {
  color: var(--text-muted, #999);
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ── Error State ──────────────────────────────────────── */
.lr-error {
  text-align: center;
  padding: 2rem 1rem;
}

.lr-error-icon {
  font-size: 2.5rem;
  color: var(--danger-color, #e74c3c);
  margin-bottom: 0.75rem;
}

.lr-error-msg {
  color: var(--text-primary, #333);
  font-size: 1rem;
  margin-bottom: 1rem;
}

/* ── Dark Mode ────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .lr-container {
    background: #1a1a2e;
  }

  .lr-title {
    color: #e0e0e0;
  }

  .lr-subtitle {
    color: #999;
  }

  .lr-stats {
    background: #1e1e3a;
  }

  .lr-stat-value {
    color: #7cb3ff;
  }

  .lr-card-front {
    background: #2a2a4e;
    border-color: #444;
  }

  .lr-card-back {
    background: #1a3a1a;
    border-color: #2d7d2d;
  }

  .lr-card-text {
    color: #e0e0e0;
  }

  .lr-card-back .lr-card-label {
    background: #1a3a1a;
    color: #7bc97b;
  }

  .lr-card-label {
    background: #333;
    color: #aaa;
  }

  .lr-empty-title {
    color: #e0e0e0;
  }

  .lr-topic-badge {
    background: #2a3a5e;
    color: #7cb3ff;
  }

  .lr-error-msg {
    color: #e0e0e0;
  }
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 600px) {
  .lr-container {
    padding: 1.25rem;
    border-radius: 12px;
  }

  .lr-title {
    font-size: 1.4rem;
  }

  .lr-stats {
    gap: 1rem;
    padding: 0.5rem;
  }

  .lr-stat-value {
    font-size: 1.2rem;
  }

  .lr-card-front,
  .lr-card-back {
    padding: 1.25rem;
    min-height: 200px;
  }

  .lr-card-text {
    font-size: 1rem;
  }

  .lr-btn {
    font-size: 0.8rem;
    padding: 0.6rem 0.75rem;
    min-width: 80px;
  }
}
