/* --- General & Controls --- */
#hamyar-comment-app {
    color: #54667a;
    line-height: normal;
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5em;
    flex-wrap: wrap;
}
.comment-header h3 { margin: 0; font-size: 22px; font-weight: 700; }

.hc-button {
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border: solid 2px #efefef;
    color: #787878;
    font-size: 14px;
    font-weight: bold;
    padding: 8px 40px;
    border-radius: 13px;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 50px;
    overflow: hidden;
    min-width: 190px;
}
.hc-button:hover { background: #f4f6f8;
    border-color: #f4f6f8
}

.comment-controls {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}
.comment-filters .filter-btn {
    user-select: none;
    cursor: pointer;
    margin-left: 5px;
    font-size: 14px;
}
.sort-hmycmnt {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    align-content: center;
}

.sort-hmycmnt > svg {
    width: 20px;
    height: 20px;
}

.comment-filters .filter-btn.active {
    font-weight: 700;
    color: #ff4f5d;
}
#comment-sort-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* --- New Comment Wrapper Structure --- */
#comment-list .hmyt-comment-wrapper {
    display: flex;
    padding: 30px;
    box-shadow: 0 2px 35px rgb(173 188 200 / 22%);
    flex-direction: column;
    border-radius: 8px;
    background: #ffffff;
    margin-bottom: 20px;
    gap: 26px;
}
#comment-list .comment-container {
    border-top: solid 1px #f4f4f4;
    padding-top: 18px;
    transition: all 0.5s ease-in-out;
}
#comment-list .comment-container:nth-child(1) {
    border-top: none;
    padding-top: 0;
}
#comment-list .comment-head {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}
.comment-avatar img {
    width: 45px;
    height: 45px;
    border-radius: 50% !important;
}
.comment-user {
    display: flex;
    flex-direction: column;
}
.comment-user-name {
    font-weight: 700;
    font-size: 14px;
}
.comment-time {
    font-size: 12px;
    opacity: 0.8;
    font-weight: 500;
}
.comment-reply-to {
    opacity: 0.7;
}
.comment-label {
    padding: 1px 10px;
    font-weight: 500;
    font-size: 12px;
    border-radius: 5px;
    user-select: none;
    cursor: pointer;
}

.flex-1 { flex: 1; }
.comment-reply { position: relative; }
.comment-reply-btn {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 5px !important;
}
.comment-reply-btn svg { width: 22px; height: 22px; color: #54667A; }

/* --- Tooltip --- */
.comment-reply .comment-reply-tip {
    position: absolute;
    white-space: nowrap;
    top: 50%;
    transform: translateY(-50%);
    left: 28px;
    font-size: 13px;
    pointer-events: none;
    transition: all 0.2s ease;
    opacity: 0;
    color: #54667a;
    padding: 5px 10px;
    border-radius: 8px;
    z-index: 100; /* اطمینان از قرارگیری روی سایر المان‌ها */
}

.comment-reply:hover .comment-reply-tip {
    left: 34px;
    opacity: 1;
}

.comment-form-user img {
    margin: 0 !important;
}

textarea.hmyt-input-text.product-rate-modal-comment-input {
    line-height: normal;
}

.hmyt-comment-text {
    line-height: 1.8;
    color: #333;
}
.hmyt-comment-text p { margin: 0; }

/* --- Nested (Reply) Comments --- */
.comment-container .comment-container {
    margin-top: 15px;
    border-top: 2px solid #f5f5f5;
    padding-top: 15px;
}
.comment-reply-to {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 12px;
    cursor: pointer;
    color: #54667A;
}
.comment-reply-icon {
    width: 18px;
    height: 18px;
    opacity: 0.4;
}

/* --- Voting System --- */
.hmyt-vote-container {
    gap: 8px;
}

.hmyt-vote-btn {
    background: transparent;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #54667A;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
    justify-content: center;
    flex-direction: row;
}

.hmyt-vote-btn:hover {
    background: #f9f9f9;
    color: #47586b;
    border-color: #54667a54;
}

.hmyt-vote-btn svg {
    width: 16px;
    height: 16px;
    fill: transparent; /* آیکون‌ها توخالی هستند */
    transition: all 0.2s;
}

.hmyt-vote-btn .vote-count {
    font-size: 12px;
    font-weight: 600;
}

/* Active States */
.hmyt-vote-btn.vote-like.active {
    color: #49dc4f; /* سبز برای لایک */
    background: #f0fff0;
    border-color: #49dc4f;
}
.hmyt-vote-btn.vote-like.active svg {
    fill: #49dc4f; /* پر شدن آیکون */
    color: #f0fff0;
}

.hmyt-vote-btn.vote-dislike.active {
    color: #ff4f5d; /* قرمز برای دیس‌لایک */
    background: #fff0f1;
    border-color: #ff4f5d;
}
.hmyt-vote-btn.vote-dislike.active svg {
    fill: #ff4f5d;
    color: #ffeff0;
}

/* Loading State */
.hmyt-vote-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* --- AI Summary Container --- */
#ai-summary-container {
    margin-bottom: 2em;
    display: none; /* Hidden by default */
}

