/* VERZIA: 2026-08-15-v3 (pridane strankovanie) */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: #ffffff;
    color: #1f1f1f;
    margin: 0;
    padding: 0 16px;
}

.page {
    max-width: 620px;
    margin: 0 auto;
    padding: 24px 0 60px;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eeeeee;
}
.home-btn {
    color: #9e9e9e;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.home-btn:hover { color: #1f1f1f; }
.nav-spacer { width: 24px; }

button.home-btn { background: none; border: none; cursor: pointer; font-size: inherit; padding: 0; }

.user-menu-wrap { position: relative; }
.user-menu-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}
.user-menu-dropdown.open { display: block; }
.user-menu-name {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #757575;
    border-bottom: 1px solid #f0f0f0;
}
.user-menu-item {
    display: block;
    padding: 10px 14px;
    color: #1f1f1f;
    text-decoration: none;
    font-size: 0.9rem;
}
.user-menu-item:hover { background: #f5f5f5; }

h1 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
    flex: 1;
    text-align: center;
    font-family: 'Frank Ruhl Libre', serif;
    color: #1f1f1f;
}

/* ===== Ovladacie prvky ===== */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #757575;
    cursor: pointer;
    user-select: none;
}
.toggle-switch input { display: none; }
.toggle-switch .track {
    width: 34px;
    height: 18px;
    background: #dddddd;
    border-radius: 20px;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}
.toggle-switch .track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s;
}
.toggle-switch input:checked + .track {
    background: #1f1f1f;
}
.toggle-switch input:checked + .track::after {
    transform: translateX(16px);
}
.font-select {
    font-size: 0.8rem;
    color: #757575;
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 4px 10px;
    background: #fff;
    font-family: inherit;
}

/* ===== Prepinac Slova/Vety - teraz v controls-row ===== */
.mode-toggle-btn {
    border: 1px solid #1f1f1f;
    background: #1f1f1f;
    color: #ffffff;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
}

/* ===== Vyhladavacie pole - zvyraznene ===== */
form { margin: 12px 0 16px; }
.search-wrap {
    display: flex;
    align-items: center;
    background: #fafafa;
    border: 1px solid #1f1f1f;
    border-radius: 24px;
    padding: 2px 6px;
    width: 100%;
    box-sizing: border-box;
}
.search-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
    border: none;
    background: none;
    padding: 10px 4px;
    font-size: 1.05rem;
    font-family: inherit;
    outline: none;
}
.search-submit-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: #1f1f1f;
    padding: 4px 6px 4px 10px;
    display: inline-flex;
    align-items: center;
}
.search-clear-btn {
    align-items: center;
    cursor: pointer;
    color: #9e9e9e;
    padding: 0 4px;
}
.search-clear-icon { font-size: 18px; }

