/* LumorowLMS — Vocab Matching Block Frontend Styles */

.llmsb-matching-instruction {
    font-size: .95rem;
    font-style: italic;
    color: var(--llmsb-mid);
    margin: 0 0 16px;
}

.llmsb-matching-table-wrap {
    overflow-x: auto;
    margin-bottom: 4px;
}

.llmsb-matching-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.llmsb-matching-table thead tr {
    border-top: 2px solid var(--llmsb-primary);
    border-bottom: 2px solid var(--llmsb-primary);
    background: var(--llmsb-primary-pale);
}

.llmsb-matching-th-word,
.llmsb-matching-th-def {
    padding: 10px 14px;
    font-weight: 700;
    color: var(--llmsb-primary-dk);
    text-align: left;
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.llmsb-matching-row {
    border-bottom: 1px solid var(--llmsb-border);
    transition: background .2s;
}

.llmsb-matching-row:hover {
    background: #fafafa;
}

.llmsb-matching-row.llmsb-matching-correct {
    background: #dcfce7;
}

.llmsb-matching-row.llmsb-matching-wrong {
    background: #fee2e2;
}

.llmsb-matching-num {
    padding: 12px 10px 12px 14px;
    font-weight: 500;
    color: var(--llmsb-muted);
    width: 30px;
    text-align: center;
}

.llmsb-matching-word {
    padding: 12px 14px;
    font-weight: 700;
    color: var(--llmsb-dark);
    white-space: nowrap;
}

.llmsb-matching-input-cell {
    padding: 8px 6px;
    width: 72px;
    text-align: center;
    white-space: nowrap;
}

/* Correct-answer reveal next to a wrong student input. Appears after
   Check Answers — visually says "your letter → correct letter". */
.llmsb-matching-correct-note {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--llmsb-correct, #16a34a);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .3px;
    vertical-align: middle;
}

.llmsb-matching-input {
    width: 38px;
    height: 36px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--llmsb-primary);
    border: 2px solid var(--llmsb-primary);
    border-radius: 6px;
    background: #fff;
    text-transform: uppercase;
    outline: none;
    font-family: inherit;
}

.llmsb-matching-input:focus {
    border-color: var(--llmsb-primary-dk);
    box-shadow: 0 0 0 3px rgba(247,114,5,.15);
}

.llmsb-matching-input:disabled {
    opacity: .7;
    cursor: default;
}

.llmsb-matching-correct .llmsb-matching-input {
    border-color: var(--llmsb-correct);
    color: var(--llmsb-correct);
    background: #f0fdf4;
}

.llmsb-matching-wrong .llmsb-matching-input {
    border-color: var(--llmsb-wrong);
    color: var(--llmsb-wrong);
    background: #fef2f2;
}

.llmsb-matching-letter {
    padding: 12px 10px;
    width: 36px;
    text-align: center;
    font-weight: 700;
    color: var(--llmsb-primary);
    background: var(--llmsb-primary-pale);
    font-size: .95rem;
}

.llmsb-matching-def {
    padding: 12px 14px;
    color: var(--llmsb-mid);
    line-height: 1.45;
}

/* Bottom border on last row */
.llmsb-matching-table tbody tr:last-child {
    border-bottom: 2px solid var(--llmsb-primary);
}

@media (max-width: 480px) {
    .llmsb-matching-table { font-size: .85rem; }
    .llmsb-matching-word { padding: 10px 8px; }
    .llmsb-matching-def { padding: 10px 8px; }
    .llmsb-matching-input { width: 32px; height: 32px; font-size: .9rem; }
}

/* ── Click-to-match interaction states ─────── */
.llmsb-matching-word,
.llmsb-matching-def {
    cursor: pointer;
    border-radius: 4px;
    transition: background .15s, opacity .2s, color .2s;
    user-select: none;
}

.llmsb-matching-word:hover,
.llmsb-matching-def:hover {
    background: var(--llmsb-primary-pale);
}

/* Currently selected (awaiting partner click) */
.llmsb-matching-word.selecting {
    background: #fef3c7;
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
    font-weight: 800;
}
.llmsb-matching-def.selecting {
    background: #fef3c7;
    outline: 2px solid #f59e0b;
    outline-offset: -2px;
}

/* Matched pair — grayed out */
.llmsb-matching-word.matched,
.llmsb-matching-def.matched {
    opacity: .4;
    text-decoration: line-through;
    cursor: pointer; /* still clickable to unmatch */
}
.llmsb-matching-word.matched:hover,
.llmsb-matching-def.matched:hover {
    opacity: .65;
    background: #f3f4f6;
    text-decoration: line-through;
}

/* Updated column header widths */
.llmsb-matching-th-num  { width: 28px; text-align: center; padding: 10px 6px; }
.llmsb-matching-th-ans  { width: 48px; text-align: center; padding: 10px 6px; font-weight: 700; color: var(--llmsb-primary-dk); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.llmsb-matching-th-word { padding: 10px 14px; font-weight: 700; color: var(--llmsb-primary-dk); text-transform: uppercase; letter-spacing: .5px; font-size: .85rem; }
.llmsb-matching-th-letter { width: 36px; }
.llmsb-matching-th-def  { padding: 10px 14px; font-weight: 700; color: var(--llmsb-primary-dk); text-transform: uppercase; letter-spacing: .5px; font-size: .85rem; }
