/* =====================================================
   FLASHCARD MODE — flashcard-mode.css
   All selectors prefixed with .fc- to avoid collisions
   Design system: matches existing dark theme
   Background: #0a0a0f  Accent: #00d4aa  Cards: #1a1a2e
   ===================================================== */

/* ===== ROOT CONTAINER ===== */
.fc-root {
  min-height: 100vh;
  background: #0a0a0f;
  color: #e8e8ff;
  font-family: system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 4rem;
  box-sizing: border-box;
}

/* ===== SCREEN TRANSITIONS ===== */
.fc-screen {
  width: 100%;
  max-width: 700px;
  animation: fc-fade-in 0.3s ease;
}

@keyframes fc-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== BACK BUTTON ===== */
.fc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: #8888aa;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  padding: 0.4rem 0;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.fc-back-btn:hover { color: #00d4aa; }

/* ===== SECTION TITLE ===== */
.fc-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}
.fc-subtitle {
  font-size: 0.88rem;
  color: #8888aa;
  margin: 0 0 2rem;
}

/* =====================================================
   SUBJECT SELECTOR SCREEN
   ===================================================== */

.fc-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.fc-subject-btn {
  background: #1a1a2e;
  border: 1.5px solid #2a2a4a;
  border-radius: 12px;
  color: #e8e8ff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.fc-subject-btn:hover {
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.07);
  transform: translateY(-1px);
}
.fc-subject-btn.active {
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.12);
}
.fc-subject-btn .fc-sub-icon {
  font-size: 1.35rem;
}
.fc-subject-btn .fc-sub-name {
  color: #e8e8ff;
}
.fc-subject-btn .fc-sub-count {
  font-size: 0.75rem;
  font-weight: 400;
  color: #6666aa;
}

/* All subjects button */
.fc-subject-btn.fc-all {
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.08);
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}
.fc-subject-btn.fc-all.active {
  background: rgba(0, 212, 170, 0.18);
}

/* ===== COUNT PICKER ===== */
.fc-count-label {
  font-size: 0.82rem;
  color: #8888aa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.625rem;
}
.fc-count-row {
  display: flex;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}
.fc-count-btn {
  flex: 1;
  padding: 0.7rem;
  background: #1a1a2e;
  border: 1.5px solid #2a2a4a;
  border-radius: 10px;
  color: #e8e8ff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}
.fc-count-btn:hover {
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.07);
}
.fc-count-btn.active {
  border-color: #00d4aa;
  background: rgba(0, 212, 170, 0.15);
  color: #00d4aa;
}

