/* ──────────────────────────────────────────────────
   Task Mode — immersive full-screen task renderer
   Shared by reading & listening templates
────────────────────────────────────────────────── */

/* Container that holds the injected template */
#taskApp {
    position: fixed;
    inset: 0;
    background: var(--bg);
    overflow-y: auto;
    z-index: 100;
    display: none;
    flex-direction: column;
    align-items: center;
}

#taskApp.show {
    display: flex;
}

/* ── Error / expired state ─────────────────────── */
.task-error-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
    gap: 16px;
}
.task-error-icon {
    font-size: 48px;
    opacity: 0.6;
}
.task-error-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--hard);
}
.task-error-msg {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 300px;
}

/* ── Shared task shell ─────────────────────────── */
.task-shell {
    width: 100%;
    max-width: 680px;
    padding: 40px 24px 80px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Badge + difficulty */
.task-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.task-type-badge {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(94, 234, 212, 0.12);
    color: var(--accent);
    border: 1px solid rgba(94, 234, 212, 0.25);
}
.task-type-badge.listening {
    background: rgba(189, 147, 249, 0.12);
    color: var(--logic-token);
    border-color: rgba(189, 147, 249, 0.25);
}
.task-difficulty-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* Title */
.task-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.35;
}

/* ── Reading: article body ─────────────────────── */
.task-article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    font-size: 15px;
    line-height: 1.85;
    color: var(--text);
    font-family: 'Noto Serif', serif;
}
.task-article .vocab-highlight {
    color: var(--accent);
    font-weight: 700;
    border-bottom: 1px dashed var(--accent);
    cursor: default;
}

/* ── Questions ─────────────────────────────────── */
.task-questions {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.task-question-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-question-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}
.task-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.18s;
    font-size: 14px;
    color: var(--text);
    text-align: left;
}
.task-option:hover {
    border-color: rgba(94, 234, 212, 0.4);
    background: var(--surface-2);
}
.task-option.selected {
    border-color: var(--accent);
    background: rgba(94, 234, 212, 0.08);
    color: var(--accent);
}
.task-option.correct {
    border-color: var(--easy);
    background: rgba(100, 255, 218, 0.08);
    color: var(--easy);
}
.task-option.wrong {
    border-color: var(--hard);
    background: rgba(244, 67, 54, 0.08);
    color: var(--hard);
}
.option-key {
    font-weight: 800;
    font-size: 13px;
    width: 22px;
    flex-shrink: 0;
}

/* ── Listening: audio player ───────────────────── */
.task-audio-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
}
.task-transcript-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
}
.task-audio-player {
    width: 100%;
    accent-color: var(--accent);
    border-radius: 8px;
}

/* ── Listening: fill-in-blanks ─────────────────── */
.task-blanks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.task-blank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-muted);
}
.task-blank-index {
    font-weight: 700;
    color: var(--logic-token);
    width: 20px;
    flex-shrink: 0;
}
.task-blank-input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    font-family: 'Roboto Mono', monospace;
    transition: border-color 0.18s;
    outline: none;
}
.task-blank-input:focus {
    border-color: var(--accent);
}
.task-blank-input.correct {
    border-color: var(--easy);
    color: var(--easy);
}
.task-blank-input.wrong {
    border-color: var(--hard);
    color: var(--hard);
}

/* ── Result reveal ─────────────────────────────── */
.task-result-banner {
    text-align: center;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.task-result-score {
    font-size: 36px;
    font-weight: 800;
    color: var(--accent);
}
.task-result-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Submit button ─────────────────────────────── */
.task-submit-btn {
    width: 100%;
    height: 54px;
    background: var(--accent);
    border: none;
    border-radius: 28px;
    color: #0A0E17;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(94, 234, 212, 0.25);
}
.task-submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(94, 234, 212, 0.4);
}
.task-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}
