﻿.ic-cmt {
  padding: 0 16px 12px;
}

.ic-cmt-divider {
  width: 90%;
  height: 1px;
  margin: 0 auto 20px;
  background: #eee;
}

.ic-cmt-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ic-cmt-item {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f3f8;
}

.ic-cmt-item:last-child {
  border-bottom: 0;
}

.ic-cmt-head {
  display: flex;
  flex-direction: row-reverse;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  direction: ltr;
}

.ic-cmt-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #ececec;
  flex-shrink: 0;
}

.ic-cmt-meta {
  min-width: 0;
  flex: 1;
}

.ic-cmt-author-row {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
  direction: ltr;
}

.ic-cmt-author {
  font-size: 11.2px;
  font-weight: 700;
  color: #2d3a4a;
  direction: rtl;
  unicode-bidi: plaintext;
}

.ic-cmt-owner-tag {
  font-size: 10.2px;
  color: #919aaf;
  direction: rtl;
}

.ic-cmt-badge {
  width: 13.5px;
  height: 13.5px;
  flex-shrink: 0;
  display: inline-block;
  background: #4e91e6;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

.ic-cmt-badge--tick {
  -webkit-mask-image: url('../icons/Blue-Tick.png');
  mask-image: url('../icons/Blue-Tick.png');
}

.ic-cmt-badge--diamond {
  background: #a1b6ed;
  -webkit-mask-image: url('../icons/diamond.png');
  mask-image: url('../icons/diamond.png');
}

.ic-cmt-text {
  margin: 0 0 6px;
  font-size: 11.7px;
  line-height: 22px;
  color: #3d4651;
  text-align: right;
  white-space: pre-wrap;
}

.ic-cmt-text-body {
  white-space: pre-wrap;
}

.ic-cmt-text-block {
  display: inline;
}

.ic-cmt-read-more {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f1964e;
  font-family: inherit;
  font-size: 10.6px;
  line-height: 22px;
  cursor: pointer;
  vertical-align: baseline;
}

.ic-cmt-read-more[hidden],
.ic-cmt-text-body[hidden] {
  display: none !important;
}

.ic-cmt-time {
  margin: 0;
  font-size: 10px;
  color: #919aaf;
  text-align: right;
  display: inline-flex;
  flex-direction: row;
  direction: rtl;
  align-items: baseline;
  gap: 0.25em;
  unicode-bidi: isolate;
  white-space: nowrap;
}

.ic-cmt-time-num,
.ic-cmt-time-unit {
  display: inline-block;
  unicode-bidi: isolate;
}

.ic-cmt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.ic-cmt-reply-btn {
  border: 0;
  background: none;
  color: #4e91e6;
  font-size: 11.2px;
  cursor: pointer;
  padding: 0;
}

.ic-cmt-replies {
  margin-top: 14px;
  padding-right: 12px;
  border-right: 2px solid #f1f3f8;
}

.ic-cmt--circuit .ic-cmt-replies {
  margin-top: 14px;
  margin-right: 25px;
  padding-right: 20px;
  border-right: 0;
}

/* فقط وقتی فقط دکمه «نمایش پاسخ» هست — هم‌تراز متن کامنت / کارشناس */
.ic-cmt--circuit .ic-cmt-replies--toggle-only,
.ic-cmt--video .ic-cmt-replies--toggle-only,
.ic-cmt--reels .ic-cmt-replies--toggle-only {
  margin-top: 8px;
  margin-right: 58px;
  padding-right: 0;
  border-right: 0;
}

.ic-cmt--circuit .ic-cmt-replies--toggle-only .ic-cmt-toggle-replies,
.ic-cmt--video .ic-cmt-replies--toggle-only .ic-cmt-toggle-replies,
.ic-cmt--reels .ic-cmt-replies--toggle-only .ic-cmt-toggle-replies {
  margin-right: 0;
}

.ic-cmt-reply {
  margin-bottom: 14px;
}

.ic-cmt-toggle-replies {
  /* مثل اپ (RN LTR + row-reverse): اول خط تیره سمت راست، بعد متن */
  direction: ltr;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-top: 4px;
  margin-bottom: 10px;
  margin-right: 60px;
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0;
  color: #6f6f6f;
  font-family: "IRANYekan", Tahoma, sans-serif;
  font-size: 9.3px;
  font-weight: 400;
  line-height: 1.4;
  text-align: right;
  cursor: pointer;
}

.ic-cmt-toggle-replies.is-loading,
.ic-cmt-toggle-replies:disabled {
  cursor: default;
  opacity: 1;
  color: #666;
}

.ic-cmt-toggle-label {
  direction: rtl;
  unicode-bidi: isolate;
  display: inline-block;
}

.ic-cmt-support {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f9ff;
}

.ic-cmt-support-label {
  margin: 0 0 4px;
  font-size: 10.2px;
  font-weight: 700;
  color: #4e91e6;
}

.ic-cmt-support-text {
  margin: 0;
  font-size: 11.7px;
  line-height: 22px;
  color: #4a5a6a;
  text-align: right;
}

.ic-cmt-reply-expert-btn {
  font-size: 11.2px;
}

.ic-cmt-empty {
  margin: 12px 0 0;
  font-size: 12px;
  color: #919aaf;
  text-align: center;
}

.ic-cmt-empty[hidden],
.ic-cmt-load-more[hidden],
.ic-cmt-composer[hidden],
.ic-cmt-reply-strip[hidden] {
  display: none !important;
}

/* composer روی صفحه مدار / ورکشاپ / کالبدشکافی / تعمیرات با انیمیشن */
body.ic-circuit .ic-cmt-composer[data-ic-comment-composer],
body.ic-video .ic-cmt-composer[data-ic-comment-composer],
body.ic-workshop .ic-cmt-composer[data-ic-comment-composer],
body.ic-teardown .ic-cmt-composer[data-ic-comment-composer],
body.ic-repair .ic-cmt-composer[data-ic-comment-composer] {
  display: block !important;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.38s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.38s cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: transform, opacity;
  z-index: 45;
}

body.ic-circuit .ic-cmt-composer[data-ic-comment-composer][hidden],
body.ic-video .ic-cmt-composer[data-ic-comment-composer][hidden],
body.ic-workshop .ic-cmt-composer[data-ic-comment-composer][hidden],
body.ic-teardown .ic-cmt-composer[data-ic-comment-composer][hidden],
body.ic-repair .ic-cmt-composer[data-ic-comment-composer][hidden] {
  display: block !important;
}

body.ic-circuit.ic-cmt-composer-open .ic-cmt-composer[data-ic-comment-composer],
body.ic-circuit .ic-cmt-composer[data-ic-comment-composer].is-open,
body.ic-video.ic-cmt-composer-open .ic-cmt-composer[data-ic-comment-composer],
body.ic-video .ic-cmt-composer[data-ic-comment-composer].is-open,
body.ic-workshop.ic-cmt-composer-open .ic-cmt-composer[data-ic-comment-composer],
body.ic-workshop .ic-cmt-composer[data-ic-comment-composer].is-open,
body.ic-teardown.ic-cmt-composer-open .ic-cmt-composer[data-ic-comment-composer],
body.ic-teardown .ic-cmt-composer[data-ic-comment-composer].is-open,
body.ic-repair.ic-cmt-composer-open .ic-cmt-composer[data-ic-comment-composer],
body.ic-repair .ic-cmt-composer[data-ic-comment-composer].is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* AllComments — کامپوزر همیشه پایین صفحه */
body.ic-circuit-comments .ic-cmt-composer[data-ic-comment-composer],
body.ic-video-comments .ic-cmt-composer[data-ic-comment-composer] {
  display: block !important;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: 45;
}

body.ic-circuit-comments .ic-cmt-composer[data-ic-comment-composer][hidden],
body.ic-video-comments .ic-cmt-composer[data-ic-comment-composer][hidden] {
  display: block !important;
}

body.ic-project-view .ic-cmt-composer[data-ic-comment-composer] {
  display: block !important;
  transform: none;
  opacity: 1;
  pointer-events: auto;
  z-index: 45;
}

body.ic-project-view .ic-cmt-composer[data-ic-comment-composer][hidden] {
  display: block !important;
}

body.ic-project-view.ic-cmt-composer-open .ic-pjv {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 800px), (min-width: 801px) {
  body.ic-circuit-comments .ic-header,
  body.ic-circuit-comments .ic-footer,
  body.ic-circuit-comments .ic-tabbar {
    display: none !important;
  }
}

.ic-cmt-load-more {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.ic-cmt-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #dbe5f7;
  border-top-color: #4e91e6;
  border-radius: 50%;
  animation: ic-cmt-spin 0.8s linear infinite;
}

@keyframes ic-cmt-spin {
  to { transform: rotate(360deg); }
}

.ic-cmt-composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #edf0f6;
  backdrop-filter: blur(8px);
}

