/* ============================================================
   learn-flashcards.css
   Interactive flip-card board for /learn flashcard pages.
   Reads a global `flashcardData` and renders into #flashcard-board
   via learn-flashcards.js. Palette: blue / white / navy + teal.
   ============================================================ */

.fc-wrap {
    --fc-navy: #0a1330;
    --fc-teal: #2A9EA6;
    --fc-ink: #1a2340;
    --fc-line: #e5e9f2;
    --fc-muted: #64748b;
    margin: 28px 0 8px;
    font-family: Inter, "Inter Fallback", system-ui, sans-serif;
}

/* Toolbar */
.fc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.fc-modebtns {
    display: inline-flex;
    background: #eef2f8;
    border-radius: 10px;
    padding: 4px;
    gap: 2px;
}
.fc-modebtn {
    border: 0;
    background: transparent;
    color: var(--fc-muted);
    font: 600 14px/1 Inter, sans-serif;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .18s ease;
}
.fc-modebtn.is-on {
    background: #fff;
    color: var(--fc-navy);
    box-shadow: 0 1px 3px rgba(10,19,48,.12);
}
.fc-modebtn svg { width: 16px; height: 16px; }

.fc-tools-right { display: inline-flex; align-items: center; gap: 12px; }
.fc-counter {
    font: 600 13px/1 Inter, sans-serif;
    color: var(--fc-muted);
    white-space: nowrap;
}
.fc-counter strong { color: var(--fc-teal); }
.fc-shuffle {
    border: 1px solid var(--fc-line);
    background: #fff;
    color: var(--fc-ink);
    font: 600 13px/1 Inter, sans-serif;
    padding: 9px 14px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all .18s ease;
}
.fc-shuffle:hover { border-color: var(--fc-teal); color: var(--fc-teal); }
.fc-shuffle svg { width: 15px; height: 15px; }

/* Progress bar */
.fc-progress {
    height: 6px;
    background: #eef2f8;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 18px;
}
.fc-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--fc-teal), #37b7bf);
    border-radius: 99px;
    transition: width .35s cubic-bezier(.4,0,.2,1);
}

/* ---------- Study (single card) ---------- */
.fc-stage { display: block; }
.fc-stage[hidden], .fc-board[hidden], .fc-done[hidden] { display: none; }

.fc-card {
    perspective: 1600px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    cursor: pointer;
}
.fc-card-inner {
    position: relative;
    width: 100%;
    min-height: 260px;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.4,.05,.2,1);
}
.fc-card.is-flipped .fc-card-inner { transform: rotateY(180deg); }

.fc-face {
    position: absolute;
    inset: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
    padding: 32px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.fc-front {
    background: #fff;
    border: 1px solid var(--fc-line);
    box-shadow: 0 18px 40px -22px rgba(10,19,48,.35), 0 2px 6px rgba(10,19,48,.05);
}
.fc-back {
    background: linear-gradient(155deg, #0d1b3e 0%, #12244f 100%);
    color: #eaf0ff;
    transform: rotateY(180deg);
    box-shadow: 0 18px 44px -20px rgba(10,19,48,.6);
    text-align: left;
    justify-content: flex-start;
}
.fc-tag {
    align-self: center;
    font: 700 11px/1 Inter, sans-serif;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--fc-teal);
    background: rgba(42,158,166,.1);
    padding: 5px 11px;
    border-radius: 99px;
    margin-bottom: 16px;
}
.fc-back .fc-tag { align-self: flex-start; background: rgba(255,255,255,.1); color: #8fe3e8; }
.fc-front-text { font: 700 22px/1.35 Inter, sans-serif; color: var(--fc-navy); }
.fc-back-label {
    font: 700 11px/1 Inter, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8fe3e8;
    margin-bottom: 10px;
}
.fc-back-text { font: 500 16.5px/1.55 Inter, sans-serif; color: #eaf0ff; }
.fc-back-text strong { color: #fff; }
.fc-hint {
    text-align: center;
    font: 500 12.5px/1 Inter, sans-serif;
    color: var(--fc-muted);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.fc-hint svg { width: 14px; height: 14px; opacity: .7; }

/* Controls */
.fc-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.fc-btn {
    border: 1px solid var(--fc-line);
    background: #fff;
    color: var(--fc-ink);
    font: 600 14px/1 Inter, sans-serif;
    padding: 12px 18px;
    border-radius: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all .16s ease;
}
.fc-btn:hover { border-color: #c9d2e3; transform: translateY(-1px); }
.fc-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.fc-btn svg { width: 16px; height: 16px; }
.fc-btn--again { color: #475569; }
.fc-btn--got {
    background: var(--fc-teal);
    border-color: var(--fc-teal);
    color: #fff;
}
.fc-btn--got:hover { background: #248f96; border-color: #248f96; }

/* ---------- Board (grid) ---------- */
.fc-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.fc-board .fc-card { max-width: none; margin: 0; }
.fc-board .fc-card-inner { min-height: 170px; }
.fc-board .fc-face { padding: 20px 18px; border-radius: 16px; }
.fc-board .fc-front-text { font-size: 16px; }
.fc-board .fc-back-text { font-size: 13.5px; line-height: 1.5; }
.fc-board .fc-card-inner:hover { box-shadow: 0 10px 24px -14px rgba(10,19,48,.4); }
.fc-board .fc-tag { font-size: 10px; margin-bottom: 10px; }

/* ---------- Completion / unlock panel ---------- */
.fc-done {
    text-align: center;
    background: linear-gradient(155deg, #0d1b3e 0%, #12244f 100%);
    color: #eaf0ff;
    border-radius: 20px;
    padding: 40px 28px;
    max-width: 560px;
    margin: 0 auto;
}
.fc-done h3 { font: 800 24px/1.25 Inter, sans-serif; color: #fff; margin: 0 0 10px; }
.fc-done p { font: 500 15.5px/1.55 Inter, sans-serif; color: #c3ceeb; margin: 0 auto 22px; max-width: 420px; }
.fc-done-stats { display: flex; justify-content: center; gap: 28px; margin-bottom: 24px; }
.fc-done-stat .n { display: block; font: 800 30px/1 Inter, sans-serif; color: #8fe3e8; }
.fc-done-stat .l { font: 600 12px/1 Inter, sans-serif; color: #9fb0d6; margin-top: 6px; }
.fc-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: var(--fc-teal);
    color: #fff;
    font: 700 15px/1 Inter, sans-serif;
    padding: 15px 26px;
    border-radius: 12px;
    text-decoration: none;
    transition: all .18s ease;
}
.fc-cta-btn:hover { background: #248f96; transform: translateY(-2px); }
.fc-cta-btn svg { width: 18px; height: 18px; }
.fc-done-again {
    display: block;
    margin-top: 16px;
    background: none;
    border: 0;
    color: #9fb0d6;
    font: 600 13px/1 Inter, sans-serif;
    cursor: pointer;
    width: 100%;
}
.fc-done-again:hover { color: #eaf0ff; text-decoration: underline; }

/* No-JS fallback */
.fc-noscript {
    border: 1px solid var(--fc-line);
    border-radius: 14px;
    padding: 18px 20px;
    background: #f8fafd;
    color: var(--fc-ink);
    font: 500 15px/1.55 Inter, sans-serif;
}

@media (max-width: 560px) {
    .fc-front-text { font-size: 19px; }
    .fc-card-inner { min-height: 240px; }
    .fc-controls .fc-btn { flex: 1 1 auto; justify-content: center; }
}
