/* Shared curriculum -> stage -> grade picker (Scripts\curriculum-picker.js).
   Used on RegisterStudent, RegisterInstructor and MyCurriculum - one skin for all three, matching
   this repo's habit of a variables-driven look (var(--text-heading) / var(--brand) / var(--surface-page)
   from CSS\tokens.css) rather than page-specific colors. */

.curriculum-picker {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.picker-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: pickerStepIn 0.25s ease;
}

.picker-step[hidden] {
    display: none;
}

@keyframes pickerStepIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.picker-step-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-heading);
    font-size: 0.95rem;
}

.picker-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--surface-inverse);
    color: var(--text-on-inverse);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.picker-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.picker-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--surface-card);
    color: var(--text-heading);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.picker-card:hover {
    border-color: var(--brand);
    background: var(--brand-wash);
}

.picker-card.selected {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--text-on-brand);
    font-weight: 700;
}

.picker-card.has-selection:not(.selected) {
    border-color: var(--brand-hover);
}

.picker-card.has-selection:not(.selected)::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
}

.picker-card-check {
    font-size: 0.8rem;
}

.picker-step-actions {
    display: flex;
}

.picker-select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    color: var(--brand-ink);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.picker-select-all i {
    font-size: 0.78rem;
}

.picker-select-all:hover {
    color: var(--brand-active);
}

.picker-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.picker-chip {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--surface-card);
    color: var(--text-heading);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.picker-chip:hover {
    border-color: var(--brand);
}

.picker-chip.selected {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--text-on-brand);
    font-weight: 700;
}

.picker-selected-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--surface-sunken);
    border-radius: 10px;
}

.picker-selected-list[hidden] {
    display: none;
}

.picker-selected-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--surface-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-heading);
}

.picker-selected-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--surface-sunken);
    color: var(--text-heading);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.picker-selected-remove:hover {
    background: var(--error);
    color: var(--text-on-error);
}

.picker-summary {
    font-size: 0.85rem;
    color: var(--navy-light);
    font-weight: 600;
    min-height: 1em;
}

/* Normalized onto the app-wide breakpoint scale (see CSS/styles.css header): 600 -> 768. */
@media (max-width: 768px) {
    .picker-cards,
    .picker-chips {
        gap: 8px;
    }

    .picker-card,
    .picker-chip {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}
