/* ========================================
   HADITH MODALS (биография передатчика)
   ======================================== */

/* ── Оверлей ── */
.narrator-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: hadith-modal-fade-in 0.2s ease;
}
.narrator-modal-overlay.open { display: flex; }

@keyframes hadith-modal-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Окно ── */
.narrator-modal {
    background: var(--white);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: hadith-modal-slide-up 0.2s ease;
    overflow: hidden;
}

@keyframes hadith-modal-slide-up {
    from { transform: translateY(20px); opacity: 0.5; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Шапка модалки ── */
.narrator-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-gray);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.narrator-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-size: 18px;
}
.narrator-modal-close:hover { background: #e5e7eb; color: #374151; }

.narrator-modal-name {
    flex: 1;
    min-width: 0;
}

.narrator-modal-name-ar {
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 22px;
    color: #1f2937;
    direction: rtl;
    text-align: end;
    display: block;
    line-height: 1.4;
    margin-bottom: 3px;
}

.narrator-modal-name-ru {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

/* ── Тело модалки (скролл) ── */
.narrator-modal-body {
    overflow-y: auto;
    flex: 1;
    padding: 20px 24px 24px;
}

/* Метаданные */
.narrator-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.narrator-modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}
.narrator-modal-badge.tabaqa-sahabi    { background: #ede9fe; color: #4c1d95; }
.narrator-modal-badge.tabaqa-tabii     { background: #dbeafe; color: #1e40af; }
.narrator-modal-badge.tabaqa-tabii_tabii { background: #e0f2fe; color: #075985; }
.narrator-modal-badge.grade-thiqah     { background: #d1fae5; color: #059669; }
.narrator-modal-badge.grade-saduq      { background: #fef3c7; color: #c5a059; }
.narrator-modal-badge.grade-layyin     { background: #ffedd5; color: #c2410c; }
.narrator-modal-badge.grade-daif       { background: #fee2e2; color: #ef4444; }
.narrator-modal-badge.grade-matruk     { background: #fee2e2; color: #991b1b; }
.narrator-modal-badge.grade-kazzab     { background: #fdf2f8; color: #86198f; }

/* Даты */
.narrator-modal-dates {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.narrator-modal-dates span { display: flex; align-items: center; gap: 4px; }

/* Дополнительные имена */
.narrator-modal-aliases {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    font-family: 'Scheherazade New', 'Amiri', serif;
    direction: rtl;
    text-align: end;
}

/* Биография */
.narrator-modal-bio {
    font-size: 14px;
    color: #374151;
    line-height: 1.8;
    margin-bottom: 20px;
}

/* Секции: учителя, ученики, оценки */
.narrator-modal-section {
    margin-bottom: 18px;
}

.narrator-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 8px;
}

/* Список учителей/учеников */
.narrator-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.narrator-link-item {
    padding: 4px 12px;
    border: 1px solid var(--border-gray);
    border-radius: 9999px;
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 13px;
    color: var(--emerald);
    cursor: pointer;
    transition: all 0.15s;
    direction: rtl;
}
.narrator-link-item:hover { background: var(--emerald-50, #ecfdf5); border-color: var(--emerald); }

/* Таблица оценок */
.narrator-jarh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.narrator-jarh-table th {
    text-align: start;
    padding: 7px 10px;
    font-weight: 600;
    color: #6b7280;
    border-bottom: 2px solid #f3f4f6;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.narrator-jarh-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f9fafb;
    color: #374151;
    vertical-align: top;
}
.narrator-jarh-table tr:last-child td { border-bottom: none; }

.narrator-jarh-grade-ar {
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 14px;
    color: #1f2937;
    direction: rtl;
}
.narrator-jarh-grade-ru {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

/* Статистика хадисов */
.narrator-hadith-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.narrator-hadith-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--emerald);
}
.narrator-hadith-label {
    font-size: 13px;
    color: #6b7280;
}

/* Источники */
.narrator-sources {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.narrator-sources li {
    font-family: 'Scheherazade New', 'Amiri', serif;
    font-size: 13px;
    color: #6b7280;
    padding: 3px 10px;
    background: #f9fafb;
    border-radius: 9999px;
    direction: rtl;
}

/* Загрузка */
.narrator-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    color: #6b7280;
    font-size: 14px;
    gap: 10px;
}

.narrator-modal-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #e5e7eb;
    border-top-color: var(--emerald);
    border-radius: 50%;
    animation: hadith-spin 0.7s linear infinite;
}
