/* mcp-comments.css (v1.4) — targeted fixes for buttons & cancel icon */

/* === Base container === */
#mcp-comments-root {
  max-width: 820px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color: #222;
}

/* форма: textarea 2 строки + кнопка справа */
.mcp-comment-form { margin-bottom: 18px; }

/* ensure input wrap is positioning context for cancel icon */
.mcp-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid #dcdcdc;
  padding: 6px 8px;
  background: #fff;
  position: relative; /* IMPORTANT: for absolute cancel icon */
}

/* textarea reserves left padding for cancel icon area */
.mcp-input-wrap textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.3;
  padding: 6px 10px 6px 40px; /* left padding reserved for cancel icon */
  min-height: calc(1.3em * 2 + 12px); /* ~2 lines */
  box-sizing: border-box;
}

/* === Submit button styled like reaction buttons (gray default, blue on hover) === */
/* === Submit button styled like reaction buttons === */
.mcp-submit-button {
  background: #f2f2f2 !important;           /* еле серый фон, как у реакций */
  border: none !important;
  border-radius: 8px !important;
  width: 40px !important;                   /* квадратная кнопка */
  height: 40px !important;
  display: inline-flex;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
  flex-shrink: 0 !important;
}

/* иконка внутри кнопки */
.mcp-submit-button .mcp-send-icon {
  width: 18px;
  height: 18px;
  fill: #444;                    /* тёмно-серая по умолчанию */
  transition: fill 0.15s ease;
  display: block;
}

/* наведение — фон синеет, иконка белеет */
.mcp-submit-button:hover {
  background: #0b5dd7 !important;           /* синий фон */
}
.mcp-submit-button:hover .mcp-send-icon {
  fill: #fff !important;                    /* белая иконка при hover */
}

/* фокус с лёгким обводом */
.mcp-submit-button:focus {
  outline: 2px solid rgba(0,115,170,0.18) !important;
  outline-offset: 2px !important;
}


/* login notice */
.mcp-login-notice {
  padding: 12px;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #eee;
  color: #666;
  margin-bottom: 12px;
}

/* comments list */
#mcp-comments-list { margin-top: 6px; }

/* each comment: use margin-left for nesting */
.comment {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 12px 0;
  /* margin-left is set inline from PHP according to nesting level */
}

/* avatar: apply 5px rounding aggressively */
.comment__avatar img,
.mcp-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px !important; /* aggressive rounding as requested */
  object-fit: cover;
  display: block;
}

/* body */
.comment__body {
  flex: 1;
  min-width: 0;
}
.comment__meta {
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.comment__meta .comment__author { font-weight: 700; }
.comment__date { color: #777; font-size: 13px; }

.comment__text {
  font-size: 15px;
  line-height: 1.5;
  color: #111;
  white-space: normal;
  word-wrap: break-word;
}

/* actions */
.comment__actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* reaction & reply button base: identical look */
.mcp-reaction-btn,
.mcp-reply-btn {
  background: #f2f2f2;        /* default gray like requested */
  border: none;
  padding: 3px 5px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background .12s ease, color .12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* hover state -> slightly darker gray */
.mcp-reaction-btn:hover,
.mcp-reply-btn:hover {
  background: #dcdcdc;
}

/* active indicates user's reaction/selection -> blue */
.mcp-reaction-btn.active,
.mcp-reply-btn.active {
  background: #0b5dd7;
  color: #fff;
}

/* reply container holds the moved form */
.mcp-reply-container { margin-top: 8px; }

/* --------------------
   Cancel button (icon inside the input area)
   -------------------- */
/* Make cancel styled icon (no default button look), positioned inside .mcp-input-wrap */
.mcp-cancel-reply {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  border-radius: 6px;
  z-index: 5;
}

/* cancel svg */
.mcp-cancel-reply svg {
  width: 14px;
  height: 14px;
  fill: #666;
  display: block;
}
.mcp-cancel-reply:hover svg {
  fill: #000;
}

/* When cancel is hidden inline style display:none it's fine; but force no default margin if visible */
.mcp-cancel-reply[style*="display:none"] { display: none !important; }

/* ensure when .mcp-input-wrap is moved under reply container the cancel icon still shows inside it */
.mcp-reply-container .mcp-input-wrap { position: relative; }

/* small screens tweak */
@media (max-width:600px) {
  .comment__avatar img, .mcp-avatar { width:40px; height:40px; }
  .mcp-input-wrap textarea { font-size: 14px; padding-left: 34px; }
  .mcp-submit-button { padding: 6px; }
}

/* small visual tweak: ensure reply forms (moved form) look the same as top-level */
.mcp-reply-container .mcp-input-wrap { margin-top: 6px; }

/* keep word wrapping safe */
.comment__text p { margin: 0; }