/* --- Loader --- */
.loader-wrapper { text-align: center; padding: 4em 0; display: none; }

/* --- Floating Button --- */
div#comment-floating-btn {
    display: flex;
    gap: 5px;
    align-items: center;
}

.comment-floating-btn {
    position: fixed;
    z-index: 9999; /* تنظیم z-index بسیار بالا برای قرارگیری روی همه چیز */
    background: #ffffff;
    color: #1C274C;
    padding: 15px 18px;
    cursor: pointer;
    border-radius: 30px;
    height: 55px;
    box-shadow: 0 2px 35px rgba(0,0,0,0.18);
    transition: all 0.2s ease;
}
.comment-floating-btn > svg {
    width: 21px;
    height: 21px;
}
.comment-floating-btn > span {
    overflow: hidden;
    max-width: none; /* محدودیت عرض حذف شد تا همیشه باز باشد */
    white-space: nowrap;
    font-size: 14px;
    color: #1C274C;
    font-weight: 500;
    opacity: 0.8;
    padding-right: 5px; /* فاصله ثابت بین آیکون و متن */
}
/* بخش‌های مربوط به هاور و انیمیشن حذف شدند */

.comment-floating-btn:active {
    background: #f3f3f3;
}
.comment-floating-btn.hide {
    transform: scale(0.5);
    opacity: 0;
    pointer-events: none;
}
.comment-floating-btn.hide {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* --- Reply Form --- */
.reply-form-wrapper {
    margin-top: 5px;
    padding: 20px;
    border-radius: 12px;
    background: #f1f4f8;
}
.comment-form-reply-to .comment-form-reply-cancel {background: #dbe9ff;font-size: 13px;padding: 2px 9px;border-radius: 10px;transition: all 0.2s
ease;}
.comment-form .hmyt-input-text {
    resize: vertical;
    width: 100%;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}
.comment-form-user {gap: 10px;align-items: center;display: flex;}
.comment-form-user img { width: 35px; height: 35px; border-radius: 50% !important; }
.comment-form-submit {
    background: #1C274C;
    color: #fff;
    border: none;
    padding: 13px 46px;
    font-size: 17px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    gap: 10px;
    align-items: center;
    width: max-content;
    flex-direction: row;
    align-content: center;
    flex-wrap: wrap;
}
.comment-form-submit:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.gap-5 { gap: 5px; }
.flex { display: flex; }
.flex-r { flex-direction: row; }
.flex-c { flex-direction: column; }

.w-100 { width: 100%; }

.hmycmnt-title  {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    gap: 5px;
    color: #54667a;
    padding: 8px 40px;
    -webkit-user-drag: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.hmycmnt-title svg {
    width: 24px;
    height: 24px;
    opacity: .7;
    transition: all 0.2s ease;
}
.hmycmnt-title span {
    background: #ff4f5d;
    text-align: center;
    min-width: 22px;
    font-size: 11px;
    font-weight: 500;
    padding: 0 6px;
    border-radius: 3px;
    color: #fff;
}

.comment-form-reply-to {
    gap: 5px;
    font-size: 14px;
    display: flex;
    user-select: none;
    cursor: pointer;
    color: #5294ff;
    font-weight: 700;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
}

.comment-form-reply-to-name {
    flex: 1;
}

.footer-reply {
    display: flex;
    justify-content: flex-end;
}

label#comment-hidden-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

form.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-form-submit > svg {
    width: 24px;
    height: 24px;
}

/* --- Custom Checkbox for Private Comment (Updated Style) --- */
.private-comment-checkbox {
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-size: 14px;
  padding-right: 35px; /* فضای کافی برای باکس و متن */
  user-select: none;
  line-height: 24px; /* برای تراز عمودی بهتر */
}

.private-comment-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.private-comment-checkbox label {
  position: relative;
  cursor: pointer;
  display: inline-block;
  font-weight: 400; /* وزن فونت نرمال مثل نمونه دوم */
  transition: color 0.2s ease;
}

/* مربع (Box) */
.private-comment-checkbox label::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -30px; /* تنظیم فاصله باکس از متن */
  transform: translateY(-50%);
  width: 20px;  /* کمی بزرگتر برای دیده شدن بهتر */
  height: 20px;
  background: #fff;
  border: 2px solid #cfd8dc;
  border-radius: 3px; /* گردی گوشه‌ها طبق نمونه دوم */
  box-sizing: border-box;
  transition: all 0.2s ease;
}

/* تیک (Checkmark) */
.private-comment-checkbox label::after {
  content: "";
  position: absolute;
  /* موقعیت‌دهی دقیق تیک وسط باکس */
  top: 50%;
  right: -23px; 
  
  /* ابعاد جدید طبق نمونه دوم (کشیده‌تر و زیباتر) */
  width: 5px;
  height: 10px;
  
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  
  /* تنظیم زاویه و پنهان کردن اولیه */
  transform: translateY(-65%) rotate(45deg) scale(0);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* انیمیشن نرم و فنری */
}

/* Hover Effect */
.private-comment-checkbox:hover label::before {
  border-color: #1C274C; /* رنگ آبی برند شما */
}

/* --- Checked State --- */

/* تغییر رنگ باکس وقتی تیک خورد */
.private-comment-checkbox input[type="checkbox"]:checked + label::before {
  background: #1C274C;
  border-color: #1C274C;
}

/* نمایش تیک وقتی انتخاب شد */
.private-comment-checkbox input[type="checkbox"]:checked + label::after {
  opacity: 1;
  transform: translateY(-65%) rotate(45deg) scale(1);
}

/* بولد شدن متن وقتی انتخاب شد */
.private-comment-checkbox input[type="checkbox"]:checked + label {
  font-weight: 600;
  color: #1C274C;
}

.hmyt-comment-text p {
    font-size: 15px;
}

p.no-comments {
    display: flex;
    justify-content: center;
}

.comment-message {
    color: #f9d342;
    padding: 0;
    margin-bottom: 9px;
    font-size: 14px;
    border-radius: 6px;
    font-weight: 600;
}

.comment-avatar.flex {
    position: relative;
}

.comment-tick {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 18px;
    height: 18px;
    border: solid 2px #fff;
    border-radius: 50%;
    color: #37e75b;
    background: #fff;
}

/* --- Comment Focus Animation --- */
.comment-focus {
    background-color: #e3eaf3;
    box-shadow: 0 0 0 30px #e3eaf3;
}

.comment-focus.comment-container {
    border-color: #e3eaf3;
}

.hmyt-comment-wrapper > .comment-container.comment-focus:nth-child(1) {
    margin-top: 0px;
}


/*
==========================================================================
   استایل‌های واکنش‌گرا (Responsive Styles)
==========================================================================
*/

/* --- برای تبلت و موبایل‌های بزرگ (کمتر از 768 پیکسل) --- */
@media (max-width: 768px) {

    /* --- چیدمان هدر --- */
    .comment-header {
        align-items: flex-start; /* چیدمان از سمت چپ */
        gap: 20px; /* ایجاد فاصله بین عناصر */
    }

    .comment-header .hc-button,
    .comment-header .must-login-notice {
        width: 100%; /* دکمه ثبت دیدگاه تمام‌عرض شود */
        text-align: center;
    }

    .comment-controls {
        width: 100%;
        justify-content: space-between; /* فاصله بین مرتب‌سازی و فیلترها */
    }

    /* --- بدنه‌ی دیدگاه‌ها --- */
    #comment-list .hmyt-comment-wrapper {
        padding: 20px; /* کاهش پدینگ داخلی دیدگاه‌ها */
    }

    .comment-head {
        flex-wrap: wrap; /* اگر عناصر در هدر دیدگاه جا نشدند، به خط بعدی بروند */
        gap: 10px;
    }

    .comment-avatar img {
        width: 40px;
        height: 40px;
    }

    .comment-tick {
        width: 16px;
        height: 16px;
    }

    .hmyt-comment-text p {
        font-size: 14px; /* کاهش سایز فونت متن دیدگاه */
    }

    /* --- مودال و فرم‌ها --- */
    .hc-modal-content {
        width: 95%;
        padding: 20px;
        margin-top: 5vh;
    }

    .reply-form-wrapper {
        padding: 15px;
    }

    /* --- دکمه شناور --- */
    .comment-floating-btn {
        height: 50px;
        padding: 12px 15px;
    }

    .comment-floating-btn > svg {
        width: 18px;
        height: 18px;
    }

    .comment-floating-btn > span {
        font-size: 13px;
    }

    /* باز کردن دکمه شناور به صورت پیش‌فرض در موبایل */
    .comment-floating-btn > span {
        max-width: 100px; /* اجازه نمایش متن را می‌دهد */
        padding-right: 8px;  /* فاصله بین آیکون و متن */
    }

    /* --- اصلاح بیرون‌زدگی فوکوس در موبایل --- */
    .comment-focus {
        box-shadow: 0 0 0 15px #e3eaf3; /* کاهش اندازه سایه برای جلوگیری از بیرون‌زدگی */
    }

}


