/* Assessment answer UX enhancements (v2.4.75)
   Scoped to the student assessment page; no layout or anti-cheat changes. */

.jl-id-bank {
    margin: 0 0 1.35rem;
    padding: 1rem;
    border: 2px solid rgba(37, 99, 235, 0.28);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(239, 246, 255, 0.95), rgba(224, 242, 254, 0.72));
}

.jl-id-bank-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.35rem 0.75rem;
    margin-bottom: 0.7rem;
}

.jl-id-bank-title {
    color: #1d4ed8;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.jl-id-bank-hint {
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.45;
}

.jl-id-bank-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.jl-id-word {
    appearance: none;
    border: 1.5px solid #93c5fd;
    background: #ffffff;
    color: #1e3a8a;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    min-height: 42px;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.jl-id-word:hover {
    border-color: #2563eb;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.16);
}

.jl-id-word:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
}

.jl-id-word.is-selected {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(37, 99, 235, 0.3);
}

.jl-id-word.is-dragging {
    opacity: 0.45;
}

.jl-id-drop {
    position: relative;
    border-radius: 10px;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.jl-id-drop.is-dragover {
    background: rgba(37, 99, 235, 0.08);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.jl-id-drop.is-filled input {
    border-color: #10b981 !important;
    background: #f0fdf4 !important;
}

.jl-id-ghost {
    position: fixed;
    z-index: 2147483000;
    transform: translate(-50%, -50%);
    pointer-events: none;
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    border: 2px solid #2563eb;
    background: #ffffff;
    color: #1e3a8a;
    font-size: 0.86rem;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
}

.jl-letter-only {
    text-transform: uppercase;
}

.jl-letter-only::placeholder {
    text-transform: none;
}

.jl-essay-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-weight: 600;
}

.jl-essay-meta .jl-essay-min {
    color: #7c3aed;
}

.jl-essay-meta.is-below #essay-word-count-0,
.jl-essay-meta.is-below [id^="essay-word-count-"] {
    color: #b91c1c;
}

body.dark-mode .jl-id-bank,
[data-theme="dark"] .jl-id-bank {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.9));
    border-color: rgba(96, 165, 250, 0.35);
}

body.dark-mode .jl-id-bank-title,
[data-theme="dark"] .jl-id-bank-title {
    color: #93c5fd;
}

body.dark-mode .jl-id-bank-hint,
[data-theme="dark"] .jl-id-bank-hint {
    color: #cbd5e1;
}

body.dark-mode .jl-id-word,
[data-theme="dark"] .jl-id-word {
    background: #1e293b;
    color: #dbeafe;
    border-color: rgba(147, 197, 253, 0.45);
}

body.dark-mode .jl-id-word.is-selected,
[data-theme="dark"] .jl-id-word.is-selected {
    background: #2563eb;
    color: #ffffff;
}

body.dark-mode .jl-id-ghost,
[data-theme="dark"] .jl-id-ghost {
    background: #1e293b;
    color: #dbeafe;
}

@media (max-width: 1024px) {
    .jl-id-word {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .jl-id-bank {
        padding: 0.85rem;
    }

    .jl-id-bank-hint {
        font-size: 0.76rem;
    }

    .jl-id-word {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .jl-essay-meta {
        font-size: 0.78rem;
    }
}

/* Theme CSS (dusk-theme) forces .btn-primary back to inline-flex !important.
   Keep the assessment navigation's hidden state authoritative. */
#student-lesson-page #quiz-navigation #prev-page-btn.jl-nav-hidden,
#student-lesson-page #quiz-navigation #next-page-btn.jl-nav-hidden,
#student-lesson-page #quiz-navigation #submit-quiz-btn.jl-nav-hidden {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .jl-id-word,
    .jl-id-drop {
        transition: none;
    }
}