.exact-toggle-btn, .kb-open-btn {
    border: none;
    background: none;
    color: #bdbdbd;
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
}
.exact-toggle-btn:hover, .kb-open-btn:hover { color: #757575; }
.exact-toggle-btn.active { color: #2563eb; }

/* ===== Vyskakovacia klavesnica - priamo pod search inputom ===== */
.kb-dropdown {
    display: none;
    border: 1px solid #eeeeee;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 8px;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}
.kb-dropdown.open { display: block; }
.keyboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.keyboard-tabs button {
    border: none;
    background: #f5f5f5;
    color: #757575;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
}
.keyboard-tabs button.active {
    background: #1f1f1f;
    color: #fff;
}
.kb-grid {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
}
.kb-grid.active { display: flex; }
.kb-grid.kb-heb button {
    min-width: 48px;
    height: 48px;
    border: none;
    background: #1f1f1f;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    font-family: 'Frank Ruhl Libre', serif;
}
.kb-grid.kb-sk button {
    min-width: 48px;
    height: 48px;
    border: none;
    background: #1f1f1f;
    color: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    font-family: inherit;
}
.kb-grid button:hover { background: #3d3d3d; }

body.font-stare .col-heb .heb { font-family: 'Frank Ruhl Libre', serif; }
body.font-moderne .col-heb .heb { font-family: 'Rubik', sans-serif; }
body.font-pisane .col-heb .heb { font-family: 'LimonaDot', 'Frank Ruhl Libre', serif; }
body.font-stare .kb-grid.kb-heb button { font-family: 'Frank Ruhl Libre', serif; }
body.font-moderne .kb-grid.kb-heb button { font-family: 'Rubik', sans-serif; }
body.font-pisane .kb-grid.kb-heb button { font-family: 'LimonaDot', 'Frank Ruhl Libre', serif; }

/* ===== Vysledky - dva zrkadlove stlpce ===== */
.word-card {
    padding: 20px 0;
    border-bottom: 1px solid #eeeeee;
    position: relative;
}
.card-cols {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.col-sk {
    flex: 1;
    text-align: left;
}
.col-heb {
    flex: 1;
    text-align: right;
}

.word-text {
    font-size: 1rem;
    font-weight: 500;
    color: #1f1f1f;
}
.word-text.heb {
    font-size: 1.8rem;
    direction: rtl;
}

.verb-link {
    text-decoration: none;
    display: inline-block;
}
.verb-link .simple-type {
    text-decoration: underline;
    text-decoration-color: #bdbdbd;
}
.verb-link:hover .simple-type {
    color: #1f1f1f;
    text-decoration-color: #1f1f1f;
}

.gender-zensky { color: #c62828; }
.gender-muzsky { color: #1565c0; }
.gender-stredny { color: #f9a825; }

.simple-type {
    font-size: 0.8rem;
    color: #9e9e9e;
    margin-top: 4px;
}

.root-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 6px;
}

.root-badge {
    display: inline-block;
    background: #1f1f1f;
    color: #ffffff;
    font-size: 0.85rem;
    padding: 3px 12px;
    border-radius: 6px;
    direction: rtl;
}

.phonetic {
    font-size: 1rem;
    color: #616161;
    margin-top: 4px;
}

/* Vlajocka na nahlasenie chyby - v riadku vedla korena */
.flag-btn {
    border: none;
    background: none;
    color: #dddddd;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    line-height: 1;
}
.flag-btn:hover { color: #9e9e9e; }

.fav-btn {
    border: none;
    background: none;
    color: #dddddd;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.fav-btn .material-icons { font-size: 18px; }
.fav-btn:hover { color: #ef5350; }
.fav-btn.is-fav { color: #e53935; }

/* Modal na nahlasenie chyby */
.report-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.report-overlay.open { display: flex; }
.report-modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    width: 90%;
    max-width: 420px;
}
.report-modal h3 { margin-top: 0; font-size: 1.1rem; }
.report-modal textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px;
    border: 1px solid #dddddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.report-btn-cancel {
    background: none;
    border: none;
    color: #757575;
    cursor: pointer;
    padding: 8px 12px;
}
.report-btn-submit {
    background: #1f1f1f;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    cursor: pointer;
}
#report-step-loading { text-align: center; padding: 20px 0; }
.report-spinner {
    width: 30px; height: 30px;
    border: 3px solid #eeeeee;
    border-top-color: #1f1f1f;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: report-spin 0.8s linear infinite;
}
@keyframes report-spin { to { transform: rotate(360deg); } }
#report-result-text { white-space: pre-line; font-size: 0.9rem; }

/* Prepinanie s/bez nikkud - riadi sa triedou na <body> */
body.nikkud-off .with-nikkud { display: none; }
body.nikkud-on .without-nikkud { display: none; }

@font-face {
    font-family: 'LimonaDot';
    src: url('../fonts/LimonaDot-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* ===== Pilulky kategorii (vety) ===== */
.pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 16px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
}
.pill-count {
    opacity: 0.8;
    font-size: 0.7rem;
}
.category-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 16px 0;
}
.category-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: #1f1f1f;
}

/* ===== Textovy rozbalovaci zoznam (kategorie / slovne druhy) ===== */
.text-list {
    line-height: 2;
    font-size: 0.9rem;
}
.text-list-item {
    color: #1f1f1f;
    text-decoration: none;
}
.text-list-item:hover {
    color: #2563eb;
    text-decoration: underline;
}
.text-list-sep {
    color: #dddddd;
    margin: 0 8px;
}
.text-list-loading {
    color: #9e9e9e;
    font-size: 0.85rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding-top: 16px;
    border-top: 1px solid #eeeeee;
    flex-wrap: wrap;
    gap: 10px;
}
.pagination-info {
    color: #9e9e9e;
    font-size: 0.8rem;
}
.pagination-btns {
    display: flex;
    gap: 8px;
}
.page-btn {
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #1f1f1f;
    text-decoration: none;
}
.page-btn:hover {
    background: #f5f5f5;
}

.no-results {
    color: #9e9e9e;
    text-align: center;
    padding: 40px 0;
}
.footer {
    text-align: center;
    color: #dddddd;
    margin-top: 40px;
}

/* ===== Mobil - zmensit vyhladavacie pole, nech sa zmestia ikony ===== */
@media (max-width: 400px) {
    .search-wrap input[type="text"] {
        font-size: 0.95rem;
        padding: 8px 2px;
    }
    .search-submit-btn, .exact-toggle-btn, .kb-open-btn, .search-clear-btn {
        padding: 2px 3px;
    }
    .kb-grid { gap: 8px; }
    .kb-grid.kb-heb button, .kb-grid.kb-sk button {
        min-width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }
}

/* ===== Editacny modal (slovo/fraza) - zdielane naprieč strankami ===== */
.edit-icon-btn {
    border: none; background: none; cursor: pointer; padding: 0;
    display: inline-flex; align-items: center; line-height: 1;
    color: #bdbdbd;
}
.edit-icon-btn:hover { color: #1f1f1f; }
.edit-icon-btn .material-icons { font-size: 18px; }

.edit-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); z-index: 1000; align-items: center; justify-content: center; padding: 16px; }
.edit-overlay.open { display: flex; }
.edit-modal { background: #fff; border-radius: 12px; padding: 24px; width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto; }
.edit-modal h3 { margin-top: 0; font-size: 1.1rem; }
.edit-field { margin-bottom: 14px; }
.edit-field label { display: block; font-size: 0.8rem; color: #757575; margin-bottom: 4px; }
.edit-field input, .edit-field select { width: 100%; padding: 8px 10px; border: 1px solid #dddddd; border-radius: 6px; font-family: inherit; font-size: 0.9rem; box-sizing: border-box; }
.translations-list .tr-row { display: flex; gap: 6px; margin-bottom: 6px; }
.translations-list .tr-row input[type="text"] { flex: 1; }
.tr-remove-btn { border: none; background: none; color: #c62828; cursor: pointer; }
.add-tr-btn { font-size: 0.8rem; color: #2563eb; background: none; border: none; cursor: pointer; padding: 4px 0; }
.edit-modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 16px; }
.btn-cancel { background: none; border: none; color: #757575; cursor: pointer; padding: 8px 12px; }
.btn-save { background: #1f1f1f; color: #fff; border: none; border-radius: 6px; padding: 8px 18px; cursor: pointer; }
.btn-delete { background: none; color: #c62828; border: none; cursor: pointer; padding: 8px 12px; font-size: 0.85rem; }
.btn-delete:hover { text-decoration: underline; }