.ic-cmt-reply-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f6f8fc;
}

.ic-cmt-reply-strip-text {
  min-width: 0;
  font-size: 10.2px;
  color: #6a81a9;
  text-align: right;
}

.ic-cmt-reply-strip-text strong {
  display: block;
  color: #2d3a4a;
  font-size: 11.2px;
}

.ic-cmt-reply-cancel {
  border: 0;
  background: none;
  color: #919aaf;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.ic-cmt-composer-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  direction: ltr;
  min-height: 60px;
  padding: 10px 4px;
}

.ic-cmt-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  align-self: center;
}

.ic-cmt-input {
  display: block;
  width: 100%;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  border: 1px solid #e3e8f1;
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  font-size: 12px;
  line-height: 20px;
  direction: rtl;
  background: #fff;
  color: #2d3a4a;
  outline: none;
  box-shadow: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ic-cmt-input::-webkit-scrollbar {
  display: none;
}

.ic-cmt-input:focus,
.ic-cmt-input:focus-visible {
  outline: none;
  border-color: #e3e8f1;
  box-shadow: none;
}

.ic-cmt-input::placeholder {
  color: #929ab1;
}

.ic-cmt-expert-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  width: 40px;
  height: 40px;
  margin-right: 5px;
  padding: 0;
  border: 1.5px solid #e1e5e9;
  border-radius: 50%;
  background: #f5f6f8;
  overflow: hidden;
  cursor: pointer;
  transform: scale(1);
  transition: border-color 0.18s ease, border-width 0.18s ease;
}

