/* نظام التعليقات الموحّد — يُستخدم في الأخبار والمباريات */

.news-page__comments {
  padding: 24px 26px;
  border-radius: 18px;
  background: #131521;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.news-page__comments-title {
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 18px;
  color: #f2f4fb;
}

.news-page__comments .comment-form {
  margin-bottom: 20px;
}

.news-page__comments .comment-form textarea {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease;
}

.news-page__comments .comment-form textarea:focus {
  border-color: rgba(57, 219, 191, 0.45);
}

.news-page__comments .radius-btn {
  border-radius: 12px;
}

/* —— بطاقة التعليق (رئيسي + فرعي) —— */
.news-page__comments-list .comment-item,
#user_comment .comment-item,
#user_comment_user .comment-item,
#comment_popup .news-page__comments-list .comment-item {
  padding: 16px 18px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.news-page__comments-list .comment-item:last-child,
#user_comment .comment-item:last-child,
#user_comment_user .comment-item:last-child,
#comment_popup .news-page__comments-list .comment-item:last-child {
  margin-bottom: 0;
}

.news-page__comments-list .comment-head,
#user_comment .comment-head,
#user_comment_user .comment-head,
#comment_popup .news-page__comments-list .comment-head {
  margin-bottom: 10px;
}

.news-page__comments-list .commenter > img,
#user_comment .commenter > img,
#user_comment_user .commenter > img,
#comment_popup .news-page__comments-list .commenter > img,
#comment_popup .news-page__comment-parent .commenter > img {
  width: 38px;
  height: 38px;
  margin-inline-start: 0;
  margin-inline-end: 12px;
  object-fit: cover;
}

.news-page__comments-list .commenter h3,
#user_comment .commenter h3,
#user_comment_user .commenter h3,
#comment_popup .news-page__comments-list .commenter h3,
#comment_popup .news-page__comment-parent .commenter h3 {
  font-size: 14px;
  font-weight: 800;
  color: #f2f4fb;
  margin: 0 0 2px;
}

.news-page__comments-list .commenter span,
#user_comment .commenter span,
#user_comment_user .commenter span,
#comment_popup .news-page__comments-list .commenter span,
#comment_popup .news-page__comment-parent .commenter span {
  font-size: 12px;
  font-weight: 600;
  color: #9aa0b5;
}

.news-page__comments-list .comment-text,
#user_comment .comment-text,
#user_comment_user .comment-text,
#comment_popup .news-page__comments-list .comment-text {
  color: #d5d8e6;
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.news-page__comments-list .comment-action,
#user_comment .comment-action,
#user_comment_user .comment-action,
#comment_popup .news-page__comments-list .comment-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.news-page__comments-list .comment-action a:not(.view-replies),
#user_comment .comment-action a:not(.view-replies),
#user_comment_user .comment-action a:not(.view-replies),
#comment_popup .news-page__comments-list .comment-action a:not(.view-replies) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #bfc3d4;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  margin: 0;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.news-page__comments-list .comment-dislike svg,
#user_comment .comment-dislike svg,
#user_comment_user .comment-dislike svg,
#comment_popup .news-page__comments-list .comment-dislike svg {
  transform: rotate(180deg);
}

.news-page__comments-list .comment-action a:not(.view-replies):hover,
#user_comment .comment-action a:not(.view-replies):hover,
#user_comment_user .comment-action a:not(.view-replies):hover,
#comment_popup .news-page__comments-list .comment-action a:not(.view-replies):hover {
  background: rgba(57, 219, 191, 0.1);
  border-color: rgba(57, 219, 191, 0.25);
  color: #39dbbf;
}

.news-page__comments-list .comment-action a.clicked,
#user_comment .comment-action a.clicked,
#user_comment_user .comment-action a.clicked,
#comment_popup .news-page__comments-list .comment-action a.clicked {
  background: rgba(57, 219, 191, 0.14);
  border-color: rgba(57, 219, 191, 0.35);
  color: #39dbbf;
}

.news-page__comments-list .comment-action .view-replies,
#user_comment .comment-action .view-replies,
#user_comment_user .comment-action .view-replies,
#comment_popup .news-page__comments-list .comment-action .view-replies {
  margin-inline-start: auto;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #39dbbf;
  background: rgba(57, 219, 191, 0.08);
  border: 1px solid rgba(57, 219, 191, 0.2);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.news-page__comments-list .comment-action .view-replies:hover,
#user_comment .comment-action .view-replies:hover,
#user_comment_user .comment-action .view-replies:hover,
#comment_popup .news-page__comments-list .comment-action .view-replies:hover {
  background: rgba(57, 219, 191, 0.14);
  color: #fff;
}

/* —— نافذة الردود —— */
#comment_popup.popup-item .popup-content.news-page__comments-popup {
  width: min(580px, calc(100vw - 24px));
  max-width: 100%;
  border-radius: 18px;
  background: #131521;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 22px 20px 20px;
  margin-top: 0;
}

#comment_popup.popup-item .news-page__comments.news-page__comments--replies {
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  padding: 20px 0 0;
}

#comment_popup.popup-item .close-popup {
  top: 18px;
  left: 18px;
  inset-inline-start: 18px;
  inset-inline-end: auto;
}

#comment_popup .news-page__comments-list .comment-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

#comment_popup .news-page__comments-list .comment-head .comments-actions {
  margin-inline-start: auto;
  margin-right: 0;
}

/* —— هيدر الحدث داخل النافذة —— */
#comment_popup .news-page__event-parent {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(57, 219, 191, 0.06);
  border: 1px solid rgba(57, 219, 191, 0.18);
}

