/* Flashcards MVP styles. Inherits theme tokens from theme-base.css.
   Class prefix: fc-  (flashcards). */

/* ---- start page ------------------------------------------------ */

.fc-start {
    max-width: 760px;
    margin: 2rem auto 4rem;
    padding: 0 1rem;
    color: var(--text-primary, #e6edf3);
}

.fc-start__header {
    margin-bottom: 1.5rem;
}

.fc-start__title {
    font-size: 2rem;
    margin: 0 0 0.25rem;
}

.fc-start__subtitle {
    color: var(--text-secondary, #9aa4af);
    margin: 0;
}

/* ---- stats panel (start page) -------------------------------- */

.fc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}
.fc-stats__group {
    border: 1px solid var(--border-color, #2a2f37);
    border-radius: 8px;
    padding: 0.75rem 1rem 1rem;
    background: var(--surface-1, #161b22);
}
.fc-stats__group-title {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary, #9aa4af);
}
.fc-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}
.fc-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.4rem 0.2rem;
}
.fc-stat__num {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
}
.fc-stat__label {
    font-size: 0.78rem;
    color: var(--text-secondary, #9aa4af);
    margin-top: 0.15rem;
}

@media (max-width: 640px) {
    .fc-stats { grid-template-columns: 1fr; }
    .fc-stats__grid { gap: 0.25rem; }
    .fc-stat__num { font-size: 1.2rem; }
}

.fc-start__messages {
    list-style: none;
    padding: 0.75rem 1rem;
    margin: 0 0 1rem;
    border-left: 3px solid #e0623d;
    background: rgba(224, 98, 61, 0.08);
}
.fc-start__message { margin: 0.25rem 0; }

.fc-start__form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ---- disease picker ------------------------------------------- */

.fc-picker {
    border: 1px solid var(--border-color, #2a2f37);
    border-radius: 8px;
    padding: 0.75rem 1rem 1rem;
    margin: 0;
}
.fc-picker__legend {
    padding: 0 0.5rem;
    font-weight: 600;
}
.fc-picker__group {
    margin-top: 0.5rem;
    padding: 0.25rem 0;
    border-top: 1px solid var(--border-color, #2a2f37);
}
.fc-picker__group:first-of-type { border-top: none; }
.fc-picker__group-title {
    cursor: pointer;
    padding: 0.35rem 0;
    font-weight: 600;
    list-style: revert;  /* keep disclosure triangle */
}
.fc-picker__group-count {
    color: var(--text-secondary, #9aa4af);
    font-weight: 400;
    margin-left: 0.5rem;
}
.fc-picker__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.25rem 1rem;
    padding: 0.4rem 0.25rem;
}
.fc-picker__item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.2rem 0;
    cursor: pointer;
}
.fc-picker__item input { margin-top: 0.25rem; }
.fc-picker__item-name { flex: 1; }
.fc-picker__item-counts {
    display: inline-flex;
    gap: 0.45rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-secondary, #9aa4af);
    font-variant-numeric: tabular-nums;
}
.fc-picker__item-high {
    color: #ffd766;
}
.fc-picker__empty {
    color: var(--text-secondary, #9aa4af);
    font-style: italic;
    padding: 1rem 0;
}

/* ---- filters --------------------------------------------------- */

.fc-filters {
    border: 1px solid var(--border-color, #2a2f37);
    border-radius: 8px;
    padding: 0.75rem 1rem 1rem;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}
.fc-filters__legend {
    padding: 0 0.5rem;
    font-weight: 600;
}
.fc-filters__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.fc-filters__field--wide { grid-column: span 2; }
.fc-filters__label {
    font-size: 0.9rem;
    color: var(--text-secondary, #9aa4af);
}
.fc-filters__select {
    padding: 0.4rem 0.5rem;
    background: var(--surface-1, #161b22);
    color: inherit;
    border: 1px solid var(--border-color, #2a2f37);
    border-radius: 6px;
}
.fc-filters__hint {
    font-size: 0.8rem;
    color: var(--text-secondary, #9aa4af);
}

.fc-start__submit {
    align-self: flex-start;
    background: #e0623d;
    color: #fff;
    border: none;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
}
.fc-start__submit:hover { background: #c5502e; }

/* ---- session shell -------------------------------------------- */

.fc-session {
    max-width: 760px;
    margin: 1.5rem auto 4rem;
    padding: 0 1rem;
    color: var(--text-primary, #e6edf3);
}
.fc-session__topbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.75rem;
}
.fc-session__progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.fc-session__counter {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary, #9aa4af);
    font-size: 0.9rem;
    min-width: 4ch;
    text-align: right;
}
.fc-session__bar {
    flex: 1;
    height: 6px;
    background: var(--border-color, #2a2f37);
    border-radius: 3px;
    overflow: hidden;
}
.fc-session__bar-fill {
    height: 100%;
    background: #4caf7c;
    transition: width 0.25s ease;
}
.fc-session__exit {
    color: var(--text-secondary, #9aa4af);
    text-decoration: none;
    border: 1px solid var(--border-color, #2a2f37);
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
}
.fc-session__exit:hover { color: var(--text-primary, #e6edf3); }

/* ---- card ----------------------------------------------------- */

.fc-card {
    background: var(--surface-1, #161b22);
    border: 1px solid var(--border-color, #2a2f37);
    border-radius: 10px;
    padding: 1.5rem 1.5rem 1rem;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.fc-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
}
.fc-card__tag {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: rgba(154, 164, 175, 0.15);
    color: var(--text-secondary, #9aa4af);
    text-transform: capitalize;
}
.fc-back-btn {
    display: inline-block;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: rgba(154, 164, 175, 0.15);
    color: var(--text-secondary, #9aa4af);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 0.2rem;
}
.fc-back-btn:hover {
    color: var(--text-primary, #e6edf3);
    background: rgba(154, 164, 175, 0.25);
}
.fc-card__tag--high { background: rgba(255, 193, 7, 0.18); color: #ffd766; }
.fc-card__tag--type { background: rgba(76, 175, 124, 0.15); color: #7be0a8; }
.fc-card__tag--section { background: rgba(100, 150, 220, 0.15); color: #a3c0e8; }
.fc-card__disease {
    margin-left: auto;
    color: var(--text-secondary, #9aa4af);
    font-style: italic;
}

.fc-card__body {
    font-size: 1.15rem;
    line-height: 1.55;
    margin: 0.5rem 0 1rem;
    white-space: pre-wrap;
}
.fc-card__body--front-recap {
    font-size: 1rem;
    color: var(--text-secondary, #9aa4af);
    margin-bottom: 0.5rem;
}
.fc-card__body--back { color: var(--text-primary, #e6edf3); }

/* Cloze-back body: same size/spacing as the front body so the
   reveal feels in-place (Anki-style), not a layout shift. */
.fc-card__body--cloze {
    font-size: 1.15rem;
    line-height: 1.55;
    margin: 0.5rem 0 1rem;
    white-space: pre-wrap;
    color: var(--text-primary, #e6edf3);
}

.fc-card__divider {
    border: none;
    border-top: 1px dashed var(--border-color, #2a2f37);
    margin: 0.75rem 0 1rem;
}

.fc-card__mnemonic,
.fc-card__references {
    font-size: 0.85rem;
    color: var(--text-secondary, #9aa4af);
    margin: 0.4rem 0;
}

/* "Read the mednote" deep link under the card body. */
.fc-card__mednote-link {
    display: inline-block;
    align-self: flex-start;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4caf7c;
    text-decoration: none;
}

.fc-card__mednote-link:hover {
    text-decoration: underline;
}

.fc-card__mednote-link:focus-visible {
    outline: 2px solid #4caf7c;
    outline-offset: 2px;
    border-radius: 3px;
}

.fc-card__actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.fc-reveal-btn {
    background: #4caf7c;
    color: #fff;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
}
.fc-reveal-btn:hover { background: #3d8e64; }

/* ---- cloze spans ---------------------------------------------- */

.fc-cloze {
    display: inline-block;
    padding: 0 0.35rem;
    border-radius: 4px;
    font-weight: 600;
}
.fc-cloze--masked {
    background: rgba(154, 164, 175, 0.25);
    color: var(--text-secondary, #9aa4af);
    letter-spacing: 0.15em;
}
.fc-cloze--revealed {
    background: rgba(76, 175, 124, 0.2);
    color: #7be0a8;
}

/* ---- rating row ----------------------------------------------- */

.fc-rating-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.fc-rating {
    border: none;
    padding: 0.85rem 0.5rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
}
.fc-rating--again { background: #d9534f; }
.fc-rating--hard  { background: #e0823d; }
.fc-rating--good  { background: #4caf7c; }
.fc-rating--easy  { background: #5293e0; }
.fc-rating:hover { filter: brightness(1.1); }

/* ---- summary -------------------------------------------------- */

.fc-summary {
    max-width: 600px;
    margin: 3rem auto;
    padding: 0 1rem;
    text-align: center;
    color: var(--text-primary, #e6edf3);
}
.fc-summary__title { font-size: 1.8rem; margin: 0 0 0.5rem; }
.fc-summary__lead { color: var(--text-secondary, #9aa4af); margin-bottom: 2rem; }
.fc-summary__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
    margin-bottom: 2rem;
}
.fc-summary__cell {
    padding: 1rem 0.5rem;
    border-radius: 8px;
    color: #fff;
}
.fc-summary__cell--again { background: #d9534f; }
.fc-summary__cell--hard  { background: #e0823d; }
.fc-summary__cell--good  { background: #4caf7c; }
.fc-summary__cell--easy  { background: #5293e0; }
.fc-summary__count { display: block; font-size: 1.8rem; font-weight: 700; }
.fc-summary__label { display: block; font-size: 0.85rem; opacity: 0.9; }
.fc-summary__again-btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    background: #e0623d;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
}
.fc-summary__again-btn:hover { background: #c5502e; }

/* ---- mobile --------------------------------------------------- */

@media (max-width: 640px) {
    .fc-filters { grid-template-columns: 1fr; }
    .fc-filters__field--wide { grid-column: span 1; }
    .fc-rating-row { gap: 0.35rem; }
    .fc-rating { padding: 0.7rem 0.3rem; font-size: 0.9rem; }
    .fc-card { padding: 1.1rem 1rem 0.9rem; }
    .fc-card__body { font-size: 1.05rem; }
}
