/* =====================================================
   Wisdom Flashcards — wfc-style.css
   ===================================================== */

/* Reset & container */
.wfc-app {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 720px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
  color: #1a2340;
}

/* ── Header ──────────────────────────────────────── */
.wfc-header {
  background: linear-gradient(135deg, #1e6b3c 0%, #2d9b5a 100%);
  border-radius: 16px 16px 0 0;
  padding: 1.5rem 2rem;
  color: #fff;
  box-shadow: 0 4px 20px rgba(30,107,60,.25);
}
.wfc-header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.wfc-logo { font-size: 2.4rem; line-height: 1; }
.wfc-title {
  margin: 0 0 .2rem;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.3px;
}
.wfc-subtitle {
  margin: 0;
  font-size: .85rem;
  opacity: .85;
}

/* ── Controls ────────────────────────────────────── */
.wfc-controls {
  background: #f5f9f6;
  border: 1px solid #d4e8da;
  border-top: none;
  padding: 1rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  justify-content: space-between;
}
.wfc-select {
  padding: .5rem .9rem;
  border: 1.5px solid #b6d9c2;
  border-radius: 8px;
  background: #fff;
  font-size: .9rem;
  color: #1a2340;
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
}
.wfc-select:focus { border-color: #2d9b5a; }

.wfc-btn-group { display: flex; gap: .5rem; }

/* ── Buttons ─────────────────────────────────────── */
.wfc-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
  white-space: nowrap;
}
.wfc-btn:hover { transform: translateY(-1px); }
.wfc-btn:active { transform: translateY(0); }

.wfc-btn-secondary {
  background: #fff;
  border: 1.5px solid #b6d9c2;
  color: #1e6b3c;
}
.wfc-btn-secondary:hover { background: #edf6f0; }

.wfc-btn-nav {
  background: #fff;
  border: 1.5px solid #c8d8f0;
  color: #2a4a8a;
  min-width: 90px;
  justify-content: center;
}
.wfc-btn-nav:hover { background: #eef2fb; }

.wfc-btn-correct {
  background: #1e6b3c;
  color: #fff;
  box-shadow: 0 3px 10px rgba(30,107,60,.3);
  flex: 1;
  justify-content: center;
  font-size: 1rem;
  padding: .7rem 1rem;
}
.wfc-btn-correct:hover { background: #155430; box-shadow: 0 5px 14px rgba(30,107,60,.4); }

.wfc-btn-wrong {
  background: #c0392b;
  color: #fff;
  box-shadow: 0 3px 10px rgba(192,57,43,.3);
  flex: 1;
  justify-content: center;
  font-size: 1rem;
  padding: .7rem 1rem;
}
.wfc-btn-wrong:hover { background: #a02f22; box-shadow: 0 5px 14px rgba(192,57,43,.4); }

.wfc-btn-primary {
  background: linear-gradient(135deg, #1e6b3c, #2d9b5a);
  color: #fff;
  padding: .75rem 2.5rem;
  font-size: 1rem;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(30,107,60,.35);
}
.wfc-btn-primary:hover { opacity: .9; }

/* ── Progress ─────────────────────────────────────── */
.wfc-progress-wrap {
  background: #fff;
  border: 1px solid #d4e8da;
  border-top: none;
  padding: .85rem 1.5rem;
}
.wfc-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: #556b6a;
  margin-bottom: .5rem;
  font-weight: 500;
}
.wfc-progress-bar-bg {
  background: #e2f0e7;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.wfc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1e6b3c, #50c888);
  border-radius: 999px;
  transition: width .4s ease;
}

/* ── Card stage ───────────────────────────────────── */
.wfc-stage {
  perspective: 1200px;
  min-height: 300px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1.5rem 0 .75rem;
}

.wfc-card {
  width: 100%;
  max-width: 680px;
  position: relative;
  cursor: pointer;
  outline: none;
}
.wfc-card:focus-visible .wfc-card-inner {
  box-shadow: 0 0 0 3px #2d9b5a, 0 8px 30px rgba(0,0,0,.12);
}

.wfc-card-inner {
  position: relative;
  width: 100%;
  min-height: 260px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,.2,.2,1);
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0,0,0,.10);
}

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

.wfc-card-front,
.wfc-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  text-align: center;
}

.wfc-card-front {
  background: linear-gradient(160deg, #fff 60%, #edf6f0 100%);
  border: 2px solid #d4e8da;
}

.wfc-card-back {
  background: linear-gradient(160deg, #1a2340 50%, #1e3a5f 100%);
  border: 2px solid #2a4a8a;
  transform: rotateY(180deg);
  color: #fff;
}

.wfc-card-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #e2f0e7;
  color: #1e6b3c;
  padding: .25rem .8rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
}
.wfc-label-answer {
  background: rgba(255,255,255,.15);
  color: #a8d8b8;
}

.wfc-card-text {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.6;
  font-weight: 500;
  max-width: 580px;
}
.wfc-answer-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: #7ee8a2;
}

.wfc-hint {
  margin-top: 1.2rem;
  font-size: .78rem;
  color: #8aab9a;
  letter-spacing: .3px;
  animation: wfc-pulse 2s infinite;
}
@keyframes wfc-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

.wfc-category-badge {
  margin-top: 1.1rem;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255,255,255,.12);
  color: #afd4ff;
  padding: .25rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
}

/* ── Actions ─────────────────────────────────────── */
.wfc-actions {
  display: flex;
  gap: .75rem;
  padding: 0 0 1rem;
  transition: opacity .25s;
}
.wfc-actions.wfc-hidden { display: none; }

/* ── Navigation ──────────────────────────────────── */
.wfc-nav {
  display: flex;
  justify-content: space-between;
  padding: .25rem 0 1rem;
}

/* ── Summary ──────────────────────────────────────── */
.wfc-summary {
  text-align: center;
  background: linear-gradient(135deg, #edf6f0, #fff);
  border: 2px solid #b6d9c2;
  border-radius: 18px;
  padding: 2.5rem 2rem;
  margin-top: .5rem;
}
.wfc-summary h3 {
  margin: 0 0 .75rem;
  font-size: 1.5rem;
  color: #1e6b3c;
}
.wfc-summary p {
  font-size: 1rem;
  color: #445;
  margin-bottom: 1.5rem;
}
.wfc-summary.wfc-hidden { display: none; }

/* ── Utility ──────────────────────────────────────── */
.wfc-hidden { display: none !important; }
.wfc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 500px) {
  .wfc-header { padding: 1.2rem 1.2rem; }
  .wfc-title  { font-size: 1.15rem; }
  .wfc-card-front, .wfc-card-back { padding: 1.5rem 1.25rem; }
  .wfc-card-text { font-size: .97rem; }
  .wfc-controls { padding: .85rem 1rem; }
  .wfc-progress-wrap { padding: .7rem 1rem; }
}