/* --- فقط برای موبایل‌های کوچک (کمتر از 480 پیکسل) --- */
@media (max-width: 480px) {

    .hmycmnt-title, .comment-filters .filter-btn {
        padding-right: 0;
    }

    .comment-controls {
        flex-direction: row;
        align-items: flex-start;
        display: flex;
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

    .sort-hmycmnt {
        width: 100%;
    }

    .comment-filters {
        width: 100%;
    }

    #comment-list .hmyt-comment-wrapper {
        padding: 15px;
    }
}

.hmyt-comment-text p {
    text-align: right !important;
}

.hmycmnt-title {
    padding-right: 0;
}

/* --- New Modal Styling --- */
.product-rate-modal-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #00052a30;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 999998;
}

.product-rate-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999; /* بالاترین لایه برای مودال */
    justify-content: center;
    align-items: center;
}

.product-rate-modal-wrapper {
    background: #fff;
    width: 90%;
    max-width: 500px !important;
    border-radius: 15px;
    box-shadow: 0 9px 19px rgba(0,0,0,0.161);
    padding-bottom: 20px
}

.product-rate-modal-head {
    padding-top: 3px
}

.product-rate-modal-head-title {
    flex: 1;
    padding: 0 24px;
    font-size: 17px;
    font-weight: 600
}

