/* ============================================================
   flashcards.css — iGeouz Flashcard System Styles
   ============================================================ */

/* ─── Page layout ─── */
.fc-guest-wall {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 4rem;
}

.fc-guest-content {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
    padding: 4rem 3rem;
}

.fc-guest-content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.fc-guest-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

/* ─── App shell ─── */
#fc-app {
    padding-top: 110px;
    padding-bottom: 5rem;
}

.fc-page {
    animation: fcFadeIn 0.35s ease;
}

@keyframes fcFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* ─── Page header row ─── */
.fc-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.fc-page-header h1 {
    font-size: 2.2rem;
    margin: 0;
}

.fc-page-header h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.fc-page-header p {
    color: var(--text-secondary);
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

/* ─── Empty state ─── */
.fc-empty {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--text-secondary);
}

.fc-empty i {
    font-size: 4rem;
    opacity: 0.35;
    display: block;
    margin-bottom: 1rem;
}

.fc-empty h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ─── Sets grid ─── */
.fc-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.fc-set-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
}

.fc-set-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

.fc-set-card-body {
    margin-bottom: 1.25rem;
}

.fc-set-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.fc-set-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.fc-set-count i {
    color: var(--accent-purple);
}

.fc-set-desc-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fc-set-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-glass);
    margin-top: auto;
}

.fc-set-card-actions .fc-study-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.fc-edit-btn,
.fc-share-btn,
.fc-delete-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    flex-shrink: 0;
}

.fc-edit-btn {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple, #8b5cf6);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.fc-edit-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.fc-delete-btn {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.fc-delete-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* ─── Editor Workspace ─── */
.fc-editor-workspace {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.fc-editor-meta {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
}

.fc-editor-meta-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-glass);
}

.fc-title-input,
.fc-desc-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-primary);
    font-family: var(--font-heading);
    padding: 0.5rem 0.5rem 0.5rem 0;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    border-radius: 4px 4px 0 0;
}

.fc-title-input {
    font-size: 1.8rem;
    font-weight: 700;
}

.fc-desc-input {
    font-size: 1rem;
    color: var(--text-secondary);
}

.fc-title-input:hover,
.fc-desc-input:hover {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: var(--border-glass);
}

.fc-title-input:focus,
.fc-desc-input:focus {
    border-bottom-color: var(--accent-purple);
    background: transparent;
}

/* ─── Editor Options (visibility + category) ─── */
.fc-editor-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}

.fc-control-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.fc-field-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* iOS Toggle Switch */
.fc-visibility-control {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fc-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.fc-toggle input {
    display: none;
}

.fc-toggle-switch {
    width: 50px;
    height: 28px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 30px;
    position: relative;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.fc-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.fc-toggle input:checked + .fc-toggle-switch {
    background: #10b981;
}

.fc-toggle input:checked + .fc-toggle-switch::after {
    transform: translateX(22px);
}

.fc-visibility-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    transition: color 0.3s;
}

.fc-visibility-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-left: 66px;
}

/* Custom Select Dropdown */
.fc-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.fc-select-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    color: var(--accent-purple);
    pointer-events: none;
}

.fc-select-arrow {
    position: absolute;
    right: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.fc-category-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.8rem 2.5rem 0.8rem 2.8rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.fc-category-select:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

.fc-category-select:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
/* ─── Public badge on dashboard cards ─── */
.fc-public-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.fc-private-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.fc-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-purple);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.1);
    white-space: nowrap;
}

.fc-set-meta-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}

/* Fallback margin for browsers without flex gap */
.fc-set-meta-row > * + * {
    margin-left: 0.5rem;
}

@supports (gap: 0.5rem) {
    .fc-set-meta-row > * + * {
        margin-left: 0;
    }
}

/* ─── Share button ─── */
.fc-share-btn {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.fc-share-btn:hover {
    background: #10b981;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.fc-share-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    transform: scale(0.95);
}

/* ─── View-only study banner ─── */
.fc-viewonly-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-md, 12px);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.fc-viewonly-banner i {
    font-size: 1.2rem;
    color: #10b981;
}

.fc-viewonly-banner strong {
    color: var(--text-primary);
}

/* ─── Card rows in editor ─── */
.fc-cards-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.fc-card-row {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    position: relative;
    transition: box-shadow 0.2s;
}

.fc-card-row:hover {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3);
}

