/* Dictionary page */
.dict-row { border-bottom: 1px solid #343a40; }
.dict-category { min-height: 90px; text-align: left; }
.dict-option { min-height: 56px; }

/* Spelling mode: one input per letter */
.spell-cells { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.spell-cell {
    width: 44px; height: 52px; text-align: center; font-size: 1.5rem; text-transform: lowercase;
    background: #212529; color: #fff; border: 2px solid #495057; border-radius: 6px;
}
.spell-cell:focus { outline: none; border-color: #0d6efd; }
.spell-cell.fixed { border-color: transparent; background: transparent; width: 20px; }
.spell-cell.ok { border-color: #198754; }
.spell-cell.bad { border-color: #dc3545; }

@media (max-width: 576px) {
    .spell-cell { width: 34px; height: 44px; font-size: 1.2rem; }
}

/* Language pair in the page header: two equal input groups, stacked on narrow screens */
.dict-langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; width: 100%; max-width: 560px; }
.dict-langs .input-group-text { background-color: #343a40; border-color: #495057; color: #adb5bd; }
.dict-langs .form-control,
.dict-langs .form-select { background-color: #212529; border-color: #495057; color: #f8f9fa; }
.dict-langs .form-control[readonly] { color: #ced4da; cursor: default; box-shadow: none; }
.dict-langs .form-select option { background-color: #212529; color: #f8f9fa; }
.dict-langs .form-select { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
@media (max-width: 575.98px) { .dict-langs { grid-template-columns: 1fr; } }

/* My dictionary pager: rows per page on the left, pages on the right (dark theme) */
.dict-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.dict-pager .form-select { background-color: #212529; border-color: #495057; color: #f8f9fa; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e"); }
/* Bootstrap 5.0 has no pagination CSS variables, so the colors are set directly */
.dict-pager .pagination { flex-wrap: wrap; }
.dict-pager .page-link { background-color: #212529; border-color: #495057; color: #f8f9fa; }
.dict-pager .page-link:hover { background-color: #343a40; border-color: #495057; color: #fff; }
.dict-pager .page-link:focus { background-color: #343a40; color: #fff; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .35); }
.dict-pager .page-item.active .page-link { background-color: #0d6efd; border-color: #0d6efd; color: #fff; }
.dict-pager .page-item.disabled .page-link { background-color: #212529; border-color: #495057; color: #6c757d; }

/* Category banner: just a clickable image, the word count sits in the bottom-right corner */
.dict-banner { position: relative; border-radius: .75rem; overflow: hidden; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.dict-banner img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.dict-banner:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .5); }
.dict-banner:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }
.dict-banner-count { position: absolute; right: .5rem; bottom: .5rem; padding: .15rem .5rem; border-radius: .375rem; background: rgba(0, 0, 0, .7); color: #fff; font-size: .8rem; font-weight: 600; line-height: 1.4; }

/* "My dictionary" grid loader: shown in place of the cleared rows while words are added from a category */
.dict-grid-loader { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 2.5rem 0; color: #adb5bd; }
.dict-grid-loader[hidden] { display: none; }

/* "My dictionary" row being deleted: greyed out until the server answers */
.dict-row.is-deleting { opacity: .45; pointer-events: none; transition: opacity .15s ease; }

/* ---------- Dictionary popups (dark theme) ---------- */
.modal-backdrop.show { opacity: .7; }

.dict-modal {
    background: linear-gradient(180deg, #23272e 0%, #1a1d22 100%);
    color: #e9ecef;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 1rem;
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .6);
    overflow: hidden;
}
.dict-modal .modal-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.dict-modal .modal-title { font-size: 1.15rem; font-weight: 600; letter-spacing: .01em; }
.dict-modal .modal-title [data-role="category-title"] { color: #6ea8fe; }
.dict-modal .modal-body { padding: 1.25rem 1.5rem; }
.dict-modal .modal-footer { padding: .9rem 1.5rem; gap: .5rem; border-top: 1px solid rgba(255, 255, 255, .06); background: rgba(0, 0, 0, .15); }
.dict-modal .modal-footer > * { margin: 0; }
.dict-modal .modal-footer .me-auto { margin-right: auto !important; }
.dict-modal .btn { border-radius: .6rem; padding: .45rem 1rem; font-weight: 500; }
.dict-modal .btn-close { opacity: .6; }
.dict-modal .btn-close:hover { opacity: 1; }

/* Word list of a category */
.dict-modal [data-role="category-words"] { width: 100%; border: 1px solid rgba(255, 255, 255, .06); border-radius: 0; overflow: hidden; }
.dict-modal [data-role="category-words"]:empty { border: 0; }
.dict-modal [data-role="category-words"] .dict-row { margin: 0; padding: .6rem .5rem; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.dict-modal [data-role="category-words"] .dict-row:last-child { border-bottom: 0; }
.dict-modal [data-role="category-words"] .dict-row:nth-child(odd) { background: rgba(255, 255, 255, .025); }
.dict-modal [data-role="category-words"] .dict-row:hover { background: rgba(110, 168, 254, .08); }
.dict-modal [data-role="category-words"] .dict-row > :last-child { color: #adb5bd; }

/* Form fields (add word) */
.dict-modal .form-label { color: #adb5bd; font-size: .9rem; margin-bottom: .35rem; }
.dict-modal .form-control { background: #16181c; border: 1px solid #3a3f47; border-radius: .6rem; color: #f8f9fa; padding: .6rem .85rem; }
.dict-modal .form-control:focus { background: #16181c; border-color: #6ea8fe; color: #fff; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .25); }

/* Delete confirmation */
.dict-modal-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: .75rem; border-radius: 50%; background: rgba(220, 53, 69, .15); color: #ea868f; }
.dict-modal-chip { display: inline-block; max-width: 100%; padding: .4rem .9rem; border-radius: 2rem; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-weight: 600; overflow-wrap: anywhere; }
