/* Teacher group & assignment pages */

.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* The form lives inside a drawer now, which already supplies the surface —
   no card chrome, no max-width, no bottom margin of its own. */
.teacher-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

/* textarea and select were never covered here. It went unnoticed while the
   form sat on a light page; inside a dark drawer an unstyled textarea renders
   stark white. */
.teacher-form input,
.teacher-form textarea,
.teacher-form 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);
    font: inherit;
}

.teacher-form textarea {
    resize: vertical;
    min-height: 6rem;
}

.teacher-form input:focus,
.teacher-form textarea:focus {
    outline: none;
    border-color: #2563eb;
}

.teacher-form[hidden] {
    display: none;
}

.groups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.group-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.group-card h2 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--text-primary);
}

.group-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.join-code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    letter-spacing: 0.15em;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.join-code strong {
    color: var(--text-primary);
}

.group-card .ghost-btn {
    margin-top: 0.5rem;
    align-self: flex-start;
    text-decoration: none;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--border-color-light);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(120deg, #2563eb, #4338ca);
    transition: width 0.3s ease;
}

.back-link {
    display: inline-block;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

.join-code .ghost-btn {
    font-family: 'Inter', sans-serif;
    letter-spacing: normal;
    margin-left: 0.5rem;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
}

.teacher-section {
    margin-bottom: 2.5rem;
}

.teacher-section h2 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.members-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 480px;
    padding: 0;
    margin: 0;
}

.members-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
}

.btn-danger {
    background: transparent;
    color: var(--error-color);
    border: 1.5px solid var(--error-color);
    padding: 0.4rem 0.9rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: var(--error-color);
    color: #fff;
}

.assignment-card {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    background: var(--bg-primary);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.assignment-card h3 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.assignment-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0.4rem 0 0;
}

.assignment-card .primary-btn {
    align-self: flex-start;
}

@media (max-width: 600px) {
    .teacher-header {
        flex-direction: column;
    }
}

/* ── Header actions ───────────────────────────────────────────────── */
.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.teacher-header-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ── Drawer chrome ────────────────────────────────────────────────── */
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.drawer-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.drawer--wide {
    width: min(720px, 100vw);
}

.drawer-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: -0.75rem 0 1.25rem;
}

.join-code-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.join-code-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.join-code-row strong {
    font-size: 1.25rem;
    letter-spacing: 0.12em;
}

/* ── Stepped composer ─────────────────────────────────────────────── */
.composer-step {
    border: none;
    border-top: 1px solid var(--border-color);
    padding: 1.1rem 0 0;
    margin: 0 0 0.6rem;
}

.composer-step:first-of-type { border-top: none; padding-top: 0; }

.composer-step legend {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 600;
    padding: 0;
    margin-bottom: 0.75rem;
}

.composer-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: linear-gradient(120deg, #2563eb, #4338ca);
    color: #fff;
    font-size: 0.8rem;
}

.teacher-form label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.6rem 0 0.25rem;
}

.label-hint { opacity: 0.7; }

.composer-note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.9rem;
}

.full-width { width: 100%; }

/* ── Segmented progress ───────────────────────────────────────────── */
/* Colours mirror the .status-pill palette in components.css so the bar and
   the pills below it cannot tell different stories about the same class. */
.progress-segments {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--border-color);
    margin: 0.75rem 0 0.6rem;
}

.progress-segments span { display: block; height: 100%; }
.seg-completed   { background: var(--success-color); }
.seg-in_progress { background: var(--warning-color); }
.seg-ready       { background: var(--info-color, #2563eb); }
.seg-generating  { background: var(--text-secondary); opacity: 0.45; }
.seg-failed      { background: var(--error-color); }

.progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ── Per-student grid ─────────────────────────────────────────────── */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.7rem;
}

.student-tile {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.student-tile.attention { border-color: var(--error-color); }

.student-tile-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.student-initial {
    flex: 0 0 auto;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    font-weight: 600;
    font-size: 0.85rem;
}

.student-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-when {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
