/* ============================================
   КОММЕНТАРИИ ДЛЯ СТРАНИЦЫ КОНТЕНТА
   Современный стиль как в блоге
   Чистый дизайн: аватар + контент, без тяжёлых рамок
   Поддержка всех тем (neon, light_japan, hard_japan)
   ============================================ */

/* Контейнер комментариев */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Древовидность: ответы на комментарии */
.comment-replies {
  margin-left: 54px; /* 42px аватар + 12px gap */
  border-left: 1px solid rgba(255,255,255,0.06);
  padding-left: 16px;
}

html[data-theme="light_japan"] .comment-replies,
html[data-theme="light"] .comment-replies,
html[data-theme="hard_japan"] .comment-replies {
  border-left-color: rgba(0,0,0,0.06);
}

html[data-theme="neon"] .comment-replies {
  border-left-color: rgba(0,255,255,0.08);
}

/* Ответ (вложенный комментарий) */
.comment-item.is-reply {
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.comment-item.is-reply .comment-avatar {
  width: 32px !important;
  height: 32px !important;
  font-size: 12px;
}

.comment-item.is-reply .comment-text {
  font-size: 16px !important;
}

/* Основной стиль комментария */
#comments-container .comment-item,
.comments-list .comment-item {
  display: grid !important;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 14px 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.10) !important;
  margin: 0 !important;
  transition: none;
}

#comments-container .comment-item:last-child,
.comments-list .comment-item:last-child {
  margin-bottom: 0;
  border-bottom: none !important;
}

html[data-theme="light_japan"] #comments-container .comment-item,
html[data-theme="light_japan"] .comments-list .comment-item,
html[data-theme="light"] #comments-container .comment-item,
html[data-theme="light"] .comments-list .comment-item,
html[data-theme="hard_japan"] #comments-container .comment-item,
html[data-theme="hard_japan"] .comments-list .comment-item {
  border-bottom-color: rgba(0,0,0,0.10) !important;
}

/* Аватар комментария */
.comment-item .comment-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  background: rgba(255,255,255,0.06) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

html[data-theme="light_japan"] .comment-item .comment-avatar,
html[data-theme="light"] .comment-item .comment-avatar,
html[data-theme="hard_japan"] .comment-item .comment-avatar {
  border-color: rgba(0,0,0,0.16) !important;
  background: rgba(0,0,0,0.04) !important;
  color: #333;
}

.comment-item .comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-item .avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: inherit;
}

/* Контент комментария */
.comment-item .comment-content {
  min-width: 0;
}

.comment-item .comment-text {
  font-size: 19px !important;
  line-height: 1.6 !important;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.88) !important;
  margin-top: 8px !important;
}

html[data-theme="light_japan"] .comment-item .comment-text,
html[data-theme="light"] .comment-item .comment-text {
  color: rgba(0, 0, 0, 0.88) !important;
}

/* Заголовок комментария (ник + дата + меню) */
#comments-container .comment-header,
.comment-item .comment-header {
  display: flex !important;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px !important;
  align-items: baseline;
}

