/* =========================================================
   VORTEX READER — التقييم والتعليقات
   يعتمد على متغيرات الثيم في reader.css
   ========================================================= */

.chip.rate { color: var(--accent-2); }

.chapter-social { margin: 46px auto 0; max-width: 680px; text-align: start; }
.chapter-social .soc { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); }

/* ---------- الكلام المشترك ---------- */
.soc h3 { margin: 0; font-size: 16px; font-weight: 800; }
.soc-hint, .soc-empty { color: var(--mute); font-size: 13px; line-height: 1.7; margin: 0; }
.soc-link { color: var(--accent-2); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 2px 4px; }
.soc-link.danger { color: var(--ds-danger-soft); margin-top: 8px; }
.soc-link:hover { color: var(--text); }
.soc-err { min-height: 0; margin: 6px 0 0; color: var(--ds-danger-soft); font-size: 13px; line-height: 1.6; }
.soc-err:empty { display: none; }

/* ---------- التقييم ---------- */
.soc-rate { padding: 22px 22px 18px; border-bottom: 1px solid var(--line); }
.soc-rate-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.soc-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.soc-avg { font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--accent-2); }
.soc-stars-ro { color: var(--accent-2); letter-spacing: 2px; font-size: 14px; }
.soc-sum small { color: var(--mute); font-size: 12.5px; }
.soc-stars { display: flex; gap: 4px; margin-top: 14px; direction: ltr; }
.soc-star {
    width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; line-height: 1;
    border: 1px solid var(--line); border-radius: 2px; background: var(--raised); color: var(--mute);
    transition: color 120ms, border-color 120ms, background 120ms;
}
.soc-star.on { color: var(--accent-2); border-color: var(--accent); }
.soc-star:hover { border-color: var(--accent-2); }
.soc-rate .soc-hint { margin-top: 10px; }

/* ---------- التعليقات ---------- */
.soc-comments { padding: 22px; }
.soc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.soc-id { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--mute); font-size: 13px; margin-bottom: 14px; }
.soc-id b { color: var(--text); }

.soc-form { display: grid; gap: 10px; }
.soc-form textarea {
    width: 100%; min-height: 96px; resize: vertical; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 2px;
    background: var(--raised); color: var(--text); font-size: 15px; line-height: 1.8; outline: none;
}
.soc-form textarea:focus { border-color: var(--accent); }
.soc-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.soc-emo-btn { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px; color: var(--text); font-size: 13px; font-weight: 600; }
.soc-emo-btn:hover, .soc-emo-btn[aria-expanded="true"] { border-color: var(--accent); color: var(--accent-2); }
.soc-count { font-family: var(--mono); font-size: 12px; color: var(--mute); direction: ltr; }
.soc-count.warn { color: #ffb36b; }
.soc-emos { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 2px; background: var(--raised); }
.soc-emo { height: 38px; font-size: 20px; border-radius: 2px; }
.soc-emo:hover { background: var(--line); }
.soc-namerow input {
    width: 100%; min-height: 40px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px;
    background: var(--raised); color: var(--text); font-size: 14px; outline: none;
}
.soc-namerow input:focus { border-color: var(--accent); }
.soc-actions { display: flex; justify-content: flex-end; }
.soc-actions .btn { min-height: 42px; padding: 0 22px; border-radius: 2px; font-weight: 700; font-size: 14px; background: var(--accent); color: var(--on-accent); border: 0; }
.soc-actions .btn:disabled { opacity: 0.6; }

.soc-list { display: grid; gap: 10px; margin-top: 22px; }
.soc-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 2px; background: var(--raised); }
.soc-item.mine { border-color: var(--line-2); }
.soc-item header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.soc-item header b { font-size: 14px; font-weight: 700; }
.soc-item time { margin-inline-start: auto; color: var(--mute); font-size: 12px; font-family: var(--mono); direction: ltr; }
.soc-item p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.85; }
.soc-badge { padding: 0 7px; border-radius: 2px; font-size: 11px; font-weight: 700; line-height: 1.7; border: 1px solid var(--line-2); color: var(--mute); }
.soc-badge.acc { border-color: var(--accent); color: var(--accent-2); }
.soc-more { justify-self: center; margin-top: 14px; min-height: 40px; padding: 0 18px; border: 1px dashed var(--line-2); border-radius: 2px; color: var(--accent-2); font-weight: 600; font-size: 13.5px; }
.soc-more:hover { border-color: var(--accent); }

/* ---------- نافذة الحساب ---------- */
.soc-auth { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.55); opacity: 0; pointer-events: none; transition: opacity 180ms; }
.soc-auth.open { opacity: 1; pointer-events: auto; }
.soc-auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 2px; padding: 18px 20px 22px; }
.soc-auth-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.soc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; }
.soc-tabs button { min-height: 40px; border: 1px solid var(--line); border-radius: 2px; color: var(--mute); font-weight: 700; font-size: 14px; }
.soc-tabs button.on { border-color: var(--accent); color: var(--accent-2); background: color-mix(in srgb, var(--accent) 12%, var(--raised)); }
.soc-a-form { display: grid; gap: 12px; }
.soc-a-form label { display: grid; gap: 6px; font-size: 13px; color: var(--mute); }
.soc-a-form input { min-height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 2px; background: var(--raised); color: var(--text); font-size: 15px; outline: none; direction: ltr; text-align: start; }
.soc-a-form input:focus { border-color: var(--accent); }
.soc-a-form #soc-a-user { direction: rtl; }
.soc-a-form .btn { min-height: 44px; border: 0; border-radius: 2px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14.5px; }
.soc-a-form .btn:disabled { opacity: 0.6; }
.soc-a-msg { margin: 0; min-height: 0; color: var(--ds-danger-soft); font-size: 13px; line-height: 1.6; }
.soc-a-msg:empty { display: none; }
.soc-a-msg.ok { color: var(--accent-2); }

