/* study-flashcards.css -- Flashcard module filter, flashcard flip animation, card navigation, SRS buttons */

        /* Flashcard module filter bar */
        .flash-module-filter { display: flex; align-items: center; gap: 8px; margin: 0 auto 16px; max-width: 720px; width: 100%; flex-wrap: wrap; }
        .flash-filter-label { font-size: 14px; font-weight: 700; color: var(--study-text-secondary); white-space: nowrap; }
        .flash-filter-sep { width: 1px; height: 22px; background: var(--study-border); margin: 0 6px; flex-shrink: 0; }
        .flash-filter-chip {
            padding: 8px 18px; border-radius: 10px; border: 1.5px solid var(--study-border);
            background: var(--study-bg-card, #fff); color: var(--study-text-secondary);
            font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
            white-space: nowrap; transition: all 0.15s;
            box-shadow: 0 2px 0 var(--study-border), 0 3px 6px rgba(0,0,0,0.04);
        }
        .flash-filter-chip:hover {
            border-color: var(--study-accent); color: var(--study-text);
            transform: translateY(-1px);
            box-shadow: 0 3px 0 var(--study-border), 0 4px 8px rgba(0,0,0,0.06);
        }
        .flash-filter-chip:active {
            transform: translateY(1px);
            box-shadow: 0 1px 0 var(--study-border), 0 1px 3px rgba(0,0,0,0.04);
        }
        .flash-filter-chip.active {
            background: var(--study-accent); color: var(--study-accent-text, #fff);
            border-color: var(--study-accent);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 2px 0 color-mix(in srgb, var(--study-accent) 70%, #000), 0 4px 8px color-mix(in srgb, var(--study-accent) 25%, transparent);
        }
        .flash-filter-chip.active:hover {
            transform: translateY(-1px);
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 3px 0 color-mix(in srgb, var(--study-accent) 70%, #000), 0 5px 10px color-mix(in srgb, var(--study-accent) 30%, transparent);
        }
        .fc-scope-inline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-left: auto; }
        .module-cards-generating { max-width: 520px; margin: 60px auto 0; padding: 40px 32px; text-align: center; background: var(--study-bg-card, var(--bg-card, #fff)); border: 1px solid var(--study-border); border-radius: 16px; }
        .module-cards-generating h3 { font-size: 18px; font-weight: 700; color: var(--study-text); margin-bottom: 8px; }
        .module-cards-generating p { font-size: 14px; color: var(--study-text-secondary); line-height: 1.5; }
        @media (max-width: 768px) {
            .flash-module-filter { gap: 6px; margin-bottom: 12px; }
            .flash-filter-chip { padding: 7px 14px; font-size: 13px; }
            .flash-filter-label { font-size: 13px; }
            .module-cards-generating { margin: 40px 16px 0; padding: 28px 20px; }
            .module-cards-generating h3 { font-size: 16px; }
            .module-cards-generating p { font-size: 13px; }
        }

        /* Flashcard */
        .fc-container { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0; max-width: 720px; margin: 0 auto; width: 100%; }
        .fc-header { display: flex; align-items: flex-end; justify-content: space-between; width: 100%; margin-bottom: 20px; padding: 0 4px; }
        .fc-header-left { display: flex; flex-direction: column; gap: 4px; }
        .fc-deck-label { font-size: 13px; font-weight: 700; color: var(--study-text); }
        .fc-header-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
        .fc-counter { font-size: 22px; font-weight: 800; color: var(--study-text-secondary); }
        .fc-counter-current { color: var(--study-text); }
        .fc-counter-sep { color: var(--study-text-tertiary); font-weight: 400; margin: 0 2px; font-size: 18px; }
        .fc-progress-bar { width: 120px; height: 4px; background: var(--study-border); border-radius: 4px; overflow: hidden; }
        .fc-progress-fill { height: 100%; background: var(--study-accent); border-radius: 4px; transition: width 0.3s ease; }
        .fc-card-wrap { perspective: 1200px; width: 100%; aspect-ratio: 16/10; max-height: 420px; min-height: 280px; cursor: pointer; margin-bottom: 24px; transition: max-height 0.2s ease, min-height 0.2s ease, max-width 0.2s ease; }
        .fc-card-wrap[data-fc-size="sm"] { max-height: 300px; min-height: 200px; max-width: 560px; margin-left: auto; margin-right: auto; }
        .fc-card-wrap[data-fc-size="md"] { max-height: 420px; min-height: 280px; }
        .fc-card-wrap[data-fc-size="lg"] { max-height: 520px; min-height: 360px; }
        .fc-card-wrap[data-fc-size="xl"] { max-height: 640px; min-height: 440px; }
        .fc-card-wrap[data-fc-size="lg"] .fc-text,
        .fc-card-wrap[data-fc-size="xl"] .fc-text { font-size: 22px; }
        .fc-size-btn:hover { border-color: var(--study-accent) !important; color: var(--study-accent) !important; }
        .fc-size-btn.active { border-color: var(--study-accent) !important; color: var(--study-accent) !important; font-weight: 800; }

        /* Scope chips row, previously rendered inside the mode-btns bar.
           Now a standalone row that appears above the module tabs when a
           study-guide-scoped flashcard set is active. */
        .fc-scope-row {
            display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
            margin: 0 0 10px;
        }
        .fc-scope-row .fc-scope-inline {
            display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
        }

        /* Tiny square shuffle button, sits at the end of the SRS row next to
           the Easy button. Icon-only, same height as the SRS buttons. */
        .fc-shuffle-square {
            width: 44px; height: 72px;
            display: inline-flex; align-items: center; justify-content: center;
            margin-left: 6px;
            border-radius: 14px;
            border: 2.5px solid rgba(0,0,0,0.08);
            background: rgba(0,0,0,0.02);
            color: var(--study-text-secondary);
            cursor: pointer;
            font-family: inherit;
            box-shadow: 3px 3px 0 rgba(0,0,0,0.08);
            transition: all 0.15s;
        }
        .fc-shuffle-square:hover {
            border-color: var(--study-accent);
            color: var(--study-accent);
            transform: translate(-1px,-1px);
            box-shadow: 4px 4px 0 rgba(232,133,58,0.15);
        }
        .fc-shuffle-square:active {
            transform: translate(1px,1px);
            box-shadow: 1px 1px 0 rgba(0,0,0,0.08);
        }
        .fc-shuffle-square.active {
            background: var(--study-accent-dim);
            border-color: var(--study-accent);
            color: var(--study-accent);
        }
        .fc-shuffle-square i { width: 18px; height: 18px; }
        @media (max-width: 480px) {
            .fc-shuffle-square { width: 38px; height: 64px; border-radius: 12px; }
            .fc-shuffle-square i { width: 16px; height: 16px; }
        }

        /* Card size variants, drive off data-fc-size on .fc-card-wrap.
           Re-statement of the earlier rule so the breakpoints still apply. */
        .fc-card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.5s; border-radius: 20px; }
        .fc-card.flipped { transform: rotateY(180deg); }
        .fc-face {
            position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px;
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            padding: 40px 48px; text-align: center; border: 1px solid var(--study-border);
            box-shadow: 0 20px 50px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
        }
        .fc-front { background: var(--study-bg-secondary); }
        .fc-back { background: var(--study-accent-dim); transform: rotateY(180deg); border-color: var(--study-accent-dim, rgba(232,133,58,0.15)); }
        .fc-card-tag {
            position: absolute; top: 20px; left: 24px;
            display: flex; align-items: center; gap: 5px;
            font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
            color: var(--study-text-tertiary);
        }
        .fc-label { display: none; }
        .fc-text { font-size: 18px; line-height: 1.5; font-weight: 500; }
        .fc-text.fc-rich { text-align: center; }
        .fc-text.fc-rich p { margin: 0 0 8px; }
        .fc-text.fc-rich p:last-child { margin-bottom: 0; }
        .fc-text.fc-rich .mermaid-diagram { margin: 8px 0; font-size: 14px; }
        .fc-text.fc-rich pre { font-size: 13px; text-align: left; margin: 8px 0; border-radius: 8px; padding: 12px; background: var(--study-bg-tertiary); overflow-x: auto; }
        .fc-text.fc-rich code { font-size: 13px; }
        .fc-text.fc-rich ul, .fc-text.fc-rich ol { text-align: left; margin: 4px 0; padding-left: 20px; }
        .fc-hint {
            position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
            font-size: 11px; color: var(--study-text-tertiary); display: flex; align-items: center; gap: 6px;
            font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
        }
        .fc-hint kbd { padding: 2px 6px; background: var(--study-bg-tertiary); border-radius: 4px; font-size: 11px; font-family: inherit; }
        .fc-bottom-bar {
            display: flex; align-items: center; justify-content: space-between; width: 100%;
            padding: 16px 4px 0; margin-top: 8px;
        }
        .fc-bottom-btn {
            display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
            border: 1px solid var(--study-border); background: var(--study-bg-secondary);
            color: var(--study-text-secondary); font-size: 13px; font-weight: 600;
            cursor: pointer; transition: all 0.15s; font-family: inherit;
        }
        .fc-bottom-btn:hover { border-color: var(--study-accent); color: var(--study-accent); }
        .fc-bottom-btn:disabled { opacity: 0.3; cursor: not-allowed; }
        .fc-bottom-hint {
            font-size: 11px; color: var(--study-text-tertiary); display: flex; align-items: center; gap: 4px;
            text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
        }
        .fc-bottom-hint kbd { padding: 2px 8px; background: var(--study-bg-tertiary); border-radius: 6px; font-family: inherit; }
        .fc-actions { display: flex; gap: 12px; }
        .fc-btn { padding: 12px 28px; border-radius: 10px; border: none; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.15s; display: flex; align-items: center; gap: 6px; }
        .fc-btn i { width: 16px; height: 16px; }
        .fc-btn-wrong { background: rgba(239,68,68,0.15); color: var(--study-red); }
        .fc-btn-wrong:hover { background: rgba(239,68,68,0.25); }
        .fc-btn-right { background: rgba(34,197,94,0.15); color: var(--study-green); }
        .fc-btn-right:hover { background: rgba(34,197,94,0.25); }
        .fc-btn-skip { background: transparent; color: var(--study-text-tertiary); border: 1px solid var(--study-border); font-size: 12px; padding: 8px 16px; }
        .fc-btn-skip:hover { background: rgba(150,150,150,0.12); color: var(--study-text-muted); }
        .srs-actions { display: flex; gap: 12px; justify-content: center; }
        .srs-btn {
            flex-direction: column; align-items: center; min-width: 82px; padding: 14px 16px; gap: 4px;
            border-radius: 14px; font-size: 13px; font-weight: 800; border: 2.5px solid rgba(0,0,0,0.08);
            background: rgba(0,0,0,0.02); transition: all 0.15s; cursor: pointer;
            text-transform: uppercase; letter-spacing: 0.04em; display: flex;
            box-shadow: 3px 3px 0 rgba(0,0,0,0.08);
        }
        .srs-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 rgba(0,0,0,0.06); }
        .srs-btn i { width: 20px; height: 20px; margin-bottom: 1px; }
        .srs-interval { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.5; }
        .srs-again { color: #ef4444; border-color: rgba(239,68,68,0.3); }
        .srs-again:hover { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.5); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(239,68,68,0.12); }
        .srs-hard { color: #c47a3a; border-color: rgba(196,122,58,0.3); }
        .srs-hard:hover { background: rgba(196,122,58,0.08); border-color: rgba(196,122,58,0.5); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(196,122,58,0.12); }
        .srs-good { color: #537fcb; border-color: rgba(83,127,203,0.3); }
        .srs-good:hover { background: rgba(83,127,203,0.08); border-color: rgba(83,127,203,0.5); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(83,127,203,0.12); }
        .srs-easy { color: #3a9a5c; border-color: rgba(58,154,92,0.3); }
        .srs-easy:hover { background: rgba(58,154,92,0.08); border-color: rgba(58,154,92,0.5); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 rgba(58,154,92,0.12); }

/* --- Flashcard modes --- */
        /* ===== FLASHCARD MODES ===== */
        .fc-mode-btns{display:flex;gap:8px;margin:0 auto 12px;max-width:720px;width:100%;justify-content:flex-start;flex-wrap:wrap}
        .fc-mode-btn{display:flex;align-items:center;gap:6px;padding:8px 14px;border-radius:10px;border:1.5px solid var(--study-border);background:var(--study-bg-secondary);color:var(--study-text-secondary);font-size:.76rem;font-weight:700;cursor:pointer;font-family:inherit;transition:all .15s;box-shadow:2px 2px 0 rgba(0,0,0,.08)}
        .fc-mode-btn.active{border-color:var(--study-accent);color:var(--study-accent);background:color-mix(in srgb, var(--study-accent) 8%, transparent);box-shadow:2px 2px 0 rgba(232,133,58,.15),inset 0 1px 0 rgba(255,255,255,.3);font-weight:800}
        .fc-mode-btn:hover{color:var(--study-accent);border-color:var(--study-accent);transform:translate(-1px,-1px);box-shadow:3px 3px 0 rgba(232,133,58,.12)}
        .fc-mode-btn:active{transform:translate(1px,1px);box-shadow:1px 1px 0 rgba(0,0,0,.06)}

/* --- Flashcard count picker --- */
        /* ===== FLASHCARD COUNT PICKER ===== */
        .fc-count-dropdown .fc-count-menu{display:none;position:absolute;right:0;top:calc(100% + 4px);background:var(--study-card);border:1px solid var(--study-border);border-radius:10px;padding:4px;min-width:140px;z-index:100;box-shadow:0 8px 24px rgba(0,0,0,.3)}
        .fc-count-dropdown.open .fc-count-menu{display:flex;flex-direction:column}
        .fc-count-menu-item{padding:8px 12px;border:none;background:none;color:var(--study-text);font-size:.82rem;font-weight:500;cursor:pointer;font-family:inherit;border-radius:6px;text-align:left;transition:background .15s}
        .fc-count-menu-item:hover{background:var(--study-accent-dim,rgba(139,92,246,.08))}
        .fc-count-menu-item.active{color:var(--study-accent);font-weight:700}
        .fc-count-sub{font-size:.65rem;font-weight:500;color:var(--study-text-muted);display:block;margin-top:3px}


