/* Page-specific styling for Prueba de Verbos — shared components live in theme.css */

#week-banner {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: var(--space-5);
}

/* ---- Celebration ---- */
.confetti-burst {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3000;
    overflow: hidden;
}
.confetti-piece {
    position: absolute;
    top: -20px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    border-radius: 2px;
    animation-name: confetti-fall;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}
@keyframes confetti-fall {
    to { top: 110vh; transform: rotate(720deg); opacity: 0.5; }
}

/* ---- Lookup search ---- */
.lookup-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}
.lookup-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    max-height: 240px;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}
.lookup-result-group-label {
    position: sticky;
    top: 0;
    padding: 6px 12px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-faint);
    background: var(--bg-surface);
}
.lookup-result-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}
.lookup-result-item:hover { background: var(--color-surface-alt); }
.lookup-result-empty {
    padding: 8px 12px;
    font-size: 0.82rem;
    color: var(--color-text-faint);
}

/* ---- Admin panel ---- */
.admin-panel__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: var(--space-2) 0;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--color-text);
    font-family: inherit;
}
.admin-panel__chevron {
    display: inline-block;
    transition: transform 0.25s ease;
    color: var(--color-text-muted);
}
.admin-panel.is-open .admin-panel__chevron { transform: rotate(180deg); }

/* Animating to "auto" height without JS measuring the content: the 0fr/1fr
   grid-track trick — the inner div's overflow:hidden clips it at 0 height,
   then the grid track itself transitions to fit content exactly. */
.admin-collapse {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}
.admin-panel.is-open .admin-collapse { grid-template-rows: 1fr; }
.admin-collapse__inner { overflow: hidden; min-height: 0; }
.admin-verb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    background: var(--color-surface-alt);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}
.admin-verb-row .infinitive { font-weight: 700; min-width: 90px; }
.admin-verb-row .meaning { color: var(--color-text-muted); font-size: 0.85rem; flex: 1; }

.admin-conjugation-table { max-height: 360px; }
.admin-conjugation-table td { padding: 5px; }
.admin-table-input {
    width: 100%;
    min-width: 64px;
    padding: 5px 6px;
    font-size: 0.78rem;
    border-radius: 5px;
    border: 1px solid var(--color-border);
    background: var(--bg-void);
    color: var(--color-text);
    text-align: center;
    font-family: var(--font-sans);
}
.admin-table-input:focus { outline: none; border-color: var(--color-accent); }
.admin-table-input.was-changed { border-color: var(--color-danger); color: var(--color-danger); }

/* ---- Lookup ---- */
#lookup-table-wrap .data-table td.is-irregular { color: var(--color-danger); }

/* ---- Practice ---- */
.verb-picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    max-height: 160px;
    overflow-y: auto;
    padding: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin: var(--space-3) 0;
}
.verb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--color-surface-alt);
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
}
.verb-chip input { margin: 0; accent-color: var(--color-accent); }

.drill-back-btn { margin-bottom: var(--space-3); }

.drill-layout {
    display: flex;
    gap: var(--space-4);
    align-items: stretch;
}
.drill-sidebar {
    width: 170px;
    flex-shrink: 0;
    background: var(--bg-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.drill-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.drill-stat__value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.drill-stat__icon { font-size: 1rem; }
.drill-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--bg-void);
    overflow: hidden;
}
.drill-progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
    transition: width 0.3s ease;
}

.drill-main { flex: 1; min-width: 0; }

.drill-focus {
    position: relative;
    background: linear-gradient(135deg, #2b3161, #402c56 55%, #4a2a3f);
    border-radius: var(--radius-lg);
    padding: var(--space-7) var(--space-5);
    text-align: center;
    box-shadow: var(--shadow-md);
}
.drill-focus__prompt {
    display: inline-block;
    background: #ffffff;
    color: #14131a;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
}
.drill-focus__prompt strong { font-family: var(--font-display); font-weight: 700; }
.drill-focus__meaning { font-size: 0.85em; color: #6b6a76; font-weight: 400; }
.drill-focus__tense {
    color: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-family: var(--font-display);
    margin-bottom: var(--space-5);
}
/* The shared .tense-es color (page accent) can clash against this card's
   own gradient — use a soft white instead, still distinguished by italics. */
.drill-focus .tense-es { color: rgba(255, 255, 255, 0.65); }
.drill-focus__input {
    display: block;
    width: 260px;
    max-width: 100%;
    margin: 0 auto var(--space-4);
    padding: 13px 16px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 1.1rem;
    text-align: center;
    font-family: var(--font-sans);
    background: #ffffff;
    color: #14131a;
}
.drill-focus__input:focus { outline: 3px solid rgba(255, 255, 255, 0.5); }
.drill-focus__input.is-correct { background: #d7f9e6; }
.drill-focus__input.is-incorrect { background: #ffdde1; }
.drill-focus__check {
    background: rgba(255, 255, 255, 0.95);
    color: #14131a;
    border: none;
}
.drill-focus__check:hover:not(:disabled) { background: #ffffff; }
.drill-focus__check:disabled { background: rgba(255, 255, 255, 0.5); }

.drill-focus .drill-feedback { color: #fff; font-weight: 700; margin-top: var(--space-3); }
.drill-focus .drill-feedback.correct { color: #baffd8; }
.drill-focus .drill-feedback.incorrect { color: #ffd4da; }

@media (max-width: 640px) {
    .drill-layout { flex-direction: column; }
    .drill-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
    }
    .drill-progress { flex-basis: 100%; }
}

/* ---- Test simulation ---- */
.test-timer {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--space-4);
    font-variant-numeric: tabular-nums;
}
.test-timer.is-low { color: var(--color-danger); }

table.test-grid { border-collapse: collapse; width: 100%; font-size: 0.78rem; }
table.test-grid td {
    border: 1px solid var(--color-border);
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}
table.test-grid td.tense-label {
    text-align: left;
    font-weight: 600;
    background: var(--color-surface-alt);
    white-space: normal;
    max-width: 170px;
    position: sticky;
    left: 0;
}

/* Worksheet-style header row: Nombre/Fecha, then Verbo/Significado/Forma per
   verb column — the first row of the same table, modeled directly on the
   paper test sheet, rather than a separate element above it. */
.test-header-row .test-header-cell {
    text-align: left;
    vertical-align: top;
    padding: var(--space-4);
    background: var(--color-surface-alt);
    font-size: 0.85rem;
}
/* Sticks to the left on horizontal scroll, same as the tense-label column
   below it, so the two line up while scrolling. */
.test-header-row .test-header-cell:first-child {
    position: sticky;
    left: 0;
}
.test-header-verb {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: var(--space-2);
}
.test-header-forma {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background: var(--color-accent-light);
    display: inline-block;
    font-size: 0.85rem;
}

/* Each row only asks for one subject now, so its single box gets to be much
   bigger/easier to read than the old multi-box-per-row grid. */
.test-single-input {
    width: 100%;
    min-width: 110px;
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--bg-void);
    color: var(--color-text);
    text-align: center;
}
.test-single-input.correct { background: color-mix(in srgb, var(--color-success) 20%, var(--bg-void)); border-color: var(--color-success); }
.test-single-input.incorrect { background: color-mix(in srgb, var(--color-danger) 20%, var(--bg-void)); border-color: var(--color-danger); }

.test-summary { text-align: center; margin-top: var(--space-4); font-weight: 700; font-family: var(--font-display); font-size: 1.1rem; }