.soc-toast { position: fixed; bottom: 96px; left: 50%; z-index: 1100; transform: translate(-50%, 8px); padding: 9px 16px; border-radius: 2px; background: var(--raised); border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 200ms, transform 200ms; white-space: nowrap; }
.soc-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
    .chapter-social { margin-top: 32px; }
    .soc-rate, .soc-comments { padding: 18px 16px; }
    .soc-star { width: 42px; height: 42px; font-size: 23px; }
}

/* ===== تصميم التعليقات بأسلوب منصات التواصل ===== */
.soc { display: grid; gap: 16px; }
.soc-rate, .soc-comments { background: var(--vx-card, #0e1626); border: 1px solid var(--vx-line, rgba(255,255,255,.08)); border-radius: 20px; padding: 16px; }
.soc-rate-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.soc-rate-head h3, .soc-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: #fff; }
.soc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.soc-hint-inline { color: var(--vx-ink-3, #7f8ba3); font-size: 12px; }
.soc-compose { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--vx-line, rgba(255,255,255,.08)); margin-bottom: 14px; }
.soc-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #04121a; background: linear-gradient(135deg, #13abd2, #76e5fd); flex: none; }
.soc-av.acc { box-shadow: 0 0 0 2px rgba(118,229,253,.35); }
.soc-form { display: grid; gap: 8px; min-width: 0; }
.soc-form textarea { width: 100%; resize: vertical; min-height: 56px; background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--vx-line, rgba(255,255,255,.12)); padding: 8px 2px; font: inherit; font-size: 15px; line-height: 1.7; outline: none; }
.soc-form textarea:focus { border-bottom-color: var(--vx-accent, #13ABD2); }
.soc-namerow input { width: 100%; background: rgba(0,0,0,.25); border: 1px solid var(--vx-line, rgba(255,255,255,.1)); border-radius: 999px; padding: 8px 14px; color: inherit; font: inherit; font-size: 13px; }
.soc-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.soc-emo-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--vx-line, rgba(255,255,255,.12)); background: transparent; color: inherit; cursor: pointer; font-size: 18px; }
.soc-count { margin-inline-start: auto; color: var(--vx-ink-3, #7f8ba3); font-size: 12px; }
.soc-post { height: 36px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 800; color: #04121a; background: linear-gradient(135deg, #13abd2, #76e5fd); }
.soc-post:disabled { opacity: .5; cursor: default; }
.soc-emos { display: flex; flex-wrap: wrap; gap: 6px; }
.soc-emos.hidden { display: none; }
.soc-emo { width: 34px; height: 34px; border-radius: 10px; border: 0; background: rgba(255,255,255,.05); cursor: pointer; font-size: 18px; }
.soc-err { margin: 0; color: #ff9aa6; font-size: 13px; min-height: 0; }
.soc-err:empty { display: none; }
.soc-list { display: grid; gap: 4px; }
.soc-item { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 6px; border-radius: 14px; }
.soc-item:hover { background: rgba(255,255,255,.025); }
.soc-item .soc-av { width: 36px; height: 36px; font-size: 14px; }
.soc-item .soc-av:not(.acc) { background: rgba(118,229,253,.14); color: #76e5fd; }
.soc-item header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.soc-item header b { color: #fff; }
.soc-item time { color: var(--vx-ink-3, #7f8ba3); font-size: 12px; }
.soc-item p { margin: 4px 0 0; color: var(--vx-ink-2, #b9c4d8); line-height: 1.75; font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }
.soc-row { display: flex; gap: 14px; margin-top: 6px; }
.soc-act { background: none; border: 0; padding: 0; color: var(--vx-ink-3, #7f8ba3); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.soc-act:hover { color: #76e5fd; }
.soc-act.danger { color: #ff9aa6; }
.soc-more { width: 100%; margin-top: 10px; height: 40px; border-radius: 999px; border: 1px solid var(--vx-line, rgba(255,255,255,.12)); background: transparent; color: #76e5fd; font: inherit; font-weight: 700; cursor: pointer; }
.soc-empty { text-align: center; color: var(--vx-ink-3, #7f8ba3); padding: 18px 8px; margin: 0; }
@media (max-width: 480px) { .soc-compose { grid-template-columns: 34px 1fr; gap: 10px; } .soc-av { width: 34px; height: 34px; } .soc-item { grid-template-columns: 34px 1fr; } }
.soc-av-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; display: block; background: #0e1626; }
.soc-av-img.acc { box-shadow: 0 0 0 2px rgba(118,229,253,.35); }
.soc-compose .soc-av-img { width: 40px; height: 40px; }
@media (max-width: 480px) { .soc-item .soc-av-img { width: 34px; height: 34px; } }
