/* Shared component vocabulary.
 *
 * Transcribed from topics.css, which is the polished reference. Pages loading
 * this file must NOT also define their own .primary-btn / .panel / .empty-state
 * — that duplication is what made the teacher pages look like a different
 * product. topics.css itself is deliberately left alone so its page cannot
 * regress; the two files never load together.
 */

/* ── Panels (topics.css:367-373) ──────────────────────────────────── */
.panel {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.panel-kicker {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}
.panel-kicker.sub {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.primary-btn {
    border: none;
    background: linear-gradient(120deg, #2563eb, #4338ca);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease;
}
.primary-btn:hover {
    transform: translateY(-1px);
}
.ghost-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 10px;
    cursor: pointer;
}
.ghost-btn--small {
    padding: 0.45rem 0.85rem;
    font-size: 0.85rem;
}
.primary-btn .loading-label { display: none; }
.primary-btn.loading .default-label { display: none; }
.primary-btn.loading .loading-label { display: inline; }

/* ── Modals (topics.css:712-780) ──────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 51;
    pointer-events: none;
}
.modal.hidden { display: none; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 50;
    pointer-events: auto;
}
.modal-backdrop.hidden { display: none; }
.modal-content {
    background: var(--bg-primary);
    border-radius: 18px;
    padding: 2rem;
    width: min(520px, 90vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(148, 163, 184, 0.3);
    position: relative;
    pointer-events: auto;
}
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.2rem;
}
.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ── Drawer (new) ─────────────────────────────────────────────────── */
/* Right-side slide-in, built on the same transform/transition mechanism as
 * topics.css's .session-panel--history rather than a new interaction.
 * Surface colours come from the panel tokens, so dark mode needs no extra block. */
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(420px, 100vw);
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
    padding: 1.75rem;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 60;
    overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 59;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
    .drawer, .drawer-backdrop { transition: none; }
}

/* ── Empty state — the single canonical definition ────────────────── */
.empty-state {
    color: var(--text-secondary);
}
.empty-state.small {
    font-size: 0.9rem;
}

/* ── Status pills (teacher.css:98-148) ────────────────────────────── */
.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-pill.pending,
.status-pill.unassigned {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.status-pill.generating {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info-color);
}

.status-pill.ready {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.status-pill.in_progress {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-color);
}

.status-pill.completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
}

.status-pill.failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error-color);
}

.status-pill.draft {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.status-pill.published {
    background: rgba(37, 99, 235, 0.15);
    color: var(--info-color);
}
