/* =========================================================
   Rabino-Comments  —  Front-end styles (v2.3.0)
   Minimal, modern, RTL, fully compatible with WordPress + Elementor + WooCommerce
   نکته مهم: متغیرهای رنگی از inline-style با !important تزریق می‌شوند
   ========================================================= */

/* ---------- base / box sizing ---------- */
.rabino-comments-wrapper,
.rabino-comments-wrapper * {
  box-sizing: border-box;
}
.rabino-comments-wrapper {
  font-family: var(--rabino-font);
  color: var(--r-text, #0f172a);
  line-height: 1.7;
  font-size: 15px;
  width: 100%;
  max-width: none;
}

/* =========================================================
   FORM CARD
   ========================================================= */
.rabino-comments-wrapper .rabino-form-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  width: 100%;
}
.rabino-comments-wrapper .rabino-form-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
}
.rabino-comments-wrapper .rabino-header-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  background: var(--rabino-primary-10);
  color: var(--rabino-primary-solid);
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.rabino-comments-wrapper .rabino-form-title {
  margin: 0 0 4px 0;
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}
.rabino-comments-wrapper .rabino-form-subtitle {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 400;
}

/* =========================================================
   REPLY BADGE — NO BORDER (درخواست: هیچ بردری نداشته باشد)
   ========================================================= */
.rabino-comments-wrapper #rabino-reply-badge.rabino-reply-badge,
.rabino-comments-wrapper .rabino-reply-badge {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0 !important;
  border-width: 0 !important;
  border-style: none !important;
  outline: 0 !important;
  box-shadow: none !important;
  background: var(--rabino-primary-10);
  color: var(--rabino-primary-solid);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  transition: all 0.25s ease;
}
.rabino-comments-wrapper .rabino-reply-badge * {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
.rabino-comments-wrapper .rabino-reply-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--rabino-primary-solid);
}
.rabino-comments-wrapper .rabino-reply-info strong {
  font-weight: 700;
}

/* =========================================================
   CANCEL REPLY BUTTON — مینیمال و جذاب (درخواست ۴)
   ========================================================= */
.rabino-comments-wrapper #rabino-cancel-reply-btn.rabino-cancel-btn,
.rabino-comments-wrapper .rabino-cancel-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.6) !important;
  color: #64748b !important;
  border: 0 !important;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.22s ease;
  flex-shrink: 0;
  font-family: var(--rabino-font);
  line-height: 1;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.rabino-comments-wrapper .rabino-cancel-btn:hover {
  background: rgba(220, 38, 38, 0.08) !important;
  color: #dc2626 !important;
}
.rabino-comments-wrapper .rabino-cancel-btn .rabino-cancel-label {
  font-size: 12px;
  font-weight: 500;
}
.rabino-comments-wrapper .rabino-cancel-btn .rabino-cancel-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(100, 116, 139, 0.15);
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  transition: all 0.22s ease;
}
.rabino-comments-wrapper .rabino-cancel-btn:hover .rabino-cancel-x {
  background: #dc2626;
  color: #ffffff;
}

/* =========================================================
   INPUTS — مینیمال و جذاب برای حالت مهمان (درخواست ۲)
   ========================================================= */
.rabino-comments-wrapper .rabino-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .rabino-comments-wrapper .rabino-input-grid {
    grid-template-columns: 1fr;
  }
}
.rabino-comments-wrapper .rabino-input-group {
  position: relative;
}
.rabino-comments-wrapper .rabino-textarea-group {
  margin-bottom: 18px;
}
.rabino-comments-wrapper .rabino-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.rabino-comments-wrapper .rabino-label .required {
  color: #ef4444;
  margin-right: 2px;
}

.rabino-comments-wrapper .rabino-input,
.rabino-comments-wrapper .rabino-textarea {
  width: 100%;
  background: #f8fafc;
  color: #0f172a;
  font-family: var(--rabino-font) !important;
  font-size: 14px;
  font-weight: 400;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1.7;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  /* ===== درخواست ۳: غیرفعال کردن resize textarea ===== */
  resize: none !important;
}
.rabino-comments-wrapper .rabino-input::placeholder,
.rabino-comments-wrapper .rabino-textarea::placeholder {
  color: #94a3b8;
  font-weight: 400;
  opacity: 1;
}
.rabino-comments-wrapper .rabino-input:hover,
.rabino-comments-wrapper .rabino-textarea:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}
.rabino-comments-wrapper .rabino-input:focus,
.rabino-comments-wrapper .rabino-textarea:focus {
  border-color: var(--rabino-primary-solid);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--rabino-primary-10);
}

.rabino-comments-wrapper .rabino-input.dir-ltr,
.rabino-comments-wrapper .dir-ltr {
  direction: ltr;
  text-align: left;
}

.rabino-comments-wrapper .rabino-textarea {
  min-height: 130px;
  max-height: 400px;
}

/* Logged-in badge */
.rabino-comments-wrapper .rabino-logged-user-container {
  margin-bottom: 14px;
}
.rabino-comments-wrapper .rabino-logged-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rabino-primary-10);
  color: var(--rabino-primary-solid);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  border: 0;
}
.rabino-comments-wrapper .rabino-logged-badge .rabino-username-static {
  font-weight: 700;
}

/* =========================================================
   SUBMIT BUTTON
   ========================================================= */
.rabino-comments-wrapper .rabino-form-footer {
  display: flex;
  justify-content: flex-end;
}
.rabino-comments-wrapper .rabino-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--rabino-primary);
  color: #fff;
  border: none;
  padding: 12px 26px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--rabino-font);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px var(--rabino-primary-20);
  line-height: 1;
}
.rabino-comments-wrapper .rabino-submit-btn:hover {
  background: var(--rabino-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--rabino-hover-20);
}
.rabino-comments-wrapper .rabino-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   TOAST NOTIFICATION
   ========================================================= */