.ic-cmt-expert-toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(78, 144, 230, 0.17);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.ic-cmt-expert-toggle.is-active {
  border-color: #619eea;
  border-width: 2px;
  box-shadow: none;
}

.ic-cmt-expert-toggle.is-active::after {
  opacity: 1;
}

.ic-cmt-expert-toggle.is-animating.is-active {
  animation: ic-cmt-expert-select 180ms ease;
}

.ic-cmt-expert-toggle.is-animating:not(.is-active) {
  animation: ic-cmt-expert-deselect 180ms ease;
}

@keyframes ic-cmt-expert-select {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes ic-cmt-expert-deselect {
  0% { transform: scale(1); }
  50% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.ic-cmt-expert-toggle img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.ic-cmt-send {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: center;
  padding: 8px;
  border: 0;
  background: transparent;
  cursor: default;
}

.ic-cmt-send.is-active {
  cursor: pointer;
}

.ic-cmt-send .ic-cmt-send-icon--send {
  display: inline-block;
  background-color: #bfccd4;
}

.ic-cmt-send.is-active .ic-cmt-send-icon--send {
  background-color: #4e91e6;
}

.ic-cmt-send .ic-cmt-send-icon--lock {
  display: none;
}

.ic-cmt--project .ic-cmt-item {
  margin-bottom: 20px;
}

/* ─── Circuit / AllComments — مثل SharedCommentThread ─── */
.ic-cmt-section-head {
  padding: 0 16px;
  text-align: center;
}

.ic-cmt-section-head::before {
  content: '';
  display: block;
  width: 90%;
  height: 1px;
  margin: 0 auto 20px;
  background: #eee;
}

.ic-cmt-section-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #2d3a4a;
  text-align: center;
}

.ic-cmt-section-sub {
  margin: 0 0 28px;
  font-size: 12px;
  color: #919aaf;
  text-align: center;
}

.ic-cmt--circuit {
  padding: 0 16px 4px;
}

.ic-cmt--circuit .ic-cmt-item {
  margin-bottom: 20px;
  padding-bottom: 0;
  border-bottom: 0;
}

.ic-cmt--circuit .ic-cmt-item--has-expert {
  margin-bottom: 11px;
}

.ic-cmt--circuit .ic-cmt-top {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  margin-bottom: 0;
  direction: ltr;
}

.ic-cmt--circuit .ic-cmt-item > .ic-cmt-top {
  margin-bottom: -20px;
}

.ic-cmt--circuit .ic-cmt-top--expert {
  margin-bottom: 0;
}

.ic-cmt--circuit .ic-cmt-avatar:not(.ic-cmt-avatar--reply) {
  margin-top: 5px;
  flex-shrink: 0;
}

.ic-cmt--circuit .ic-cmt-author-line {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: 12px;
  margin-top: 0;
  flex: 1;
  min-width: 0;
  direction: ltr;
}

.ic-cmt--circuit .ic-cmt-item > .ic-cmt-top .ic-cmt-author-line {
  margin-top: -30px;
}

.ic-cmt--circuit .ic-cmt-body {
  margin: 0 58px 0 5px;
  text-align: right;
}

.ic-cmt--circuit .ic-cmt-body--support {
  margin-top: 12px;
}

.ic-cmt--circuit .ic-cmt-footer {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  margin-top: 8px;
  gap: 12px;
  direction: ltr;
}

.ic-cmt--circuit .ic-cmt-author {
  font-size: 11.3px;
  font-weight: 700;
}

.ic-cmt--circuit .ic-cmt-author--reply {
  font-size: 10.8px;
}

.ic-cmt--circuit .ic-cmt-text {
  font-size: 11.1px;
  color: #4a5a6a;
  line-height: 22px;
}

.ic-cmt--circuit .ic-cmt-time {
  font-size: 11.1px;
  color: #919aaf;
}

.ic-cmt--circuit .ic-cmt-reply-btn {
  font-size: 9.3px;
  color: #4e91e6;
}

.ic-cmt--circuit .ic-cmt-support-text {
  font-size: 11.1px;
  line-height: 22px;
  color: #4a5a6a;
}

.ic-cmt--circuit .ic-cmt-support .ic-cmt-author--reply {
  font-size: 10.8px;
}

.ic-cmt--circuit .ic-cmt-reply-expert-btn {
  font-size: 9.3px;
}

.ic-cmt--circuit .ic-cmt-badge--main {
  margin-top: 7px;
}

.ic-cmt--circuit .ic-cmt-badge--reply {
  margin-top: -1px;
}

.ic-cmt-mention {
  color: #16a085;
}

.ic-cmt--circuit .ic-cmt-reply {
  margin-bottom: 16px;
}

.ic-cmt-avatar--reply {
  width: 40px;
  height: 40px;
  margin-left: 11px;
  margin-right: -8px;
  margin-top: 0;
  margin-bottom: -40px;
}

.ic-cmt--circuit .ic-cmt-reply .ic-cmt-body {
  margin-top: 12px;
}

.ic-cmt--circuit .ic-cmt-support {
  margin: 10px 58px 14px 5px;
  padding: 0;
  background: transparent;
}

.ic-cmt-toggle-replies {
  margin-top: 10px;
}

.ic-cmt--circuit .ic-cmt-toggle-replies {
  font-family: "IRANYekan", Tahoma, sans-serif;
  font-size: 9.3px;
  color: #6f6f6f;
}

.ic-cmt--circuit .ic-cmt-toggle-replies.is-loading {
  color: #666;
}

.ic-cmt-toggle-line {
  display: inline-block;
  width: 25px;
  height: 1px;
  background: #c5c9d0;
}

.ic-cmt-support {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f9ff;
}

.ic-cmt--circuit .ic-cmt-support .ic-cmt-body {
  margin-right: 44px;
  margin-left: 10px;
}

.ic-cmt-show-all {
  display: block;
  width: calc(100% - 32px);
  margin: 8px auto 0;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: #f6f8fc;
  color: #4e91e6;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.ic-cmt-more-btn {
  display: block;
  width: calc(100% - 32px);
  margin: 8px auto 20px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: #f6f8fc;
  color: #4e91e6;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
}

.ic-cmt-more-btn[hidden] {
  display: none !important;
}

.ic-cmt-more-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

body.ic-circuit.ic-cmt-composer-open .ic-cir,
body.ic-video.ic-cmt-composer-open .ic-mov,
body.ic-workshop.ic-cmt-composer-open .ic-ws,
body.ic-teardown.ic-cmt-composer-open .ic-ws,
body.ic-repair.ic-cmt-composer-open .ic-ws {
  padding-bottom: 0;
}

body.ic-circuit.ic-cmt-composer-open .ic-cir-body,
body.ic-video.ic-cmt-composer-open .ic-mov,
body.ic-workshop.ic-cmt-composer-open .ic-ws,
body.ic-teardown.ic-cmt-composer-open .ic-ws,
body.ic-repair.ic-cmt-composer-open .ic-ws,
body.ic-circuit-comments.ic-cmt-composer-open .ic-cmt-page-body,
body.ic-video-comments.ic-cmt-composer-open .ic-cmt-page-body {
  padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

.ic-cmt-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: #fff;
}

.ic-cmt-page-head {
  direction: ltr;
  flex-shrink: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #fff;
}

.ic-cmt-page-head-space {
  width: 46px;
  height: 34px;
  flex-shrink: 0;
}

.ic-cmt-page-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 5px;
  color: #4e91e6;
  text-decoration: none;
  flex-shrink: 0;
  box-sizing: content-box;
}

.ic-cmt-page-close .ic-icon {
  background-color: currentColor;
}

.ic-cmt-page-title {
  flex: 1;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: #2d3a4a;
  text-align: center;
}

.ic-cmt-page-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px 0 0;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}

.ic-cmt-page .ic-cmt--circuit {
  padding: 0 16px 0 22px;
}

.ic-cmt-item.is-entering,
.ic-cmt-reply.is-entering {
  animation: ic-cmt-slide-in 0.45s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

@keyframes ic-cmt-slide-in {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.ic-cmt-float-notif {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 80px;
  z-index: 10050;
  max-width: min(92vw, 420px);
  padding: 13px 17px;
  border-radius: 15px;
  background: #f2f2f2;
  color: #666;
  font-family: "IRANYekan", Tahoma, sans-serif;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ic-cmt-float-notif.is-visible {
  opacity: 1;
}

.ic-cmt-float-notif[hidden] {
  display: none !important;
}
