.product-forum-layout {
  max-width: 850px;
  margin: 0 auto;
  padding: 0 24px;
}

.op-avatar,
.reply-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.op-avatar img,
.reply-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.op-avatar.gradient-avatar,
.reply-avatar.gradient-avatar {
  color: white;
  font-weight: bold;
  font-size: 14px;
  background-color: #ccc;
}

.op-name .username-link,
.reply-author-name .username-link {
  font-weight: 600;
  color: #007a87;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .op-name .username-link:hover,
  .reply-author-name .username-link:hover {
    color: #005c66;
    text-decoration: underline;
  }
}

.thread-detail-container {
  position: relative;
  margin-top: 30px;
  margin-bottom: 50px;
  background-color: #fff;
}

.thread-detail-header {
  position: absolute;
  left: -45px;
  top: 0;
  display: flex;
  align-items: center;
}

.thread-detail-back-button {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  color: #505050;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  box-shadow: rgba(0, 0, 0, 0.08) 0px 2px 8px 0px;
  transition: scale 0.2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .thread-detail-back-button:hover {
    text-decoration: none;
    scale: 1.08;
  }
}

.thread-detail-back-button:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.thread-detail-back-button i {
  font-size: 0.8rem;
}

.thread-original-post {
  padding: 20px;
  border-radius: 1.5rem;
  border: 1px solid #e7e7e7;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.op-header {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  gap: 10px;
}

.op-info {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
}

.op-actions {
  margin-left: 0.5rem;
  align-self: flex-start;
}

.op-actions .reply-actions-trigger {
  width: 2rem;
  height: 2rem;
}

.op-name {
  font-weight: 600;
  color: #1a1a1a;
  font-size: 1rem;
}

.op-tags {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  align-self: flex-start;
  flex-wrap: wrap;
  margin-left: auto;
}

.thread-detail-title {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.thread-detail-content {
  font-size: 1rem;
  line-height: 1.6;
  color: #222;
  word-break: break-word;
}
.thread-detail-content p,
.reply-content p {
  margin-bottom: 1em;
}
.thread-detail-content p:last-child,
.reply-content p:last-child {
  margin-bottom: 0;
}
.thread-detail-content ul,
.thread-detail-content ol {
  margin-bottom: 1em;
  padding-left: 20px;
}
.thread-detail-content li {
  margin-bottom: 0.5em;
}

.thread-post-time {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.6px;
  color: #656565;
  white-space: nowrap;
}

.thread-detail-meta-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #505050;
  margin-top: 2rem;
  padding-top: 0.75rem;
}

.meta-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.meta-bar-right i {
  font-size: 15px;
}

.accepted-answer-tag {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #00875a;
  font-size: 13px;
  font-weight: 500;
}
.accepted-answer-tag i {
  font-size: 15px;
}

.thread-detail-meta-bar .comments-count,
.thread-detail-meta-bar .views-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 13px;
}
.thread-reply-btn.btn {
  border-radius: 1.5rem;
}
@media (hover: hover) and (pointer: fine) {
  .thread-reply-btn.btn:hover {
    scale: 1.06;
  }
}

@media (hover: hover) and (pointer: fine) {
  .login-btn:hover {
    text-decoration: none;
  }
}

.replies-list {
  margin-top: 3rem;
}

.replies-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.replies-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 0;
}

.dropdown-trigger {
  font-weight: 500;
}

.replies-list-container {
  margin-bottom: 1.5rem;
  border: 1px solid #e7e7e7;
  border-radius: 2rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.reply-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 1.25rem 1.5rem;
  background-color: #fff;
  border-bottom: 1px solid #efefef;
}
.reply-item:last-child {
  border-bottom: none;
}

.reply-main {
  flex-grow: 1;
}

.reply-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.reply-header-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.reply-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.reply-author-name {
  font-weight: 600;
  color: #333;
  font-size: 15px;
}

.reply-date,
.reply-author-label {
  font-size: 0.875rem;
  font-weight: 400;
  color: #979797;
  white-space: nowrap;
}

.reply-divider {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background-color: #979797;
}

.reply-content {
  font-size: 1rem;
  line-height: 1.55;
  color: #222;
  word-break: break-word;
}
.reply-content.pre-wrap {
  white-space: pre-wrap;
}

.load-more-wrapper {
  text-align: center;
  padding: 20px 0;
}
#load-more-button {
  margin-inline: auto;
  border-radius: 1rem;
}