.product-rate-modal-close {
    display: flex;
    padding: 13px 20px;
    opacity: 0.3;
    cursor: pointer;
    transition: all 0.2s ease
}

.product-rate-modal-close:hover {
    opacity: 0.5
}

.product-rate-modal-close svg {
    width: 28px;
    height: 28px
}

.product-rate-modal-options-wrapper {
    padding: 10px 25px 0;
    direction: ltr
}

.product-rate-modal-rate-options {
    width: 100%;
    box-shadow: 0 0 0 1px #c2c2c2;
    border-radius: 4px;
    position: relative;
    overflow: hidden
}

.product-rate-modal-option {
    flex: 1;
    padding: 5px 0;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    height: 50px;
    color: #e0e0e0;
    align-items: center;
    gap: 5px;
    justify-content: center;
}

.product-rate-modal-option:hover {
    background: #f8f8f8
}

.product-rate-modal-option svg {
    width: 20px;
    height: 20px
}

.product-rate-modal-option:hover,
.product-rate-modal-option:hover ~ .product-rate-modal-option,
.product-rate-modal-option:hover span,
.product-rate-modal-option:hover ~ .product-rate-modal-option span {
    color: #ffb900
}

.product-rate-modal-option span {
    font-size: 0px;
    color: #707070;
    font-weight: 500;
    transition: all 0.2s ease
}

.product-rate-modal-option:hover span,
.select-1 .product-rate-modal-option[data-value="1"] span,
.select-2 .product-rate-modal-option[data-value="2"] span,
.select-3 .product-rate-modal-option[data-value="3"] span,
.select-4 .product-rate-modal-option[data-value="4"] span,
.select-5 .product-rate-modal-option[data-value="5"] span {
    font-size: 15px;
    color: #707070
}

