/* Hebroni — Hebrew Flashcards (/interactives/flashcards/)
   Self-contained: uses /en/en.css variables only (light + dark via [data-theme]). */

.hebrew {
  font-family: 'Frank Ruhl Libre', serif;
  direction: rtl;
  font-size: min(15vw, 96px);
}
.hebrew-sm {
  font-family: 'Frank Ruhl Libre', serif;
  direction: rtl;
  font-size: clamp(1.4rem, 5vw, 2.2rem);
}

/* ── Shell ── */
.fc-shell { max-width: 480px; margin: 0 auto; }

/* ── Filter bar + order toggle ── */
.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 20px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  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(--bg);
  font-weight: 600;
}

.order-toggle {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  font-family: inherit;
}
.order-toggle:hover { border-color: var(--gold); color: var(--gold); }
.order-toggle.active {
  background: var(--gold-bg);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

/* ── Progress bar ── */
.session-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.session-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-lt), var(--gold));
  transition: width 0.4s ease;
}
.session-counter {
  text-align: center;
  padding: 10px 0 4px;
  font-size: 0.8rem;
  color: var(--muted);
}

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

.card-scene {
  perspective: 1000px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.card-3d {
  width: 100%;
  height: min(56vw, 340px);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.card-3d.flipped { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.card-face.back {
  transform: rotateY(180deg);
  align-items: flex-start;
  justify-content: flex-start;
  overflow-y: auto;
  padding: 20px;
}

.card-front-symbol {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
}
.card-symbol-main { color: var(--text); }
.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 var(--border);
  padding-bottom: 10px; margin-bottom: 4px;
}
.card-back-symbol { color: var(--gold); font-weight: 700; font-size: clamp(2rem, 8vw, 3rem); line-height: 1; }
.card-name { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.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(--text-2); line-height: 1.4; }
.card-example { background: var(--gold-bg); border-radius: var(--radius-sm); padding: 8px 10px; margin-top: 4px; }
.card-example-word { color: var(--gold); display: block; }
.card-example-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }

/* ── Audio button ── */
.audio-btn {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gold-bg); border: 1px solid var(--border-ho);
  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: var(--gold-bg); transform: scale(1.1); border-color: var(--gold); }

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

/* ── Flip / action buttons ── */
#flipArea { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.action-btn.flip-btn {
  background: var(--gold); color: var(--bg); border: none;
  padding: 14px 20px; border-radius: 24px; font-size: 0.95rem; font-weight: 700;
  cursor: pointer; max-width: 220px; width: 100%;
  transition: background 0.15s, transform 0.12s;
}
.action-btn.flip-btn:hover { background: var(--gold-lt); transform: translateY(-1px); }
.swipe-hint { font-size: 0.75rem; color: var(--muted); text-align: center; opacity: 0.7; }

.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-radius: var(--radius);
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.2s ease; border: none;
}
.action-btn.review { background: rgba(192,57,43,0.12); border: 1px solid rgba(192,57,43,0.4); color: #c0392b; }
.action-btn.review:hover { background: rgba(192,57,43,0.2); }
.action-btn.know { background: rgba(45,158,95,0.12); border: 1px solid rgba(45,158,95,0.4); color: #2d9e5f; }
.action-btn.know:hover { background: rgba(45,158,95,0.2); }
.action-btn:active { transform: scale(0.97); }

/* ── Session complete ── */
.session-complete {
  display: none; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 0; 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); }
.complete-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.complete-actions button.en-btn-primary,
.complete-actions button.en-btn-secondary {
  cursor: pointer;
  font-family: inherit;
}
.complete-actions button.en-btn-primary { border: none; }
.complete-actions button.en-btn-secondary { background: transparent; }

/* ── Animations ── */
@keyframes flashGreen {
  0%   { box-shadow: inset 0 0 0 4px #2d9e5f, 0 0 40px rgba(45,158,95,0.4); }
  100% { box-shadow: var(--shadow); }
}
@keyframes flashRed {
  0%   { box-shadow: inset 0 0 0 4px #c0392b, 0 0 40px rgba(192,57,43,0.4); }
  100% { box-shadow: var(--shadow); }
}
.flash-know   { animation: flashGreen 0.5s ease-out; }
.flash-review { animation: flashRed 0.5s ease-out; }

@keyframes slideInRight { from { transform: translateX(60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft  { from { transform: translateX(-60px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.slide-in-right { animation: slideInRight 0.3s ease-out; }
.slide-in-left  { animation: slideInLeft 0.3s ease-out; }

@keyframes popIn {
  0%   { transform: scale(0) rotate(-15deg); opacity: 0; }
  70%  { transform: scale(1.1) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.pop-in { animation: popIn 0.6s cubic-bezier(0.175,0.885,0.32,1.275) forwards; }

/* ── Badge toast ── */
.badge-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--gold);
  border-radius: var(--radius); padding: 12px 20px;
  display: flex; align-items: center; gap: 12px;
  font-size: 0.95rem; color: var(--text); box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 9999; white-space: nowrap;
}
.badge-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.badge-toast-icon { font-size: 1.6rem; font-family: 'Frank Ruhl Libre', serif; }

/* ── Landscape phone: side-by-side card + buttons ── */
@media (orientation: landscape) and (max-height: 500px) {
  .card-area { flex-direction: row; padding: 10px 0; gap: 16px; }
  .card-scene { width: min(42vh, 280px); flex-shrink: 0; }
  .card-3d { height: min(42vh, 280px); }
  .action-buttons { flex-direction: column; gap: 10px; max-width: 160px; }
  #flipArea { gap: 8px; }
  .session-counter { padding: 4px 0 2px; font-size: 0.72rem; }
}

/* ── Bigger on desktop ── */
@media (min-width: 700px) {
  .fc-shell { max-width: 640px; }
  .card-scene { max-width: 560px; }
  .card-3d { height: min(46vw, 440px); }
  .hebrew { font-size: min(13vw, 130px); }
  .action-buttons { max-width: 560px; }
}
