/* ================= READER TOOLBAR & FILTERS ================= */
.reader-toolbar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}

.toolbar-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 70px 10px 14px !important;
    font-size: 14.5px !important;
}

.btn-clear-search {
    position: absolute;
    right: 12px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
}

.btn-clear-search:hover {
    color: #e11d48;
}

.toolbar-select {
    width: auto !important;
    min-width: 220px;
}

.btn-outline-sm {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid #cbd5e1;
    padding: 9px 15px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s;
}

.btn-outline-sm:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.btn-outline-sm.active-toggle {
    background: #eef2ff;
    color: var(--primary-dark);
    border-color: #818cf8;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-muted);
    background: #f1f5f9;
    transition: all 0.15s;
}

.filter-pill:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.filter-pill.active {
    background: var(--primary);
    color: #ffffff;
}

.result-counter {
    font-size: 13px;
    color: var(--text-muted);
}

/* A-Z Bar */
.az-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.az-link {
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.az-link:hover {
    background: #eef2ff;
    color: var(--primary);
}

.az-link.active {
    background: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
}

/* ================= IDIOM READER CARDS ================= */
.idiom-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.idiom-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    background: #ffffff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.idiom-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.idiom-card.is-bookmarked {
    border-left: 4px solid #f59e0b;
}

.idiom-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.idiom-title-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.idiom-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
}

.idiom-phrase {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-dark);
}

.ipa-badge {
    font-family: "Segoe UI", Consolas, sans-serif;
    font-size: 13.5px;
    color: #0369a1;
    background: #e0f2fe;
    padding: 2px 10px;
    border-radius: 999px;
}

.btn-speak {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-speak:hover {
    background: #eef2ff;
    border-color: var(--primary);
    color: var(--primary);
}

.idiom-meta-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
}

.tag-register {
    background: #f3e8ff;
    color: #6b21a8;
}

.tag-topic {
    background: #ecfdf5;
    color: #065f46;
}

.bookmark-star {
    color: #f59e0b;
    font-size: 18px;
}

.btn-edit-link {
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    background: #eff6ff;
}

.btn-edit-link:hover {
    background: #dbeafe;
}

.idiom-meaning {
    font-size: 15.5px;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 10px;
    transition: filter 0.2s;
}

/* Hide Meanings Quiz Mode */
.quiz-hidden .idiom-meaning,
.quiz-hidden .enrichment-notes {
    filter: blur(6px);
    user-select: none;
    cursor: pointer;
}

.quiz-hidden .idiom-card:hover .idiom-meaning,
.quiz-hidden .idiom-card:hover .enrichment-notes {
    filter: none;
}

.idiom-example {
    margin: 0;
    padding: 10px 14px;
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    border-radius: 0 8px 8px 0;
    color: #334155;
    font-size: 14.5px;
    font-style: italic;
}

.enrichment-notes {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    font-size: 13.5px;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

/* ================= EDITOR WORKSPACE ================= */
.editor-layout {
    grid-template-columns: 380px 1fr !important;
}

@media (max-width: 960px) {
    .editor-layout {
        grid-template-columns: 1fr !important;
    }
}

.ground-truth-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.gt-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #e2e8f0;
    color: #334155;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 6px;
}

.gt-header h2 {
    font-size: 18px;
    color: var(--text-main);
}

.gt-book {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 3px;
}

.gt-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.gt-label-row label {
    margin-bottom: 0;
}

.btn-copy-gt {
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.btn-copy-gt:hover {
    text-decoration: underline;
}

.gt-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    color: #334155;
}

.gt-raw {
    background: #0f172a;
    color: #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
}

.editor-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.prev-next-links {
    display: flex;
    gap: 8px;
}

.audio-preview-bar {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.remove-audio-label {
    font-size: 13px;
    font-weight: 500;
    color: #e11d48;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    cursor: pointer;
}

.editor-submit-row {
    margin-top: 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-accent {
    background: var(--primary-dark);
}