/* Правый блок (дата + меню ⋯) */
.comment-item .comment-right {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

/* Левый блок (ник + бейджи) */
.comment-item .comment-who{
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

/* Имя автора комментария */
#comments-container .comment-author,
.comment-item .comment-author {
  font-weight: 900 !important;
  font-size: 14px !important;
  letter-spacing: 0.01em;
  color: var(--text-primary, rgba(255,255,255,0.95)) !important;
}

html[data-theme="light_japan"] #comments-container .comment-author,
html[data-theme="light_japan"] .comment-item .comment-author,
html[data-theme="light"] #comments-container .comment-author,
html[data-theme="light"] .comment-item .comment-author,
html[data-theme="hard_japan"] #comments-container .comment-author,
html[data-theme="hard_japan"] .comment-item .comment-author {
  color: var(--text-primary, rgba(0,0,0,0.90)) !important;
}

/* Дата комментария */
#comments-container .comment-date,
.comment-item .comment-date {
  font-size: 12px !important;
  opacity: 0.7;
  color: rgba(255, 255, 255, 0.85) !important;
}

html[data-theme="light_japan"] #comments-container .comment-date,
html[data-theme="light_japan"] .comment-item .comment-date,
html[data-theme="light"] #comments-container .comment-date,
html[data-theme="light"] .comment-item .comment-date,
html[data-theme="hard_japan"] #comments-container .comment-date,
html[data-theme="hard_japan"] .comment-item .comment-date {
  color: rgba(0, 0, 0, 0.65) !important;
}

/* Бейджи (Admin, Mod, Premium) */
.comment-item .user-badge{
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  background: rgba(255,255,255,0.06) !important;
  color: rgba(255,255,255,0.92) !important;
}

html[data-theme="light_japan"] .comment-item .user-badge,
html[data-theme="light"] .comment-item .user-badge,
html[data-theme="hard_japan"] .comment-item .user-badge {
  border-color: rgba(0,0,0,0.12) !important;
  background: rgba(0,0,0,0.04) !important;
  color: rgba(0,0,0,0.82) !important;
}

.comment-item .user-badge.admin{ 
  border-color: rgba(244,67,54,0.35) !important; 
  color: #f44336 !important; 
  background: rgba(244,67,54,0.10) !important; 
}

.comment-item .user-badge.mod{ 
  border-color: rgba(255,152,0,0.35) !important; 
  color: #ffb74d !important; 
  background: rgba(255,152,0,0.10) !important; 
}

.comment-item .user-badge.premium{ 
  border-color: rgba(255,193,7,0.35) !important; 
  color: #d4af37 !important; 
  background: rgba(255,193,7,0.12) !important; 
}

/* Действия под комментарием (лайк, дизлайк, ответить) */
#comments-container .comment-actions,
.comment-item .comment-actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  justify-content: flex-start !important;
  align-items: center;
  margin-top: 10px !important;
}

.comment-item .btn-like,
.comment-item .btn-dislike,
.comment-item .btn-reply-icon,
.comment-item button[data-action="like"],
.comment-item button[data-action="dislike"],
.comment-item button[data-action="reply"] {
  background: none !important;
  border: none !important;
  font-size: 14px !important;
  color: rgba(255,255,255,0.78) !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 4px 8px !important;
  border-radius: 6px !important;
  transition: all 0.15s ease;
  box-shadow: none !important;
  min-width: auto !important;
  width: auto !important;
  height: auto !important;
}

/* Иконки: делаем заметнее (особенно в тёмных темах) */
.comment-item .comment-actions i,
.comment-item .comment-actions .fas,
.comment-item .comment-actions .far {
  font-size: 15px !important;
  line-height: 1 !important;
  color: inherit !important;
}

html[data-theme="light_japan"] .comment-item .btn-like,
html[data-theme="light_japan"] .comment-item .btn-dislike,
html[data-theme="light_japan"] .comment-item .btn-reply-icon,
html[data-theme="light"] .comment-item .btn-like,
html[data-theme="light"] .comment-item .btn-dislike,
html[data-theme="light"] .comment-item .btn-reply-icon,
html[data-theme="light_japan"] .comment-item button[data-action="like"],
html[data-theme="light_japan"] .comment-item button[data-action="dislike"],
html[data-theme="light_japan"] .comment-item button[data-action="reply"] {
  color: rgba(0,0,0,0.62) !important;
}

/* Форма ответа: делаем как основная “пилюля” */
.reply-form textarea.form-control {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

/* Reply-форма: делаем как основная форма комментария */
.reply-form-container {
  margin-top: 8px;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
}

.reply-form-container .comment-compose {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
}

.reply-form-container textarea.form-control {
  flex: 1;
  background: transparent !important;
  min-height: 36px !important;
  max-height: 80px;
  padding: 8px 0 !important;
  resize: none;
  border: none !important;
  border-bottom: 1px solid rgba(255,255,255,0.18) !important;
  font-size: 14px;
  line-height: 1.4;
}

html[data-theme="light_japan"] .reply-form-container textarea.form-control,
html[data-theme="light"] .reply-form-container textarea.form-control,
html[data-theme="hard_japan"] .reply-form-container textarea.form-control {
  border-bottom-color: rgba(0,0,0,0.15) !important;
}

.reply-cancel-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
  margin-bottom: 2px;
}

.reply-cancel-btn:hover {
  transform: translateY(-1px);
  background: rgba(244,67,54,0.15);
  border-color: rgba(244,67,54,0.35);
  color: #f44336;
}

html[data-theme="light_japan"] .reply-cancel-btn,
html[data-theme="light"] .reply-cancel-btn,
html[data-theme="hard_japan"] .reply-cancel-btn {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.70);
}

.reply-form-container .comment-send-btn {
  width: 32px;
  height: 32px;
  margin-bottom: 2px;
}

.comment-item .btn-like:hover,
.comment-item button[data-action="like"]:hover { 
  background: rgba(76,175,80,0.15) !important; 
  color: #4caf50 !important; 
}

.comment-item .btn-like.active,
.comment-item button[data-action="like"].active { 
  color: #4caf50 !important; 
}

.comment-item .btn-dislike:hover,
.comment-item button[data-action="dislike"]:hover { 
  background: rgba(244,67,54,0.15) !important; 
  color: #f44336 !important; 
}

.comment-item .btn-dislike.active,
.comment-item button[data-action="dislike"].active { 
  color: #f44336 !important; 
}

