/* Session editor shell, form cards, layout grid, action buttons, homework switch, progress bar, draft toast */

/* ── Session editor shell ── */
.session-editor-shell {
    max-width: 660px;
    padding: 0 4px;
}

.session-editor-head {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2ece5;
}

.session-editor-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.session-editor-form {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ── Session form cards ── */
.session-form-card {
    background: #ffffff;
    padding: 4px 0;
}

.session-form-card + .session-form-card {
    border-top: 1px solid #e8eee9;
    padding-top: 24px;
}

.session-form-card-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #5f6b65;
    margin-bottom: 12px;
}

/* ── Progress card surface ── */
.session-form-card--progress {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 6px rgba(15, 23, 42, .05), 0 2px 4px rgba(15, 23, 42, .04);
}

.session-form-card--progress input[type="range"],
.session-form-card--progress textarea {
    background: #ffffff;
}

/* ── Layout grid ── */
.session-editor-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.session-editor-row--three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.session-editor-col {
    min-width: 0;
}

.session-editor-col--span-2 {
    grid-column: span 2;
}

/* ── Action buttons ── */
.session-view-actions,
.session-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 16px;
    border-top: var(--ghost-border);
}

.session-editor-primary {
    padding: 8px 18px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: var(--font-body);
    cursor: pointer;
    transition: opacity 120ms ease;
}

.session-editor-primary:hover {
    opacity: 0.88;
}

.session-editor-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.session-editor-secondary {
    padding: 8px 18px;
    border: var(--ghost-border);
    border-radius: 10px;
    background: transparent;
    color: var(--on-surface-variant);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.session-editor-secondary:hover {
    background: var(--surface-container-low);
    color: var(--on-surface);
}

.session-editor-danger {
    color: var(--error);
}

.session-editor-danger:hover {
    background: color-mix(in srgb, var(--error) 8%, transparent);
    color: var(--error);
}

/* ── Draft toast notification ── */
.draft-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Homework Assigned custom switch (Progress card) ── */
.homework-switch-group {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    padding: 16px 0;
    border-bottom: 1px solid #dce6df;
}

.homework-switch-group .homework-switch-label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

/* Visually hide the native checkbox while keeping it accessible */
.homework-switch-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* The pill track */
.homework-switch-track {
    display: inline-block;
    position: relative;
    width: 40px;
    height: 24px;
    border-radius: 12px;
    background-color: #d1d5db;
    flex-shrink: 0;
    transition: background-color 0.2s ease;
}

/* The thumb */
.homework-switch-track::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

/* Checked state — track colour and thumb slide */
.homework-switch-input:checked ~ .homework-switch-track {
    background-color: var(--primary);
}

.homework-switch-input:checked ~ .homework-switch-track::before {
    transform: translateX(16px);
}

/* Focus-visible ring on the track when keyboard-navigating */
.homework-switch-input:focus-visible ~ .homework-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.homework-switch-text {
    font-size: 14px;
    color: #374151;
}

/* ── Progress bar ── */
.progress-track {
    width: 100%;
    height: 6px;
    background: var(--secondary-container);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--primary-container));
    border-radius: 9999px;
    transition: width 300ms ease;
}