.fc-card-row-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: start;
}

.fc-card-divider {
    width: 2px;
    min-height: 60px;
    background: var(--border-glass);
    align-self: stretch;
    margin-top: 24px;
}

.fc-card-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fc-field-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-purple);
}

.fc-field-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: none;
    outline: none;
    padding: 0.25rem 0;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.fc-field-input:focus {
    border-bottom-color: var(--accent-purple);
}

.fc-remove-card-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.3rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
}

.fc-remove-card-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Add card button */
.fc-add-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--border-glass);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.fc-add-card-btn:hover {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.06);
}

/* ─── Study mode ─── */
.fc-study-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fc-study-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    text-align: center;
}

.fc-study-counter {
    font-size: 0.9rem;
    color: var(--text-muted);
    min-width: 60px;
    text-align: right;
}

/* Progress bar */
.fc-progress-track {
    width: 100%;
    height: 6px;
    background: var(--border-glass);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.fc-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 99px;
    transition: width 0.4s ease;
    width: 0%;
}

.fc-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    margin-bottom: 2rem;
}

.fc-known-label   { color: #34d399; }
.fc-unknown-label { color: #f87171; }
.fc-known-label i   { color: #34d399; }
.fc-unknown-label i { color: #f87171; }

/* 3D Flip card */
.fc-card-scene {
    perspective: 1200px;
    margin: 0 auto 1.75rem;
    max-width: 640px;
}

.fc-flip-card {
    width: 100%;
    min-height: 260px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.35s cubic-bezier(0.445, 0.05, 0.55, 0.95);
    cursor: pointer;
    will-change: transform;
}

.fc-flip-card.flipped {
    transform: rotateY(180deg);
}

.fc-flip-front,
.fc-flip-back {
    position: absolute;
    inset: 0;
    min-height: 260px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    text-align: center;
    /* ── Critical fix: override glass-card properties that break
       backface-visibility in Chrome/WebKit/Blink ──
       backdrop-filter causes the compositor to render the element
       even when its backface should be hidden. */
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    /* Prevent glass-card transition from animating face properties
       during flip or hover — the PARENT handles the rotation. */
    transition: none;
}

/* Explicit identity transform on the front face.
   Some browsers need an actual transform (not just "none") on both
   faces for backface-visibility to be enforced in a preserve-3d context. */
.fc-flip-front {
    transform: rotateY(0deg);
}

.fc-flip-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg,
        rgba(139, 92, 246, 0.12) 0%,
        rgba(16, 185, 129, 0.08) 100%);
}

/* ── Fully neutralize .glass-card:hover on flip faces ──
   The global .glass-card:hover changes transform, background, and
   border-color. ALL of these must be cancelled on the flip faces,
   because any transform change will fight with the parent's rotateY
   and any visual change will re-trigger compositing that can break
   backface-visibility. */
.fc-flip-front.glass-card:hover,
.fc-flip-back.glass-card:hover {
    background: var(--bg-glass);
    border-color: var(--border-glass);
    box-shadow: var(--shadow-glass);
}

.fc-flip-front.glass-card:hover {
    transform: rotateY(0deg);
}

.fc-flip-back.glass-card:hover {
    transform: rotateY(180deg);
}

/* Disable pointer-events during slide-out / flip animation
   to prevent rapid-click glitches and double-fires */
.fc-flip-card.fc-animating {
    pointer-events: none;
}

/* Subtle hover feedback — applied to the SCENE container (not the
   flip-card!) because any filter/opacity on an element with
   transform-style:preserve-3d flattens the 3D context and breaks
   backface-visibility. A box-shadow on the scene is safe. */
.fc-card-scene:hover {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
    border-radius: var(--radius-lg);
}

.fc-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-purple);
    margin-bottom: 1rem;
    align-self: flex-start;
}

.fc-card-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

.fc-flip-hint {
    margin-top: 1.5rem;
    background: none;
    border: 1px solid var(--border-glass);
    border-radius: 99px;
    color: var(--text-muted);
    padding: 0.45rem 1.1rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.2s, border-color 0.2s;
}

