/* ═══════════════════════════════════════════
   lexicon.css
═══════════════════════════════════════════ */

/* ── Search Box ─────────────────────────── */

.lexicon-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.lexicon-search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #146c94;
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
    transition: color 0.3s;
}

.lexicon-search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    font-size: 1rem;
    color: #1f2937;
    background: #ffffff;
    box-shadow: 0 4px 24px rgba(20, 108, 148, 0.08);
    transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
    outline: none;
    font-family: inherit;
    direction: rtl;
}

.lexicon-search-input:focus {
    border-color: #146c94;
    box-shadow: 0 4px 24px rgba(20, 108, 148, 0.18);
    transform: translateY(-1px);
}

.lexicon-search-input::placeholder {
    color: #9ca3af;
    font-size: 0.95rem;
}

.lexicon-clear-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    z-index: 1;
    font-size: 0.8rem;
}

.lexicon-clear-btn:hover {
    background: #146c94;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* Results Info */
.lexicon-results-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(to right, #eff6ff, #e0f2fe);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    color: #146c94;
    font-weight: 600;
    animation: fadeIn 0.3s ease;
}

/* Highlight */
mark.lexicon-highlight {
    background: linear-gradient(120deg, #fde68a 0%, #fbbf24 100%);
    color: #78350f;
    border-radius: 3px;
    padding: 0 3px;
    font-weight: 700;
    font-style: normal;
}

/* Hidden via JS search */
.lexicon-hidden {
    display: none !important;
}

/* ── Custom Scrollbar ───────────────────── */

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #146c94, #19a7ce);
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #0f5070, #146c94);
}

/* ── Table ──────────────────────────────── */

table {
    table-layout: auto;
}

table th,
table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#termsTableBody tr:last-child {
    border-bottom: none;
}

/* Row hover */
.hover-lift-row {
    cursor: default;
    position: relative;
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hover-lift-row:hover {
    background: linear-gradient(to left, #f0f9ff, #e0f2fe, #f0fdf4);
    box-shadow: 0 4px 8px -2px rgba(20, 108, 148, 0.08);
    transform: translateY(-1px);
}

/* Editing row */
tr.editing {
    background: linear-gradient(to left, #fefce8, #fef9c3) !important;
    box-shadow: inset 0 0 0 2px #fbbf24;
}

tr.editing:hover {
    transform: none;
}

/* ── Source Button ──────────────────────── */

.source-btn {
    cursor: pointer;
    transition: all 0.3s;
}

.source-btn:active {
    transform: scale(0.93) !important;
}

/* ── Pagination Active ──────────────────── */

.active-page {
    cursor: default;
    pointer-events: none;
}

/* ── Mobile Cards ───────────────────────── */

.term-card {
    border: 1px solid #f1f5f9;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.term-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(20, 108, 148, 0.1);
}

.term-card.editing {
    background: linear-gradient(to bottom right, #fefce8, #fff) !important;
    border: 2px solid #fbbf24 !important;
}

.term-card.editing:hover {
    transform: none;
}

/* ── Row Animations ─────────────────────── */

@keyframes rowAdd {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes rowDelete {
    0% {
        opacity: 1;
        transform: translateX(0);
        max-height: 300px;
    }
    100% {
        opacity: 0;
        transform: translateX(40px);
        max-height: 0;
        padding: 0;
    }
}

.row-add-anim {
    animation: rowAdd 0.35s ease forwards;
}

.row-delete-anim {
    animation: rowDelete 0.4s ease forwards;
    overflow: hidden;
    pointer-events: none;
}

/* ── Modal / Confirm Animations ─────────── */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -120%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }
    to {
        transform: translate(-50%, -120%);
        opacity: 0;
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
}
.animate-fadeOut {
    animation: fadeOut 0.2s ease-out forwards;
}
.animate-scaleIn {
    animation: scaleIn 0.3s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.animate-slideDown {
    animation: slideDown 0.35s cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}
.animate-slideUp {
    animation: slideUp 0.3s ease-in forwards;
}

/* ── Admin Add Form ─────────────────────── */

#addTermRow {
    animation: fadeIn 0.3s ease;
}

#addTermRow input,
#addTermRow textarea {
    font-family: inherit;
    direction: rtl;
}

#addTermRow input:focus,
#addTermRow textarea:focus {
    border-color: #146c94;
    box-shadow: 0 0 0 3px rgba(20, 108, 148, 0.12);
    outline: none;
}

/* Inline edit inputs inside table */
tr.editing input,
tr.editing textarea {
    font-family: inherit;
    direction: rtl;
}

/* ── Admin Preview Badge ────────────────── */
/* TODO_BACKEND: این بلوک رو بعد از اتصال بک‌اند حذف کن */