.rabino-comments-wrapper .rabino-ajax-toast {
  display: none;
  align-items: center;
  gap: 10px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}
.rabino-comments-wrapper .rabino-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

/* =========================================================
   COMMENTS LIST
   ========================================================= */
.rabino-comments-wrapper .rabino-comments-list-section {
  width: 100%;
}
.rabino-comments-wrapper .rabino-list-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.rabino-comments-wrapper .rabino-list-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.rabino-comments-wrapper .rabino-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--rabino-primary-10);
  color: var(--rabino-primary-solid);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  padding: 0 8px;
}

/* Empty state */
.rabino-comments-wrapper .rabino-empty-state {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* Tree structure */
.rabino-comments-wrapper .rabino-tree {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rabino-comments-wrapper .rabino-comment-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.rabino-comments-wrapper .rabino-comment-card:hover {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}
.rabino-comments-wrapper .rabino-children {
  margin-top: 14px;
  margin-right: 20px;
  padding-right: 20px;
  border-right: 2px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.rabino-comments-wrapper .rabino-children.depth-2 {
  margin-right: 14px;
  padding-right: 14px;
  border-right-color: var(--rabino-primary-20);
}
.rabino-comments-wrapper .rabino-comment-card.depth-2 {
  background: #fafbff;
}
.rabino-comments-wrapper .rabino-comment-card.depth-3 {
  background: #fdfbf7;
}

/* Header of each comment */
.rabino-comments-wrapper .rabino-comment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.rabino-comments-wrapper .rabino-author-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.rabino-comments-wrapper .rabino-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid #e2e8f0;
}
.rabino-comments-wrapper .rabino-name-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
}
.rabino-comments-wrapper .rabino-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.rabino-comments-wrapper .rabino-verified-buyer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  background: #ecfccb;
  color: #3f6212;
  padding: 2px 8px;
  border-radius: 20px;
}
.rabino-comments-wrapper .rabino-badge-depth {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--rabino-primary-10);
  color: var(--rabino-primary-solid);
  padding: 2px 8px;
  border-radius: 20px;
}
.rabino-comments-wrapper .rabino-comment-date {
  font-size: 12px;
  color: #94a3b8;
}

/* Reply button */
.rabino-comments-wrapper .rabino-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--rabino-primary-solid);
  border: 1.5px solid var(--rabino-primary-20);
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--rabino-font);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  line-height: 1;
}
.rabino-comments-wrapper .rabino-reply-btn:hover {
  background: var(--rabino-primary);
  color: #fff;
  border-color: var(--rabino-primary);
  transform: translateX(-2px);
}

/* Comment body */
.rabino-comments-wrapper .rabino-comment-body p {
  margin: 0;
  font-size: 14.5px;
  color: #0f172a;
  line-height: 1.8;
  word-break: break-word;
}

/* =========================================================
   HELPERS
   ========================================================= */
.rabino-comments-wrapper .text-left {
  text-align: left;
}
.rabino-comments-wrapper .text-right {
  text-align: right;
}
.rabino-comments-wrapper .rabino-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
}

/* =========================================================
   Google reCaptcha v2
   ========================================================= */
.rabino-comments-wrapper .rabino-recaptcha-wrapper {
  margin-bottom: 22px;
  display: flex;
  justify-content: flex-start; /* ترازبندی کپچا */
  overflow: hidden;
}
@media (max-width: 480px) {
  .rabino-comments-wrapper .rabino-recaptcha-wrapper {
    justify-content: center; /* در موبایل وسط‌چین شود */
    transform: scale(0.95);
    transform-origin: center center;
  }
}

/* =========================================================
   سازگاری با المنتور / ووکامرس / تم‌ها
   ========================================================= */
.elementor .rabino-comments-wrapper,
.elementor .rabino-comments-wrapper *,
.woocommerce .rabino-comments-wrapper,
.woocommerce .rabino-comments-wrapper * {
  box-sizing: border-box;
}

/* از بین بردن ریست‌های فرم تم‌های مختلف */
.rabino-comments-wrapper input[type="text"],
.rabino-comments-wrapper input[type="email"],
.rabino-comments-wrapper input[type="url"],
.rabino-comments-wrapper textarea {
  background-image: none !important;
  box-shadow: none !important;
  text-indent: 0 !important;
}
.rabino-comments-wrapper input[type="text"]:focus,
.rabino-comments-wrapper input[type="email"]:focus,
.rabino-comments-wrapper input[type="url"]:focus,
.rabino-comments-wrapper textarea:focus {
  box-shadow: 0 0 0 4px var(--rabino-primary-10) !important;
  outline: none !important;
}

/* ===== مهم: جلوگیری از override فونت توسط تم ===== */
.rabino-comments-wrapper,
.rabino-comments-wrapper p,
.rabino-comments-wrapper span,
.rabino-comments-wrapper label,
.rabino-comments-wrapper button,
.rabino-comments-wrapper li,
.rabino-comments-wrapper td,
.rabino-comments-wrapper th,
.rabino-comments-wrapper h1,
.rabino-comments-wrapper h2,
.rabino-comments-wrapper h3,
.rabino-comments-wrapper h4,
.rabino-comments-wrapper h5,
.rabino-comments-wrapper h6,
.rabino-comments-wrapper strong,
.rabino-comments-wrapper b {
  font-family: var(--rabino-font) !important;
}