.comment-item .btn-reply-icon:hover,
.comment-item button[data-action="reply"]:hover { 
  background: rgba(50,184,198,0.15) !important; 
  color: var(--color-primary,#32b8c6) !important; 
}

/* Меню действий (⋯) */
.comment-item .comment-menu { 
  position: relative; 
}

.comment-item .comment-menu-btn{
  width: 28px !important;
  height: 28px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
  background: rgba(255,255,255,0.04) !important;
  color: inherit !important;
  cursor: pointer;
  line-height: 1 !important;
  font-size: 18px !important;
  padding: 0 !important;
  opacity: 0.85;
}

html[data-theme="light_japan"] .comment-item .comment-menu-btn,
html[data-theme="light"] .comment-item .comment-menu-btn {
  border-color: rgba(0,0,0,0.12) !important;
  background: rgba(0,0,0,0.03) !important;
}

.comment-item .comment-menu-btn:hover{
  opacity: 1;
}

.comment-item .comment-menu-popover{
  position: absolute !important;
  right: 0 !important;
  top: 34px !important;
  min-width: 190px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  background: rgba(8,8,12,0.98) !important;
  backdrop-filter: blur(10px);
  padding: 6px !important;
  z-index: 10 !important;
  box-shadow: 0 14px 30px rgba(0,0,0,0.5) !important;
}

/* Тёмные темы (default, dark) - меню чёрное, текст светлый */
.comment-item .comment-menu-popover button,
.comment-item .comment-menu-popover a {
  color: rgba(255,255,255,0.85) !important;
}

html[data-theme="light_japan"] .comment-item .comment-menu-popover,
html[data-theme="light"] .comment-item .comment-menu-popover,
html[data-theme="hard_japan"] .comment-item .comment-menu-popover {
  border-color: rgba(0,0,0,0.14) !important;
  background: rgba(255,255,255,0.98) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,0.18) !important;
}

html[data-theme="light_japan"] .comment-item .comment-menu-popover button,
html[data-theme="light_japan"] .comment-item .comment-menu-popover a,
html[data-theme="light"] .comment-item .comment-menu-popover button,
html[data-theme="light"] .comment-item .comment-menu-popover a,
html[data-theme="hard_japan"] .comment-item .comment-menu-popover button,
html[data-theme="hard_japan"] .comment-item .comment-menu-popover a {
  color: rgba(0,0,0,0.8) !important;
}

/* Neon тема - меню тёмное с неоновым акцентом, текст светлый */
html[data-theme="neon"] .comment-item .comment-menu-popover {
  border-color: rgba(0,255,255,0.25) !important;
  background: rgba(5,5,15,0.98) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,0.6), 0 0 20px rgba(0,255,255,0.1) !important;
}

html[data-theme="neon"] .comment-item .comment-menu-popover button,
html[data-theme="neon"] .comment-item .comment-menu-popover a {
  color: rgba(255,255,255,0.9) !important;
}

html[data-theme="neon"] .comment-item .comment-menu-item:hover,
html[data-theme="neon"] .comment-item .comment-menu-popover button:hover,
html[data-theme="neon"] .comment-item .comment-menu-popover a:hover {
  background: rgba(0,255,255,0.12) !important;
  color: #00ffff !important;
}

.comment-item .comment-menu-item,
.comment-item .comment-menu-popover button,
.comment-item .comment-menu-popover a {
  width: 100% !important;
  display: block !important;
  text-align: left;
  border: none !important;
  background: transparent !important;
  color: inherit !important;
  cursor: pointer;
  padding: 10px 10px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  opacity: 0.92;
  text-decoration: none !important;
}

.comment-item .comment-menu-item:hover,
.comment-item .comment-menu-popover button:hover,
.comment-item .comment-menu-popover a:hover {
  background: rgba(255,255,255,0.08) !important;
  opacity: 1;
}

html[data-theme="light_japan"] .comment-item .comment-menu-item:hover,
html[data-theme="light"] .comment-item .comment-menu-item:hover,
html[data-theme="hard_japan"] .comment-item .comment-menu-item:hover,
html[data-theme="light_japan"] .comment-item .comment-menu-popover button:hover,
html[data-theme="light_japan"] .comment-item .comment-menu-popover a:hover {
  background: rgba(0,0,0,0.06) !important;
}

.comment-item .comment-menu-item.btn-report:hover,
.comment-item .comment-menu-popover button[data-action="report"]:hover {
  color: rgba(255, 120, 120, 0.95) !important;
}

html[data-theme="light_japan"] .comment-item .comment-menu-item.btn-report:hover,
html[data-theme="light"] .comment-item .comment-menu-item.btn-report:hover,
html[data-theme="hard_japan"] .comment-item .comment-menu-item.btn-report:hover,
html[data-theme="light_japan"] .comment-item .comment-menu-popover button[data-action="report"]:hover {
  color: #d32f2f !important;
}