/* --- START: New styles for Best Answer (Elegant version) --- */
.reply-avatar-wrapper {
  position: relative;
  flex-shrink: 0; /* Prevent wrapper from shrinking */
}

.accepted-answer-icon {
  color: #00875a;
  background-color: white;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.reply-item.is-accepted-answer {
}
.reply-actions-trigger {
  position: relative;
  background-color: transparent;
  border: none;
  border-radius: 50%;
  color: #979797;
  cursor: pointer;
  width: 20px;
  height: 20px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.reply-actions-trigger::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #f1f1f1;
  z-index: 0;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
}
.reply-actions-trigger i {
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .reply-actions-trigger:hover::before {
    transform: scale(1);
    opacity: 1;
  }
}

.reply-actions-trigger.is-loading .fa-ellipsis {
  display: none; /* Hide the ellipsis icon */
}

.reply-actions-trigger .spinner-icon {
  display: none; /* Hide the spinner by default */
  animation: spin 1s linear infinite;
}

.reply-actions-trigger.is-loading .spinner-icon {
  display: inline-block; /* Show the spinner when loading */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.reply-item-skeleton {
  display: flex;
  gap: 10px;
  padding: 1.25rem 1.5rem;
  background-color: #fff;
  border-bottom: 1px solid #efefef;
  position: relative;
  overflow: hidden; /* Important for the shimmer effect */
}
#replies-skeleton-container .reply-item-skeleton:last-child {
  border-bottom: none;
}

.skeleton-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: #e9ecef;
  flex-shrink: 0;
}

.skeleton-content {
  flex-grow: 1;
  padding-top: 4px; /* Align with text position */
}

.skeleton-line {
  height: 1em;
  background-color: #e9ecef;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

/* Shimmer Animation */
.reply-item-skeleton::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.empty-state-container {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  margin-bottom: 1rem;
  font-size: 3rem;
  color: #ff6464;
}

.empty-state-icon svg {
  color: #a0aec0;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 0.5rem 0;
}

.empty-state-message {
  font-size: 1rem;
  color: #717f94;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

@media (max-width: 767px) {
  .thread-original-post {
    margin-inline: -1.5rem;
    padding: 0 1.5rem;
    padding-bottom: 2rem;
    background-color: #fff;
    border: none;
    border-bottom: 1px solid #efefef;
    border-radius: 0;
    box-shadow: none;
  }
  .thread-detail-header {
    position: static;
    margin-bottom: 1.5rem;
  }
  .product-forum-layout {
    padding: 0 1.5rem;
  }
  .thread-reply-btn.btn {
    position: fixed;
    right: 0.7rem;
    bottom: 6rem;
    width: 3.5rem;
    height: 3.5rem;
    color: white;
    z-index: 100;
    background: #ff5c5c;
    border-radius: 0.75rem;
    box-shadow: 0 3px 8px rgb(168 168 168);
  }
  .btn.thread-reply-btn i {
    font-size: 1.2rem;
  }
  .btn.thread-reply-btn .btn-text {
    display: none;
  }
  .op-header,
  .reply-item {
    gap: 8px;
  }
  .op-info {
    flex-direction: column;
    align-items: flex-start;
  }
  .op-tags {
    width: 100%;
    margin-top: 0.25rem;
    margin-left: unset;
  }
  .op-actions {
    position: absolute;
    top: 0;
    right: 0;
  }
  .thread-detail-title {
    font-size: 1.75rem;
  }
  .replies-list {
    margin-top: 1.5rem;
  }
  .replies-header-bar {
    margin-bottom: 1.5rem;
  }
  .replies-list-container {
    border: none;
    box-shadow: none;
    border-radius: 0;
    border-bottom: 1px solid #e7e7e7;
    margin-inline: -1.5rem;
    margin-bottom: 0;
  }
  .reply-item {
    padding: 0.75rem 1.5rem;
  }
  .reply-header {
    align-items: center;
    gap: 2px;
    margin-bottom: 0;
  }
  .reply-header-left {
    align-items: center;
    column-gap: 6px;
    row-gap: 2px;
  }
  .reply-header-right {
    margin-top: 8px;
    align-self: flex-start;
  }
  .reply-date {
    margin-left: 0;
  }
  .answer-tag-label {
    display: none;
  }
}