.product-rate-modal-rate-options.select-1 { box-shadow: 0 0 0 1px #f55; }
.product-rate-modal-rate-options.select-2 { box-shadow: 0 0 0 1px #f55; }
.product-rate-modal-rate-options.select-3 { box-shadow: 0 0 0 1px #ffb900; }
.product-rate-modal-rate-options.select-4 { box-shadow: 0 0 0 1px #77e55d; }
.product-rate-modal-rate-options.select-5 { box-shadow: 0 0 0 1px #39f041; }

.product-rate-modal-rate-options.select-1 .product-rate-modal-option:nth-child(5) { color: #ffb900; }
.product-rate-modal-rate-options.select-2 .product-rate-modal-option:nth-child(5),
.product-rate-modal-rate-options.select-2 .product-rate-modal-option:nth-child(4) { color: #ffb900; }
.product-rate-modal-rate-options.select-3 .product-rate-modal-option:nth-child(5),
.product-rate-modal-rate-options.select-3 .product-rate-modal-option:nth-child(4),
.product-rate-modal-rate-options.select-3 .product-rate-modal-option:nth-child(3) { color: #ffb900; }
.product-rate-modal-rate-options.select-4 .product-rate-modal-option:nth-child(5),
.product-rate-modal-rate-options.select-4 .product-rate-modal-option:nth-child(4),
.product-rate-modal-rate-options.select-4 .product-rate-modal-option:nth-child(3),
.product-rate-modal-rate-options.select-4 .product-rate-modal-option:nth-child(2) { color: #ffb900; }
.product-rate-modal-rate-options.select-5 .product-rate-modal-option { color: #ffb900; }

.product-rate-modal-hmyt-comment-wrapper {
    padding: 19px 23px 0
}

.product-rate-modal-comment-title {
    font-size: 16px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 12px;
    cursor: default;
    min-height: 24px;
}

.product-rate-modal-comment-title small {
    font-weight: 400;
    opacity: 0.8
}

.product-rate-modal-comment-input {
    resize: none;
    height: 140px;
    border-radius: 10px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    width: 100%;
    padding: 10px;
}

.product-rate-modal-submit {
    margin: 0;
    margin-top: 16px;
    font-size: 17px;
    padding: 12px;
    font-weight: 500;
    border-radius: 10px;
    background: #1C274C;
    color: #fff;
    border: none;
    width: 100%;
    cursor: pointer;
}
.product-rate-modal-submit:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Product Rate Tip --- */
.product-rate-tip {
    background: #1C274C;
    color: #fff;
    padding: 0px 20px 0 11px;
    font-size: 13px;
    font-weight: 500;
    height: 38px;
    border-radius: 7px;
    position: absolute;
    top: -40px;  /* فاصله بیشتر از بالا */
    left: 90%;   /* در مرکز والد قرار بگیرد */
    transform: translateX(-50%); /* مرکز افقی را تنظیم کن */
    white-space: nowrap;
    z-index: 9;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    animation: rateTipAnimate 1s ease 5s forwards,rateTipAnimate 1s ease 20s forwards;
    opacity: 1;
    transition: all 0.2s ease;
    pointer-events: all;
}


@keyframes rateTipAnimate {
    0%, to {
        transform: translateX(-50%); /* حفظ حالت وسط‌چین */
    }
    15% {
        transform: translateX(-50%) translate3d(-10%, 0, 0) rotate3d(0, 0, 1, -10deg);
    }
    30% {
        transform: translateX(-50%) translate3d(7%, 0, 0) rotate3d(0, 0, 1, 7deg);
    }
    45% {
        transform: translateX(-50%) translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -7deg);
    }
    60% {
        transform: translateX(-50%) translate3d(4%, 0, 0) rotate3d(0, 0, 1, 3deg);
    }
    75% {
        transform: translateX(-50%) translate3d(-4%, 0, 0) rotate3d(0, 0, 1, -1deg);
    }
}

.product-rate-tip.hide {
    opacity: 0;
    pointer-events: none;
}

.product-rate-tip-close {
    width: 20px;
    height: 20px;
    background: #445280;
    margin-right: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.product-rate-tip-close svg {
    width: 12px;
    height: 12px;
}

.product-rate-tip-close:hover {
    background: #535d7f;
}

.product-rate-tip-close:active {
    opacity: 0.7;
}

.product-rate-tip::after {
    content: '';
    width: 10px;
    height: 10px;
    background: inherit;
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.comment-reply-tip {
    background: #fff;
}


.product-rate-modal-close svg {
    background: #e1e1e1;
    border-radius: 50px;
    padding: 5px;
}


/* استایل دکمه پاسخ با هوش مصنوعی */
.comment-reply.ai-reply {
    margin-left: 5px;
}

.comment-reply-btn.ai-reply-btn {
    color: #6b21a8 !important; /* رنگ بنفش برای تمایز */
    transition: all 0.3s ease;
}

.comment-reply-btn.ai-reply-btn svg {
    width: 20px; 
    height: 20px;
}

/* انیمیشن لودینگ جدید: بوردر قرمز چرخان دور دکمه */
.comment-reply-btn.ai-reply-btn {
    position: relative; /* برای تراز کردن بوردر */
}

.comment-reply-btn.ai-reply-btn.loading::after {
    content: '';
    position: absolute;
    /* تنظیم اندازه حلقه چرخان دور دکمه */
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid transparent; /* زمینه شفاف */
    border-top-color: #ff4f5d; /* رنگ قرمز همیار تولز */
    border-right-color: #ff4f5d; /* ایجاد حالت کمانی */
    animation: ai-spin 0.8s linear infinite;
    pointer-events: none;
}

/* خود آیکون ثابت بماند ولی کمی کمرنگ شود */
.comment-reply-btn.ai-reply-btn.loading svg {
    animation: none; 
    opacity: 0.4; 
}

@keyframes ai-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* استایل نشانگر موفقیت تولید پاسخ هوشمند */
span.comment-reply-btn.ai-done.flex {
    display: inline-flex; /* تغییر به inline-flex برای قرارگیری کنار دکمه */
    align-items: center;
    color: #49dc4f !important;
    gap: 5px;
    border: 1px solid #49dc4f !important;
    padding: 4px 10px !important; /* کمی پدینگ بیشتر برای ظاهر بهتر */
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    justify-content: center;
    background: #f0fff0; /* پس زمینه خیلی محو سبز */
    margin-right: 5px; /* فاصله از دکمه کناری */
    opacity: 0;
    transform: translateX(-10px) scale(0); /* شروع از سمت چپ و اندازه صفر */
    transform-origin: left center; /* محوری که از آن بزرگ می‌شود */
    will-change: transform, opacity;
    animation: ai-pop-in 0.22s cubic-bezier(.2,.9,.2,1) forwards; /* pop-in سریع */
}

span.comment-reply-btn.ai-done.flex svg {
    height: 15px;
    width: 15px;
    background: #49dc4f;
    color: #fff;
    border-radius: 50%;
    padding: 2px; /* برای تراز شدن آیکون چک */
    flex-shrink: 0;
}

@keyframes ai-pop-in {
    0% {
        opacity: 0;
        transform: translateX(-10px) scale(0);
    }
    60% {
        opacity: 1;
        transform: translateX(2px) scale(1.06); /* slight overshoot for pop */
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.comment-reply.ai-reply {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}


.product-rate-modal-head-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}


/* استایل دکمه تریگر تولبار */
.hmyt-bulk-toolbar-simple {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-end;
}
.hmyt-bulk-trigger-btn {
    background: #fff;
    color: #54667a;
    border: 1px solid #ccd0d4;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.hmyt-bulk-trigger-btn:hover {
    border-color: #54667a;
    background: #f6f7f7;
}

/* استایل‌های داخل مودال */
.hmyt-bulk-notices ul {
    list-style: disc;
    padding-right: 20px;
    margin: 0;
    font-size: 13px;
    color: #646970;
    background: #f0f6fc;
    border: 1px solid #cce5ff;
    border-radius: 8px;
    padding: 15px 25px 15px 10px;
}
.hmyt-bulk-notices li { margin-bottom: 5px; }
.hmyt-bulk-notices li:last-child { margin-bottom: 0; }

/* دکمه اصلی شروع */
.hmyt-bulk-action-btn {
    background: #1C274C;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    position: relative;
    transition: all 0.3s ease;
}

/* وضعیت‌های رنگی دکمه */
.hmyt-bulk-action-btn.state-processing {
    background: #e2e4e7 !important;
    color: #54667a !important;
    cursor: wait;
}
.hmyt-bulk-action-btn.state-found {
    background: #3b82f6 !important; /* آبی */
    color: #fff !important;
}
.hmyt-bulk-action-btn.state-running {
    background: #ff4f5d !important; /* قرمز */
    color: #fff !important;
}
.hmyt-bulk-action-btn.state-done {
    background: #49dc4f !important; /* سبز */
    color: #fff !important;
}

/* استایل سکشن دایره چرخان و لاگ (کانتینر والد) */
.product-ai-modal-hmyt-comment-wrapper > .comment-reply.ai-reply {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row; /* آیکون راست، لاگ چپ */
}

/* دکمه دایره‌ای داخل سکشن وضعیت */
.comment-reply-btn.ai-reply-btn {
    position: relative; /* برای تراز کردن بوردر */
    background: none;
    border: none;
    padding: 5px;
    cursor: default;
    display: flex;
    align-items: center;
    color: #54667a;
}

/* بوردر قرمز چرخان دور دکمه دایره‌ای */
.comment-reply-btn.ai-reply-btn.loading::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ff4f5d; 
    border-right-color: #ff4f5d;
    animation: ai-spin 0.8s linear infinite;
    pointer-events: none;
}

.comment-reply-btn.ai-reply-btn.loading svg {
    animation: none; 
    opacity: 0.6;
    width: 20px;
    height: 20px;
}

/* انیمیشن چرخش */
@keyframes ai-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* استایل لاگ موفقیت (اسلاید شونده) */
.hmyt-log-col > span.comment-reply-btn.ai-done.flex {
    display: inline-flex;
    align-items: center;
    color: #49dc4f !important;
    gap: 5px;
    border: 1px solid #49dc4f !important;
    padding: 4px 10px !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    justify-content: center;
    background: #f0fff0;    
    /* تنظیمات انیمیشن */
    opacity: 0;
    transform: translateX(-10px) scale(0);
    transform-origin: right center; 
    will-change: transform, opacity;
    animation: ai-pop-in 0.4s cubic-bezier(.2,.9,.2,1) forwards;
}

.hmyt-log-col > span.comment-reply-btn.ai-done.flex svg {
    height: 15px;
    width: 15px;
    background: #49dc4f;
    color: #fff;
    border-radius: 50%;
    padding: 2px;
    flex-shrink: 0;
}

@keyframes ai-pop-in {
    0% {
        opacity: 0;
        transform: translateX(-10px) scale(0);
    }
    60% {
        opacity: 1;
        transform: translateX(2px) scale(1.06);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}


/* کانتینر اصلی وضعیت (Flex) */

.hmyt-bulk-status-container {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}


/* ستون چپ: وضعیت */
.hmyt-status-col {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* متن ثابت وضعیت */
.hmyt-status-text {
    font-size: 13px;
    font-weight: 600;
    color: #54667a;
}

/* ستون راست: لاگ */
.hmyt-log-col {
    flex: 1; /* پر کردن فضای باقی‌مانده */
    display: flex;
    justify-content: flex-start; /* چسباندن محتوا به راست */
    overflow: hidden; /* جلوگیری از بیرون‌زدگی */
}

/* دکمه دایره‌ای (بدون تغییر عمده) */
.comment-reply-btn.ai-reply-btn {
    position: relative;
    background: none;
    border: none;
    padding: 5px;
    cursor: default;
    display: flex;
    align-items: center;
    color: #54667a;
}

/* بوردر چرخان */
.comment-reply-btn.ai-reply-btn.loading::after {
    content: '';
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #ff4f5d; 
    border-right-color: #ff4f5d;
    animation: ai-spin 0.8s linear infinite;
    pointer-events: none;
}

.comment-reply-btn.ai-reply-btn.loading svg {
    opacity: 0.8;

    /* انیمیشن تپش مداوم */
    animation: ai-pulse 1.2s infinite ease-in-out;
}

/* تعریف انیمیشن کوچک و بزرگ شدن */
@keyframes ai-pulse {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.15); }
    100% { transform: scale(0.85); }
}

@keyframes ai-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* استایل بج لاگ موفقیت (آپدیت شده برای انیمیشن بهتر) */
.hmyt-log-col > span.comment-reply-btn.ai-done.flex {
    display: inline-flex;
    align-items: center;
    color: #49dc4f !important;
    gap: 5px;
    border: 1px solid #49dc4f !important;
    padding: 4px 10px !important;
    border-radius: 10px;
    font-weight: 600;
    font-size: 12px;
    justify-content: center;
    background: #f0fff0;
    white-space: nowrap; /* جلوگیری از شکستن متن */
    
    /* انیمیشن ورود از راست */
    opacity: 0;
    transform: translateX(20px); 
    animation: ai-slide-in-right 0.4s cubic-bezier(.2,.9,.2,1) forwards;
}

.hmyt-log-col > span.comment-reply-btn.ai-done.flex svg {
    height: 15px;
    width: 15px;
    background: #49dc4f;
    color: #fff;
    border-radius: 50%;
    padding: 2px;
    flex-shrink: 0;
}

@keyframes ai-slide-in-right {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.product-ai-modal-hmyt-comment-wrapper {
    padding: 19px 23px 0;
}

.hmyt-bulk-status-container > .hmyt-status-col {
    display: flex;
    flex-direction: row-reverse;
    gap: 20px;
}

.hmyt-bulk-status-container > .hmyt-status-col .hmyt-status-text {
    font-size: 14px;
    font-weight:700;
}



/* =========================================
   User Comments Shortcode Styles (New Tabs)
   ========================================= */

/* --- User Comments Tabs Header --- */
.hmyt-uc-tabs-header {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 2px;
}

.hmyt-cm-tab-item {
    padding: 10px 15px;
    font-weight: 500;
    font-size: 15px;
    color: #777;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
}

.hmyt-cm-tab-item:hover {
    color: #333;
}

.hmyt-cm-tab-item.active {
    color: #1C274C;
    font-weight: 700;
}

/* خط متحرک زیر تب فعال (استایل مدرن) */
.hmyt-cm-tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px; /* دقیقا روی خط بوردر */
    left: 0;
    width: 100%;
    height: 2px;
    background: #1C274C;
    border-radius: 3px;
    
    /* انیمیشن باز شدن از مرکز */
    transform-origin: center;
    transform: scaleX(0); /* حالت اولیه */
    animation: hmytTabScaleIn 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes hmytTabScaleIn {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }
    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

.hmyt-cm-tab-badge {
    background: #ff4f5d;
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 6px;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* --- Waiting For Review List --- */
.hmyt-waiting-list {
    display: flex;
    flex-direction: column;
}

.hmyt-waiting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #fff;
    border: 1px solid #f4f4f4;
    border-bottom: solid 8px #f4f4f4;
    padding: 15px;
    transition: all 0.2s ease;
    flex-direction: row;
    flex-wrap: wrap;
}

.hmyt-waiting-img {
    width: 65px;
    height: 65px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f9f9f9;
    border: 1px solid #f0f0f0;
}

.hmyt-waiting-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hmyt-waiting-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.hmyt-waiting-title {
    font-weight: 700;
    font-size: 15px;
    color: #333 !important;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s;
}

.hmyt-waiting-title:hover {
    color: #54667a;
}

.hmyt-waiting-date {
    font-size: 12px;
    color: #999;
}

.hmyt-waiting-action {
    flex-shrink: 0;
}

.hmyt-waiting-action .hc-button {
    padding: 0 20px;
    font-size: 13px;
    min-width: auto;
    height: 42px; /* فیکس کردن ارتفاع */
    min-height: auto;
    font-weight: 700;
    background: #fff;
    color: #ff4f5d;
    border: 1px solid #ff4f5d;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none; /* حذف زیرخط لینک */
}

.hmyt-waiting-action .hc-button:hover {
    background: #ff4f5d;
    color: #fff;
}

/* --- Responsive for Waiting List --- */
@media (max-width: 600px) {
    
    
    .hmyt-waiting-img {
        width: 50px;
        height: 50px;
    }

    .hmyt-waiting-info {
        width: 100%;
    }

    .hmyt-waiting-action {
        width: 100%;
        margin-top: 5px;
    }
    
    .hmyt-waiting-action .hc-button {
        width: 100%;
        min-width: 100%;
    }
    
    .hmyt-uc-tabs-header {
        gap: 10px;
        justify-content: space-between;
    }
    
    .hmyt-cm-tab-item {
        padding: 10px 5px;
        font-size: 13px;
        flex: 1;
        justify-content: center;
    }
}
/* --- Pagination Styles --- */
.hmyt-uc-pagination ul {
    display: flex;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.hmyt-uc-pagination a,
.hmyt-uc-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}
.hmyt-uc-pagination .current {
    background: #54667a;
    color: #fff;
    border-color: #54667a;
}
.hmyt-uc-pagination a:hover {
    border-color: #54667a;
    color: #54667a;
}
.hmyt-waiting-item:last-child {
    border-bottom: 1px solid #f4f4f4;
}

span.comment-label.approved {
    background: #f0fdf4;
    color: #49dc4f;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 6px;
}

span.comment-label.pending {
    background: #ffe6d7;
    color: #f47e39;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 6px;
}

span.comment-label.private {
    background: #f9d34200;
    color: #f9d342;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 6px;
}

span.comment-label.pinned-badge {
    background: #1d1e1e0d;
    color: #1d1e1e;
    border: 1px solid;
    display: flex;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.comment-label.type-3 {
    background: #e7f7ff;
    color: #1ca5f2;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 6px;
}

.comment-label.type-2 {
    background: #fffafa;
    color: #ff4f5d;
    border: 1px solid;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 6px;
}

/* --- Pin Comment Styles --- */
.comment-reply.pin-reply {
    margin-left: 5px;
}

.comment-reply-btn.pin-reply-btn {
    color: #aebecd !important;
    transition: all 0.3s ease;
}

.comment-reply-btn.pin-reply-btn:hover {
    color: #1C274C !important;
}

.comment-reply-btn.pin-reply-btn.active {
    color: #ff4f5d !important;
}

.comment-reply-btn.pin-reply-btn svg {
    width: 20px;
    height: 20px;
}

/* Loading State for Pin Btn */
@keyframes pulse{0%,100%{opacity:0}50%{opacity:.3}}

.comment-reply-btn.pin-reply-btn.loading {
    opacity: 0.6;
    pointer-events: none;
    animation: pulse 1s infinite;
}

/* Pinned Wrapper Style */
.hmyt-comment-wrapper.hmyt-is-pinned {
    border: 1px solid #334155;
    box-shadow: 0 2px 35px rgb(114 119 138 / 9%) !important;
}

/* Badge Spacing */
.comment-label.pinned-badge {
    gap: 4px;
}

/* --- Skeleton Loading Styles --- */
#comment-list-loader {
    display: none; /* JS toggles this */
}

.hmyt-skeleton-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.hmyt-skeleton-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}

.hmyt-skeleton-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Base Animation */
.hmyt-skeleton-pulse {
    background: #f6f7f8;
    background: linear-gradient(90deg, #f6f7f8 0%, #edeef1 50%, #f6f7f8 100%);
    background-size: 200% 100%;
    animation: hmyt-skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes hmyt-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Elements */
.hmyt-skeleton-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hmyt-skeleton-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.hmyt-skeleton-name {
    width: 120px;
    height: 14px;
}

.hmyt-skeleton-date {
    width: 80px;
    height: 10px;
}

.hmyt-skeleton-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 5px;
}

.hmyt-skeleton-line {
    height: 20px;
    width: 100%;
}

.hmyt-skeleton-line.short {
    width: 60%;
}

.product-rate-tip-close {
    display: flex;
    align-items: center;
    justify-content: center;
}