/* shared/css/flowchart.css — CSS variables, page layout, modals */

/* ─── Variables ──────────────────────────────────────────────────────── */
:root {
    --fc-primary:       #4f46e5;
    --fc-primary-light: #818cf8;
    --fc-bg:            #f8fafc;
    --fc-card:          #ffffff;
    --fc-text:          #1e293b;
    --fc-muted:         #64748b;
    --fc-border:        #e2e8f0;
    --fc-correct:       #10b981;
    --fc-incorrect:     #ef4444;
    --fc-active:        #f59e0b;
    --fc-radius:        12px;
    --fc-mono:          'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* ─── Page structure ─────────────────────────────────────────────────── */

.fc-page-body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
    background: #f1f5f9;
    color: #0f172a;
    margin: 0;
    padding: 1rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.fc-page-header {
    text-align: center;
    margin-bottom: 1.5rem;
    max-width: 800px;
    width: 100%;
}

.fc-page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.fc-page-back:hover { color: var(--fc-primary); }

.fc-page-title    { margin: 0; color: var(--fc-primary); font-size: 1.85rem; letter-spacing: -0.02em; }
.fc-page-subtitle { color: #475569; font-size: 0.95rem; margin-top: 0.4rem; line-height: 1.5; }

.fc-kbd {
    background: #fff;
    border-radius: 4px;
    padding: 2px 5px;
    font-family: var(--fc-mono);
    font-size: 0.85em;
    border: 1px solid #e2e8f0;
    border-bottom-width: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    color: #334155;
}
.fc-kbd-xs { font-size: 0.75em; opacity: 0.6; }

/* ─── Toolbar ────────────────────────────────────────────────────────── */

.fc-page-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    justify-content: center;
}

.fc-toolbar-pill {
    background: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fc-toolbar-val   { color: var(--fc-primary); font-weight: 700; }
.fc-toolbar-timer { font-family: var(--fc-mono); color: #64748b; font-variant-numeric: tabular-nums; }

.fc-page-reset {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.fc-page-reset:hover { border-color: #64748b; color: #0f172a; transform: translateY(-1px); }

/* ─── Main layout ────────────────────────────────────────────────────── */

.fc-page-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 1rem auto 0;
}

#_fcCanvas {
    height: 72vh;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.04);
}

.fc-page-banner {
    display: none;
    background: var(--fc-correct);
    color: white;
    padding: 1.25rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    margin-top: 2rem;
    box-shadow: 0 10px 25px rgba(16,185,129,0.3);
    text-align: center;
}

/* ─── Modals ─────────────────────────────────────────────────────────── */

.fc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fc-modal-card {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.fc-cheatsheet-modal { max-width: 700px; }

.fc-modal-close {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    background: #f1f5f9; border: none; font-size: 1rem; cursor: pointer; color: #64748b;
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.fc-modal-close:hover { background: #e2e8f0; color: #0f172a; }

.fc-modal-h2      { color: var(--fc-primary); margin-top: 0; }
.fc-modal-hint    { margin-top: 1.5rem; font-size: 0.8rem; color: #64748b; text-align: center; }
.fc-diagram-hint  { font-size: 0.75rem; color: #64748b; text-align: center; margin: 1rem 0 0.4rem; }

.fc-patho-box {
    font-size: 0.95rem;
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 10px;
    border-left: 4px solid var(--fc-primary);
    margin: 1rem 0;
    line-height: 1.6;
}
.fc-patho-divider { opacity: 0.1; margin: 1rem 0; }

.fc-help-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.fc-help-table tr { border-bottom: 1px solid #f1f5f9; }
.fc-help-table tr:last-child { border-bottom: none; }
.fc-help-table td { padding: 9px 0; }
.fc-help-table td:last-child { color: #64748b; }

.fc-stats-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f1f5f9;
    border-radius: 12px;
}
.fc-stat-cell  { text-align: center; }
.fc-stat-label { font-size: 0.8rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; }
.fc-stat-val   { font-size: 1.5rem; font-weight: 700; color: var(--fc-primary); }

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1000px) {
    .fc-page-layout { grid-template-columns: 1fr; }
    .fc-mcq-panel   { position: static; width: 100%; order: -1; }
}