.fc-flip-hint:hover {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

/* Known / Unknown buttons */
.fc-study-actions {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    animation: fcFadeIn 0.25s ease;
}

.fc-btn-unknown {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 0.7rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.fc-btn-unknown:hover { background: rgba(239,68,68,0.25); }

.fc-btn-known {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: #34d399;
    padding: 0.7rem 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.fc-btn-known:hover { background: rgba(52,211,153,0.25); }

/* Shuffle toggle */
.fc-shuffle-row {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.fc-toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.fc-toggle-label input { display: none; }

.fc-toggle-track {
    width: 38px;
    height: 20px;
    background: var(--border-glass);
    border-radius: 99px;
    position: relative;
    transition: background 0.25s;
}

.fc-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.25s;
}

.fc-toggle-label input:checked + .fc-toggle-track {
    background: var(--accent-purple);
}

.fc-toggle-label input:checked + .fc-toggle-track::after {
    transform: translateX(18px);
}

/* Summary screen */
.fc-summary {
    max-width: 480px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    animation: fcFadeIn 0.4s ease;
}

.fc-summary-icon {
    font-size: 4rem;
    margin-bottom: 1.25rem;
    color: #fbbf24;
}

.fc-summary h2 {
    font-size: 1.8rem;
    margin-bottom: 1.75rem;
}

.fc-summary-stats {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.fc-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.fc-stat span {
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1;
}

.fc-stat label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.fc-stat-known span   { color: #34d399; }
.fc-stat-unknown span { color: #f87171; }

.fc-summary-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    #fc-app {
        padding-top: 90px;
    }
    .fc-guest-wall {
        padding-top: 100px;
    }
}

@media (max-width: 768px) {
    #fc-app {
        padding-top: 80px;
        padding-bottom: 3rem;
    }
    .fc-guest-wall {
        padding-top: 90px;
        padding-bottom: 3rem;
    }
    .fc-guest-content {
        padding: 3rem 1.5rem;
    }
    .fc-page-header h1 {
        font-size: 1.8rem;
    }
    .fc-card-scene {
        max-width: 100%;
    }
    .fc-flip-card {
        min-height: 220px;
    }
    .fc-flip-front,
    .fc-flip-back {
        min-height: 220px;
        padding: 2rem 1.25rem;
    }
    .fc-card-text {
        font-size: 1.2rem;
    }
    .fc-editor-meta {
        padding: 1.5rem;
    }
    .fc-title-input {
        font-size: 1.4rem;
    }
    .fc-sets-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    .fc-study-actions {
        gap: 0.75rem;
    }
    .fc-btn-unknown,
    .fc-btn-known {
        padding: 0.75rem 1.5rem;
        min-height: 48px;
    }
    .fc-summary {
        padding: 2.5rem 1.5rem;
    }
    .fc-summary h2 {
        font-size: 1.5rem;
    }
    .fc-stat span {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .fc-card-row-inner {
        grid-template-columns: 1fr;
    }
    .fc-card-divider {
        width: 100%;
        min-height: 1px;
        height: 1px;
        margin-top: 0;
    }
    .fc-card-text {
        font-size: 1.1rem;
    }
    .fc-page-header h1 {
        font-size: 1.5rem;
    }
    .fc-page-header {
        gap: 0.75rem;
    }
    .fc-study-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }
    .fc-btn-unknown,
    .fc-btn-known {
        justify-content: center;
        min-height: 50px;
    }
    .fc-summary-stats {
        gap: 1.5rem;
    }
    .fc-summary-btns {
        flex-direction: column;
    }
    .fc-summary-btns .btn {
        width: 100%;
        justify-content: center;
    }
    .fc-sets-grid {
        grid-template-columns: 1fr;
    }
    .fc-set-card {
        padding: 1.25rem;
    }
    .fc-set-card-actions {
        flex-wrap: wrap;
    }
    .fc-set-card-actions .fc-study-btn {
        min-height: 44px;
    }
    .fc-editor-options {
        grid-template-columns: 1fr;
    }
    .fc-flip-card {
        min-height: 190px;
    }
    .fc-flip-front,
    .fc-flip-back {
        min-height: 190px;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    #fc-app {
        padding-top: 70px;
        padding-bottom: 2rem;
    }
    .fc-guest-wall {
        padding-top: 80px;
    }
    .fc-guest-content {
        padding: 2rem 1.25rem;
    }
    .fc-guest-content h1 {
        font-size: 1.5rem;
    }
    .fc-title-input {
        font-size: 1.2rem;
    }
    .fc-desc-input {
        font-size: 0.9rem;
    }
    .fc-editor-meta {
        padding: 1.25rem;
    }
    .fc-card-row {
        padding: 1rem;
    }
    .fc-add-card-btn {
        padding: 0.85rem;
        font-size: 0.9rem;
    }
    .fc-stat span {
        font-size: 2rem;
    }
    .fc-summary {
        padding: 2rem 1rem;
    }
    .fc-study-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .fc-study-counter {
        text-align: center;
    }
    .fc-progress-labels {
        margin-bottom: 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════ */
/* Community Flashcards (Discovery)                                   */
/* ═══════════════════════════════════════════════════════════════════ */
.pfc-section {
    padding: 60px 0 80px;
    border-top: 1px solid var(--border-glass);
}

.pfc-toolbar {
    display: flex;
    gap: 1rem;
    margin: 1.5rem auto 2.5rem;
    max-width: 640px;
    flex-wrap: wrap;
}

.pfc-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.65rem 1rem;
    min-width: 200px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pfc-search-wrap:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.pfc-search-wrap i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.pfc-search-input {
    flex: 1;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.pfc-cat-filter {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.65rem 2.5rem 0.65rem 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pfc-cat-filter:hover {
    border-color: rgba(16, 185, 129, 0.4);
}

.pfc-cat-filter:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.pfc-loader {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1rem;
}

@keyframes pfcSpin {
    to { transform: rotate(360deg); }
}

.pfc-spin {
    animation: pfcSpin 1s linear infinite;
    display: inline-block;
}

.pfc-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-size: 1rem;
}

.pfc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pfc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pfc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .pfc-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.pfc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pfc-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pfc-cat-general {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.pfc-cat-physical {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.pfc-cat-human {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
/* ─── Community Flashcards Section ─── */
.pfc-section {
    padding: 60px 0 80px;
    border-top: 1px solid var(--border-glass);
}

.pfc-toolbar {
    display: flex;
    gap: 1rem;
    margin: 2rem auto 2.5rem;
    max-width: 640px;
    flex-wrap: wrap;
}

.pfc-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    padding: 0.65rem 1rem;
    min-width: 200px;
    transition: border-color 0.2s;
}

.pfc-search-wrap:focus-within {
    border-color: #10b981;
}

.pfc-search-wrap i {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.pfc-search-input {
    flex: 1;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
}

.pfc-cat-filter {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    padding: 0.65rem 1rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.pfc-cat-filter:focus {
    border-color: #10b981;
}

.pfc-loader {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 1rem;
}

@keyframes pfcSpin {
    to { transform: rotate(360deg); }
}

.pfc-spin {
    animation: pfcSpin 1s linear infinite;
    display: inline-block;
}

.pfc-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 3rem;
    font-size: 1rem;
}

.pfc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.pfc-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pfc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .pfc-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.pfc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pfc-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pfc-cat-general {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.pfc-cat-physical {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.pfc-cat-human {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.pfc-cat-economic {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.pfc-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.2rem 0;
}

.pfc-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.pfc-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 0.5rem;
}

.pfc-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.pfc-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.pfc-study-btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.pfc-share-btn {
    padding: 0.6rem 0.8rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    color: #10b981;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.pfc-share-btn:hover {
    background: #10b981;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.pfc-share-btn.copied {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
    transform: scale(0.95);
}

@media (max-width: 600px) {
    .pfc-toolbar {
        flex-direction: column;
    }
    .pfc-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Flashcard Stats Mini (Dashboard) ─── */
.fc-set-stats-mini {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.fc-set-stats-mini span {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.fc-set-stats-mini span i {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* ─── Rating UI in Summary ─── */
.fc-rating-wrap {
    margin-bottom: 2rem;
    padding: 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    animation: fcSlideUp 0.4s easeOutBack;
}

@keyframes fcSlideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.fc-rating-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.fc-stars {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.fc-stars i {
    font-size: 1.75rem;
    color: var(--border-glass);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s;
}

.fc-stars i:hover {
    transform: scale(1.25);
    color: var(--accent-yellow, #fbbf24);
}

.fc-stars i.ph-fill {
    color: var(--accent-yellow, #fbbf24);
}

.fc-rating-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.fc-rating-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--accent-emerald, #10b981);
    font-weight: 600;
    animation: fcScaleIn 0.3s ease;
}

@keyframes fcScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
