/* ══════════════════════════════════════════════════════════════════════════
   Interactions – Scoring & Comments
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════
   SARF / NLP HTML Response Beautifier
   ══════════════════════════════════════════════════════════════════════════ */

/* Input word header */
.sarf-result div.P {
    background: linear-gradient(135deg, #7D019F 0%, #9f01c9 100%);
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
}
.sarf-result div.P .N {
    font-size: 1.4em;
    font-weight: bold;
    margin-right: 8px;
    color: #fff;
}

/* Analysis number badge */
.sarf-result h4 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #7D019F;
    color: #fff;
    border-radius: 50%;
    font-size: 0.85rem;
    margin: 10px 0 6px;
    font-weight: 700;
    padding: 0;
}

/* Analysis list */
.sarf-result ul {
    list-style: none;
    padding: 10px 12px;
    margin: 0 0 4px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.sarf-result li {
    padding: 0;
}

/* Hide surrounding punctuation text, keep only abbr chips visible */
.sarf-result li > span {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 0 !important;
    color: transparent !important;
    padding: 0 !important;
}

/* Attribute chips */
.sarf-result abbr {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    font-size: 0.83rem !important;
    color: #1e293b !important;
    text-decoration: none !important;
    background: #fff !important;
    border: 1px solid #c7d2fe !important;
    border-radius: 8px !important;
    padding: 3px 10px 4px !important;
    cursor: default !important;
    font-style: normal !important;
    line-height: 1.4 !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    white-space: nowrap;
}
.sarf-result abbr::before {
    content: attr(title);
    display: block;
    font-size: 0.65em !important;
    color: #6366f1 !important;
    font-weight: 700 !important;
    letter-spacing: .03em;
    line-height: 1.2;
}

/* Separator */
.sarf-result hr {
    border: none;
    border-top: 1px dashed #e2e8f0;
    margin: 8px 0;
}

/* ── Score Summary Inline (next to title) ─────────────────────────────── */
.score-summary-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.score-summary-inline .score-avg {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
}

.score-summary-inline .score-count {
    font-size: 0.85rem;
    color: #6c757d;
}

.star-icon {
    color: #ccc;
    line-height: 1;
}

.star-icon.star-filled {
    color: #f5a623;
}

/* ── Star Rating (interactive) ────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    gap: 4px;
    direction: ltr;
}

.star-rating .star {
    font-size: 2rem;
    color: #ccc;
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 1;
}

.star-rating .star:hover,
.star-rating .star.hover {
    color: #f5a623;
    transform: scale(1.15);
}

.star-rating .star.active {
    color: #f5a623;
}

/* ── Score Info ────────────────────────────────────────────────────────── */
.score-info {
    font-size: 0.95rem;
    color: #495057;
}

.score-label {
    font-weight: 600;
}

/* ── Captcha Box ──────────────────────────────────────────────────────── */
.captcha-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: #f0f4f8;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.captcha-question {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    direction: ltr;
}

/* ── Interactions Section Container ───────────────────────────────────── */
.interactions-section {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
}

/* ── Comments ─────────────────────────────────────────────────────────── */
.comments-list {
    max-height: 800px;
    overflow-y: auto;
}

.comment-item {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.comment-item.comment-reply {
    margin-left: 28px;
    border-left: 3px solid #0d6efd;
    background: #fcfcff;
}

[dir="rtl"] .comment-item.comment-reply {
    margin-left: 0;
    margin-right: 28px;
    border-left: none;
    border-right: 3px solid #0d6efd;
}

.comment-header {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.comment-header strong {
    color: #212529;
}

.comment-time {
    font-size: 0.8rem;
    margin-inline-start: 12px; /* Increased spacing between name and date */
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Comment Actions (votes + reply) ──────────────────────────────────── */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-vote {
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.btn-vote:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

.btn-vote.vote-active.btn-like {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.btn-vote.vote-active.btn-dislike {
    background: #ffebee;
    border-color: #ef5350;
    color: #c62828;
}

.btn-reply-toggle {
    font-size: 0.8rem;
    padding: 2px 6px;
    color: #0d6efd !important;
    text-decoration: none !important;
}

/* ── Reply Form ───────────────────────────────────────────────────────── */
.reply-form {
    margin-top: 10px;
    padding: 12px;
    background: #f0f4f8;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* ── Add Comment Form ─────────────────────────────────────────────────── */
.add-comment-form {
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    padding: 18px;
}

.add-comment-form textarea {
    resize: vertical;
    min-height: 60px;
}

/* ── Comment replies container ────────────────────────────────────────── */
.comment-replies {
    margin-top: 10px;
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .interactions-section {
        padding: 1rem;
    }

    .comment-item.comment-reply {
        margin-left: 12px;
    }

    [dir="rtl"] .comment-item.comment-reply {
        margin-left: 0;
        margin-right: 12px;
    }

    .star-rating .star {
        font-size: 1.6rem;
    }

    .captcha-box {
        padding: 8px 12px;
    }
}

/* ── Sentence Alignment result ── */
.sa-result .sa-group {
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 0;
}

.sa-result .sa-group:last-child {
    border-bottom: none;
}

.sa-source {
    color: #dc3545;
    margin-bottom: 0.25rem;
}

.sa-target {
    color: #0d6efd;
    margin-bottom: 0.25rem;
}

.sa-score {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* ── Ayah/Hadith Detection result ── */
.ahd-result {
    line-height: 2;
    font-size: 1rem;
}

.ahd-result a {
    color: #0d6efd;
    text-decoration: underline;
}

/* ── Keyword Extraction result ── */
.kwe-list {
    margin: 0;
    padding: 0;
}

.kwe-item {
    display: flex;
    align-items: baseline;
    padding: 0.35rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.kwe-item:last-child {
    border-bottom: none;
}

.kwe-keyword {
    font-weight: 600;
}

.kwe-score {
    font-size: 0.85rem;
}