/* ===== STATS PANEL ===== */
.fc-stats-panel {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  gap: 0;
}
.fc-stat-item {
  flex: 1;
  text-align: center;
  padding: 0 0.5rem;
  border-right: 1px solid #2a2a4a;
}
.fc-stat-item:last-child { border-right: none; }
.fc-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00d4aa;
  line-height: 1.2;
}
.fc-stat-label {
  font-size: 0.72rem;
  color: #6666aa;
  margin-top: 0.2rem;
  line-height: 1.3;
}
.fc-stat-item.fc-stat-due .fc-stat-value  { color: #f59e0b; }
.fc-stat-item.fc-stat-mastered .fc-stat-value { color: #22c55e; }

/* ===== START BUTTON ===== */
.fc-start-btn {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #00d4aa, #00a882);
  border: none;
  border-radius: 12px;
  color: #0a0a0f;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s;
  letter-spacing: 0.01em;
}
.fc-start-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.fc-start-btn:active { transform: translateY(0); }
.fc-start-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* =====================================================
   CARD SESSION SCREEN
   ===================================================== */

/* Progress bar */
.fc-progress-wrap {
  width: 100%;
  margin-bottom: 1.5rem;
}
.fc-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.fc-progress-text {
  font-size: 0.82rem;
  color: #8888aa;
}
.fc-progress-frac {
  font-size: 0.82rem;
  color: #e8e8ff;
  font-weight: 600;
}
.fc-progress-track {
  width: 100%;
  height: 5px;
  background: #2a2a4a;
  border-radius: 99px;
  overflow: hidden;
}
.fc-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d4aa, #00a882);
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* ===== FLASHCARD ===== */
.fc-card-scene {
  width: 100%;
  max-width: 600px;
  min-height: 280px;
  margin: 0 auto 1.5rem;
  perspective: 1000px;
  cursor: pointer;
}

.fc-card-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fc-card-face {
  position: absolute;
  top: 0; left: 0; right: 0;
  min-height: 280px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  padding: 2rem 1.75rem 1.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Front face */
.fc-card-front {
  background: #1a1a2e;
  border: 2px solid #00d4aa;
  box-shadow: 0 4px 24px rgba(0, 212, 170, 0.08);
  transition: box-shadow 0.25s;
}
.fc-card-scene:hover .fc-card-front {
  box-shadow: 0 8px 32px rgba(0, 212, 170, 0.15);
}

/* Back face */
.fc-card-back {
  background: #1e2a3a;
  border: 2px solid #2a4a6a;
  box-shadow: 0 4px 24px rgba(0, 180, 220, 0.08);
  transform: rotateY(180deg);
}

/* Subject badge */
.fc-subject-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 212, 170, 0.12);
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 99px;
  padding: 0.2rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #00d4aa;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Front question text */
.fc-question-text {
  font-size: 1.375rem;
  font-weight: 600;
  color: #e8e8ff;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

/* Tap hint */
.fc-tap-hint {
  font-size: 0.75rem;
  color: #5555aa;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.fc-tap-hint::before,
.fc-tap-hint::after {
  content: '';
  display: block;
  width: 20px;
  height: 1px;
  background: #3a3a6a;
}

/* Back: answer text */
.fc-answer-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #00d4aa;
  line-height: 1.4;
  margin-bottom: 0.875rem;
}

/* Back: explanation text */
.fc-explanation-text {
  font-size: 1rem;
  color: #9999bb;
  line-height: 1.6;
  max-width: 480px;
}

/* ===== RATING BUTTONS ===== */
.fc-rating-area {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  animation: fc-fade-in 0.3s ease;
}
.fc-rating-label {
  text-align: center;
  font-size: 0.8rem;
  color: #6666aa;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.875rem;
}
.fc-rating-row {
  display: flex;
  gap: 0.75rem;
}
.fc-rate-btn {
  flex: 1;
  padding: 0.875rem 0.5rem;
  border-radius: 12px;
  border: 1.5px solid transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.fc-rate-btn:hover { transform: translateY(-2px); }
.fc-rate-btn:active { transform: translateY(0); opacity: 0.85; }
.fc-rate-btn .fc-rate-icon { font-size: 1.25rem; }
.fc-rate-btn .fc-rate-label { font-size: 0.78rem; font-weight: 600; }
.fc-rate-btn .fc-rate-sub { font-size: 0.68rem; font-weight: 400; opacity: 0.7; }

.fc-rate-hard {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
.fc-rate-hard:hover { background: rgba(239, 68, 68, 0.2); border-color: #f87171; }

.fc-rate-ok {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}
.fc-rate-ok:hover { background: rgba(245, 158, 11, 0.18); border-color: #fbbf24; }

.fc-rate-easy {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
  color: #4ade80;
}
.fc-rate-easy:hover { background: rgba(34, 197, 94, 0.18); border-color: #4ade80; }

/* ===== FLIP INSTRUCTION (shown below card before flip) ===== */
.fc-flip-instruction {
  text-align: center;
  font-size: 0.78rem;
  color: #44447a;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  transition: opacity 0.3s;
}

/* =====================================================
   END / SUMMARY SCREEN
   ===================================================== */

.fc-summary-card {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.fc-summary-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}
.fc-summary-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.4rem;
}
.fc-summary-sub {
  font-size: 0.88rem;
  color: #6666aa;
  margin-bottom: 1.5rem;
}

.fc-summary-stats {
  display: flex;
  gap: 0;
  margin-bottom: 0;
}
.fc-summary-stat {
  flex: 1;
  padding: 0.875rem 0.5rem;
  border-right: 1px solid #2a2a4a;
  text-align: center;
}
.fc-summary-stat:last-child { border-right: none; }
.fc-summary-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.fc-summary-stat-label {
  font-size: 0.72rem;
  color: #6666aa;
  margin-top: 0.3rem;
}
.fc-summary-stat.fc-s-hard .fc-summary-stat-value  { color: #f87171; }
.fc-summary-stat.fc-s-ok   .fc-summary-stat-value  { color: #fbbf24; }
.fc-summary-stat.fc-s-easy .fc-summary-stat-value  { color: #4ade80; }

.fc-summary-actions {
  display: flex;
  gap: 0.75rem;
  flex-direction: column;
}
.fc-btn-primary {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #00d4aa, #00a882);
  border: none;
  border-radius: 12px;
  color: #0a0a0f;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
}
.fc-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.fc-btn-primary:active { transform: translateY(0); }

.fc-btn-secondary {
  width: 100%;
  padding: 0.9rem;
  background: transparent;
  border: 1.5px solid #2a2a4a;
  border-radius: 12px;
  color: #8888aa;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.fc-btn-secondary:hover { border-color: #00d4aa; color: #00d4aa; }

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

@media (max-width: 480px) {
  .fc-root { padding: 1rem 0.75rem 3rem; }
  .fc-question-text { font-size: 1.15rem; }
  .fc-answer-text   { font-size: 1.05rem; }
  .fc-explanation-text { font-size: 0.9rem; }
  .fc-selector-grid { grid-template-columns: 1fr 1fr; }
  .fc-stats-panel { flex-wrap: wrap; }
  .fc-stat-item { min-width: 33%; }
  .fc-rate-btn .fc-rate-sub { display: none; }
  .fc-summary-stat-value { font-size: 1.35rem; }
  .fc-card-face { padding: 1.5rem 1.25rem 1.25rem; }
}

/* ===== UTILITY ===== */
.fc-hidden { display: none !important; }
.fc-muted { color: #6666aa; }