/* Подсказки */
.auth-prompt,
.no-comments {
  text-align: center;
  padding: 24px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

html[data-theme="light_japan"] .auth-prompt,
html[data-theme="light_japan"] .no-comments,
html[data-theme="light"] .auth-prompt,
html[data-theme="light"] .no-comments,
html[data-theme="hard_japan"] .auth-prompt,
html[data-theme="hard_japan"] .no-comments {
  color: rgba(0, 0, 0, 0.6);
}

.auth-prompt a,
.no-comments a {
  color: var(--color-primary);
  text-decoration: none;
}

/* Форма ответа */
.reply-form-container {
  margin-top: 10px !important;
  padding: 12px !important;
  background: rgba(255,255,255,0.03) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}

html[data-theme="light_japan"] .reply-form-container,
html[data-theme="light"] .reply-form-container,
html[data-theme="hard_japan"] .reply-form-container {
  background: rgba(0,0,0,0.02) !important;
  border-color: rgba(0,0,0,0.1) !important;
}

/* Чистим старые тяжёлые стили */
.comment-item,
.comment-item:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО ЖАЛОБЫ
   ============================================ */
.comment-report-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comment-report-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.comment-report-modal .modal-content {
  position: relative;
  width: 90%;
  max-width: 420px;
  background: var(--bg-secondary, rgba(18,18,22,0.98));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

html[data-theme="light_japan"] .comment-report-modal .modal-content,
html[data-theme="light"] .comment-report-modal .modal-content,
html[data-theme="hard_japan"] .comment-report-modal .modal-content {
  background: rgba(255,255,255,0.98);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

html[data-theme="neon"] .comment-report-modal .modal-content {
  background: rgba(10,10,25,0.98);
  border-color: rgba(0,255,255,0.2);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 30px rgba(0,255,255,0.1);
}

.comment-report-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.comment-report-modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, rgba(255,255,255,0.95));
}

html[data-theme="light_japan"] .comment-report-modal .modal-header h3,
html[data-theme="light"] .comment-report-modal .modal-header h3,
html[data-theme="hard_japan"] .comment-report-modal .modal-header h3 {
  color: var(--text-primary, rgba(0,0,0,0.9));
}

.comment-report-modal .modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.comment-report-modal .modal-close:hover {
  background: rgba(244,67,54,0.2);
  color: #f44336;
}

html[data-theme="light_japan"] .comment-report-modal .modal-close,
html[data-theme="light"] .comment-report-modal .modal-close,
html[data-theme="hard_japan"] .comment-report-modal .modal-close {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.6);
}

.comment-report-modal .form-group {
  margin-bottom: 16px;
}

.comment-report-modal .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, rgba(255,255,255,0.85));
}

html[data-theme="light_japan"] .comment-report-modal .form-group label,
html[data-theme="light"] .comment-report-modal .form-group label,
html[data-theme="hard_japan"] .comment-report-modal .form-group label {
  color: rgba(0,0,0,0.75);
}

.comment-report-modal select,
.comment-report-modal textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  color: var(--text-primary, rgba(255,255,255,0.9));
  font-size: 14px;
}

.comment-report-modal select:focus,
.comment-report-modal textarea:focus {
  outline: none;
  border-color: var(--color-primary, #667eea);
}

html[data-theme="light_japan"] .comment-report-modal select,
html[data-theme="light_japan"] .comment-report-modal textarea,
html[data-theme="light"] .comment-report-modal select,
html[data-theme="light"] .comment-report-modal textarea,
html[data-theme="hard_japan"] .comment-report-modal select,
html[data-theme="hard_japan"] .comment-report-modal textarea {
  border-color: rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.85);
}

.comment-report-modal textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-report-modal .form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.comment-report-modal .btn-submit {
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary, #667eea);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.comment-report-modal .btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.comment-report-modal .btn-cancel {
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary, rgba(255,255,255,0.8));
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.comment-report-modal .btn-cancel:hover {
  background: rgba(255,255,255,0.08);
}

html[data-theme="light_japan"] .comment-report-modal .btn-cancel,
html[data-theme="light"] .comment-report-modal .btn-cancel,
html[data-theme="hard_japan"] .comment-report-modal .btn-cancel {
  border-color: rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.7);
}

html[data-theme="light_japan"] .comment-report-modal .btn-cancel:hover,
html[data-theme="light"] .comment-report-modal .btn-cancel:hover,
html[data-theme="hard_japan"] .comment-report-modal .btn-cancel:hover {
  background: rgba(0,0,0,0.05);
}

