/* Hebrew Learning App — Flashcards Stylesheet */

/* ── Page layout ── */
.flashcards-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: var(--nav-height);
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--ink-2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--ink-3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--muted-light);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}
.filter-chip:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.filter-chip.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

/* ── Progress bar ── */
.session-progress-bar {
  height: 3px;
  background: var(--ink-3);
  flex-shrink: 0;
}
.session-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.4s ease;
}

.session-counter {
  text-align: center;
  padding: 8px 16px 4px;
  font-size: 0.8rem;
  color: var(--muted-light);
  flex-shrink: 0;
}

/* ── Card area ── */
.card-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 24px;
  overflow: hidden;
  position: relative;
}

/* ── Card dimensions ── */
.card-scene {
  width: min(100%, 420px);
}

.card-3d {
  /* min() of vw, vh, and absolute cap — in landscape, vh is the small dimension */
  height: min(56vw, min(52vh, 340px));
}

.card-face {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.card-face.front {
  background: var(--paper);
}

.card-face.back {
  background: var(--ink-2);
  border: 1px solid rgba(255,255,255,0.08);
  overflow-y: auto;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 20px;
  gap: 0;
}

.card-front-symbol {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
}

.card-set-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 4px;
}

.card-tap-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 8px;
  opacity: 0.7;
}

/* ── Card back content ── */
.card-back-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.card-back-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 10px;
  margin-bottom: 4px;
}

.card-back-symbol {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--gold);
  direction: rtl;
  line-height: 1;
}

.card-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--paper);
}

.card-info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-info-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 600;
}

.card-info-value {
  font-size: 0.9rem;
  color: var(--paper);
  opacity: 0.9;
  line-height: 1.4;
}

.card-example {
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-top: 4px;
}

.card-example-word {
  font-family: 'Frank Ruhl Libre', serif;
  font-size: 1.3rem;
  color: var(--gold);
  direction: rtl;
  display: block;
}

.card-example-meta {
  font-size: 0.78rem;
  color: var(--muted-light);
  margin-top: 2px;
}

/* ── Audio button ── */
.audio-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(200, 168, 75, 0.15);
  border: 1px solid rgba(200, 168, 75, 0.3);
  color: var(--gold);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.audio-btn:hover {
  background: rgba(200, 168, 75, 0.25);
  transform: scale(1.1);
}

/* ── Action buttons ── */
.action-buttons {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
}

.action-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.action-btn.review {
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.4);
  color: #e55a4e;
}
.action-btn.review:hover {
  background: rgba(192, 57, 43, 0.25);
}

.action-btn.know {
  background: rgba(45, 158, 95, 0.15);
  border: 1px solid rgba(45, 158, 95, 0.4);
  color: #3dbf72;
}
.action-btn.know:hover {
  background: rgba(45, 158, 95, 0.25);
}

.action-btn.flip-btn {
  background: var(--accent);
  border: none;
  color: white;
  max-width: 200px;
}
.action-btn.flip-btn:hover {
  background: var(--accent-light);
}

.action-btn:active {
  transform: scale(0.97);
}

/* ── Mastered indicator ── */
.mastered-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 20px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}
.empty-state h2 { margin-bottom: 8px; }

/* ── Session complete ── */
.session-complete {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 20px;
}
.session-complete.visible { display: flex; }

.complete-icon {
  font-size: 4rem;
  line-height: 1;
  display: block;
}
.complete-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
}
.complete-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.complete-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold);
}
.complete-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-light);
}
.complete-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--gold);
  color: var(--ink);
}
.btn-primary:hover { background: var(--gold-light); }
.btn-secondary {
  background: var(--ink-3);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--paper);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

/* ── Swipe hint ── */
.swipe-hint {
  font-size: 0.75rem;
  color: var(--muted-light);
  text-align: center;
  opacity: 0.6;
}

/* ── Landscape phone: side-by-side card + buttons ── */
@media (orientation: landscape) and (max-height: 500px) {
  .card-area {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    gap: 16px;
  }

  .card-scene {
    width: min(42vh, 280px);
    flex-shrink: 0;
  }

  .card-3d {
    height: min(42vh, 280px);
  }

  /* buttons stack vertically on the right in landscape */
  .action-buttons {
    flex-direction: column;
    gap: 10px;
    max-width: 160px;
  }

  #flipArea {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .session-counter {
    padding: 4px 16px 2px;
    font-size: 0.72rem;
  }
}