#comment_popup .news-page__event-parent--exchange {
  justify-content: space-between;
  flex-wrap: wrap;
}

#comment_popup .news-page__event-parent .inline-player-item {
  padding: 0;
  margin: 0;
  background: none;
  border: none;
}

#comment_popup .news-page__event-parent .player {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

#comment_popup .news-page__event-parent .img img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

#comment_popup .news-page__event-parent h5 {
  margin: 0;
  font-size: 14px;
  font-weight: 800;
  color: #f2f4fb;
}

#comment_popup .news-page__event-parent .player-def {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

#comment_popup .news-page__event-parent .player-def b {
  font-size: 12px;
  font-weight: 700;
  color: #9aa0b5;
}

#comment_popup .news-page__event-parent .news-page__event-assist {
  color: #bfc3d4;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

#comment_popup .news-page__event-parent .news-page__event-assist:hover {
  color: #39dbbf;
}

#comment_popup .news-page__event-parent .news-page__event-player-out {
  color: #fc4d4d;
}

#comment_popup .news-page__event-parent .news-page__event-player-in {
  color: #5bd286;
}

#comment_popup .news-page__event-parent .exchange-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

#comment_popup .news-page__event-parent .exchange-icon span {
  font-size: 11px;
  font-weight: 700;
  color: #9aa0b5;
}

#comment_popup .news-page__comment-parent.player-popup-head {
  display: block;
  padding: 16px 18px;
}

#comment_popup .news-page__comment-parent {
  margin: 0 0 14px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(57, 219, 191, 0.06);
  border: 1px solid rgba(57, 219, 191, 0.18);
}

#comment_popup .news-page__comment-parent .comment-item {
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

#comment_popup .news-page__comment-parent .comment-text {
  margin-bottom: 0;
  color: #e8eaf4;
}

#comment_popup .news-page__comments--replies {
  margin-bottom: 0;
  padding: 20px 18px;
}

#comment_popup .news-page__comments-title--replies {
  font-size: 14px;
  margin-bottom: 14px;
}

#comment_popup .news-page__comments--replies .comment-form textarea {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

/* —— زر تحميل المزيد —— */
.news-page__more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 18px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: #bfc3d4;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.news-page__more-btn svg {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.news-page__more-btn:hover {
  background: rgba(57, 219, 191, 0.1);
  border-color: rgba(57, 219, 191, 0.28);
  color: #39dbbf;
}

.news-page__more-btn:hover svg {
  transform: translateY(2px);
}

.news-page__more-btn:active {
  transform: scale(0.99);
}

/* —— الوضع الفاتح —— */
html.light:not(.dark) .news-page__comments {
  background: #fff;
  border-color: rgba(15, 20, 40, 0.08);
  box-shadow: 0 10px 30px rgba(15, 20, 40, 0.06);
}

html.light:not(.dark) .news-page__comments-title {
  color: #0a0d12;
}

html.light:not(.dark) .news-page__comments-list .comment-item,
html.light:not(.dark) #user_comment .comment-item,
html.light:not(.dark) #user_comment_user .comment-item,
html.light:not(.dark) #comment_popup .news-page__comments-list .comment-item {
  background: #f7f8fc;
  border-color: rgba(15, 20, 40, 0.08);
}

html.light:not(.dark) .news-page__comments-list .commenter h3,
html.light:not(.dark) #user_comment .commenter h3,
html.light:not(.dark) #user_comment_user .commenter h3,
html.light:not(.dark) #comment_popup .news-page__comments-list .commenter h3,
html.light:not(.dark) #comment_popup .news-page__comment-parent .commenter h3 {
  color: #0e1019;
}

html.light:not(.dark) .news-page__comments-list .comment-text,
html.light:not(.dark) #user_comment .comment-text,
html.light:not(.dark) #user_comment_user .comment-text,
html.light:not(.dark) #comment_popup .news-page__comments-list .comment-text {
  color: #3a4158;
}

html.light:not(.dark) .news-page__comments-list .comment-action a:not(.view-replies),
html.light:not(.dark) #user_comment .comment-action a:not(.view-replies),
html.light:not(.dark) #user_comment_user .comment-action a:not(.view-replies),
html.light:not(.dark) #comment_popup .news-page__comments-list .comment-action a:not(.view-replies) {
  background: #fff;
  border-color: rgba(15, 20, 40, 0.1);
  color: #3a4158;
}

html.light:not(.dark) #comment_popup .news-page__event-parent {
  background: rgba(57, 219, 191, 0.08);
  border-color: rgba(57, 219, 191, 0.22);
}

html.light:not(.dark) #comment_popup .news-page__event-parent h5 {
  color: #0e1019;
}

html.light:not(.dark) #comment_popup .popup-content.news-page__comments-popup {
  background: #fff;
  border-color: rgba(15, 20, 40, 0.1);
}

html.light:not(.dark) #comment_popup .news-page__comment-parent {
  background: rgba(57, 219, 191, 0.08);
  border-color: rgba(57, 219, 191, 0.22);
}

html.light:not(.dark) .news-page__more-btn {
  color: #3a4158;
  background: #f7f8fc;
  border-color: rgba(15, 20, 40, 0.1);
}

html.light:not(.dark) .news-page__more-btn:hover {
  background: rgba(57, 219, 191, 0.12);
  border-color: rgba(57, 219, 191, 0.3);
  color: #0a8f78;
}

/* —— موبايل —— */
@media (max-width: 991px) {
  .news-page__comments {
    padding: 20px 18px;
    border-radius: 14px;
  }
}
