/* Product Specific Layout */
.product-forum-layout {
  max-width: 1059px;
  margin: 0 auto;
  margin-bottom: 3rem;
  padding: 2rem 1.5rem;
}

/* Hero Section */
.hero-section {
  background-color: #ffffff;
  margin-top: 40px;
  margin-bottom: 40px;
  display: flex;
  flex-direction: column;
}

.hero-section .product-image {
  max-height: 320px;
  min-height: 280px;
  object-fit: contain;
}

.hero-section .product-info {
  padding: 32px;
  text-align: center;
}

.hero-section .product-title {
  font-size: 2.3rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-section .product-description {
  font-size: 18px;
  color: #505050;
  line-height: 1.6;
}

/* Forum Actions & Filters */
.forum-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.btn.new-thread-button,
.login-btn > .btn {
  border-radius: 0.75rem;
}

@media (hover: hover) and (pointer: fine) {
  .btn.new-thread-button:hover,
  .login-btn > .btn:hover {
    scale: 1.06;
  }
  .login-btn:hover {
    text-decoration: none;
  }
}

.category-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-filters button {
  background-color: #f0f0f0;
  color: #333333;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-weight: 500;
  font-size: 13px;
  font-family: inherit;
  border-radius: 30px;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.category-filters button.active {
  background-color: #222222;
  color: white;
  border-color: #222222;
}
@media (hover: hover) and (pointer: fine) {
  .category-filters button:not(.active):hover {
    background-color: #e0e0e0;
    color: #111111;
  }
}

/* Thread List & Cards */
.thread-list {
  display: grid;
  gap: 24px;
}

.thread-card {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 1rem;
  padding: 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  display: flex;
  gap: 16px;
}

.thread-head {
  display: flex;
  justify-content: flex-start;
  gap: 0.75rem;
}

.thread-mobile-author {
  display: none;
  flex-direction: column;
  gap: 2px;
}

.mobile-author-name {
  font-size: 15px;
  font-weight: 500;
}

.mobile-created-info {
  font-size: 0.75rem;
  font-weight: 400;
}

.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.author-avatar.no-avatar {
  color: white;
  background-color: #cccccc;
  font-weight: bold;
  font-size: 1rem;
}

.thread-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.thread-title-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.thread-title-link {
  width: fit-content;
  margin-bottom: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.3;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .thread-title-link:hover {
    color: #007a87;
    text-decoration: underline;
  }
}

.thread-item-description {
  margin-bottom: 1.2rem;
  font-size: 15px;
  color: #505050;
  line-height: 1.4;
  max-height: calc(1.4em * 4);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.thread-meta {
  font-size: 13px;
  color: #656565;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

.thread-meta > span {
  margin-right: 0;
  align-items: center;
}
.thread-meta i {
  margin-right: 0.25rem;
  font-size: 12px;
}

.answered-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #e6f7f2;
  color: #00875a;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.answered-tag i {
  font-size: 11px;
}

.isAnswered-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.type-tag:not([data-category='Answer']) {
  display: none;
}

.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) {
  .username-link:hover {
    color: #005c66;
    text-decoration: underline;
  }
}

.thread-stats-lastpost-wrapper {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid #eaeaea;
  margin-top: 12px;
}

.thread-stats {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #484848;
}

.thread-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.thread-stats .stat-item i {
  font-size: 13px;
  color: #717171;
}

.last-post-info {
  font-size: 13px;
  color: #656565;
  text-align: right;
}
.last-post-info i {
  margin-right: 5px;
}

#skeleton-loader {
  display: grid;
  gap: 24px;
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton-line,
.skeleton-avatar {
  background-color: #e0e0e0;
  background-image: linear-gradient(
    to right,
    #e0e0e0 0%,
    #f0f0f0 20%,
    #e0e0e0 40%,
    #e0e0e0 100%
  );
  background-repeat: no-repeat;
  background-size: 2000px 104px;
  animation: shimmer 1.5s linear infinite;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

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

.skeleton-title {
  height: 20px;
  margin-bottom: 0.75rem;
}

.skeleton-tag {
  width: 80px;
  height: 24px;
  border-radius: 9999px;
}

/* Hide skeleton specific elements by default */
.skeleton-mobile-author,
.skeleton-meta,
.skeleton-footer {
  display: none;
}

.empty-state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 2rem;
  min-height: 300px;
}

.empty-state-icon i {
  font-size: 4rem;
  color: #ff6464;
  margin-bottom: 1.5rem;
}

.empty-state-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.5rem 0;
}

.empty-state-text {
  font-size: 1rem;
  color: #656565;
  max-width: 450px;
  line-height: 1.6;
}

@media (min-width: 768px) {
  .hero-section {
    flex-direction: row;
    align-items: center;
  }
  .hero-section .product-image {
    width: 40%;
    max-width: 450px;
  }
  .hero-section .product-info {
    width: 60%;
    padding: 1.5rem;
    text-align: left;
  }
  .skeleton-meta,
  .skeleton-footer {
    display: flex;
    gap: 12px;
  }
  .skeleton-footer {
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eaeaea;
    margin-top: 12px;
    padding-top: 12px;
  }
  .skeleton-meta > div {
    margin-bottom: 0;
  }
  .skeleton-footer .last-post-info,
  .skeleton-footer .thread-stats {
    display: flex;
    gap: 16px;
  }
  .skeleton-footer .skeleton-line {
    margin-bottom: 0;
  }
}

@media (max-width: 767px) {
  .product-forum-layout {
    padding: 1.5rem;
  }
  .hero-section {
    margin-top: 24px;
    margin-bottom: 24px;
    flex-direction: column;
  }
  .hero-section .product-info {
    padding: 24px 16px;
    width: 100%;
    text-align: center;
  }
  .hero-section .product-title {
    font-size: 24px;
  }
  .hero-section .product-description {
    font-size: 15px;
  }
  .btn.new-thread-button,
  .login-btn > .btn {
    position: fixed;
    right: 0.7rem;
    bottom: 6rem;
    width: 3.5rem;
    height: 3.5rem;
    z-index: 100;
    background: #ff5c5c;
    color: white;
    box-shadow: 0 3px 8px rgb(168 168 168);
  }
  .btn.new-thread-button i,
  .login-btn > .btn i {
    font-size: 1.5rem;
  }
  .btn.new-thread-button .btn-text,
  .login-btn > .btn .btn-text {
    display: none;
  }
  .forum-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .category-filters-wrapper {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;
  }
  .category-filters {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    flex-wrap: nowrap;
  }
  .category-filters::-webkit-scrollbar {
    display: none;
  }
  .category-filters button {
    flex-shrink: 0;
  }
  .thread-list {
    gap: 2rem;
  }
  .thread-card {
    flex-direction: column;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    gap: 0.75rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #efefef;
  }
  .thread-mobile-author {
    display: flex;
  }
  .thread-title-wrapper {
    flex-direction: column-reverse;
    align-items: flex-start;
  }
  .thread-item-description {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
  }
  .thread-meta {
    font-size: 0.75rem;
    display: none;
  }
  .type-tag,
  .type-tag:not([data-category='Answer']) {
    display: inline-flex;
  }
  .thread-stats-lastpost-wrapper {
    justify-content: flex-start;
    gap: 1rem;
    border: none;
    padding-top: 0;
    margin-top: 0;
  }
  .thread-stats {
    font-size: 0.75rem;
  }
  .last-post-info {
    text-align: left;
    font-size: 0.75rem;
  }

  .modal-content {
    padding-inline: 1rem;
  }
  .mobile-none {
    display: none;
  }
  #skeleton-loader {
    gap: 3rem;
  }
  .skeleton-card {
    gap: 0.75rem;
  }
  .skeleton-mobile-author {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .skeleton-mobile-author .skeleton-line {
    margin-bottom: 6px;
  }
  .skeleton-card .thread-title-wrapper {
    margin-bottom: 0.5rem;
  }
  .skeleton-card .skeleton-tag {
    /* Mimic the mobile layout where tag is on its own line */
    display: inline-block;
  }
  .skeleton-footer {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    padding-top: 0;
    margin-top: 0;
    border-top: none;
  }
  .skeleton-footer .thread-stats {
    display: flex;
    gap: 1rem;
  }
  .skeleton-footer .last-post-info {
    display: none; /* Last post info is part of the line on mobile */
  }
  .skeleton-footer .skeleton-line {
    margin-bottom: 0;
  }
  .empty-state-container {
    padding: 3rem 1.5rem;
  }
  .empty-state-icon i {
    font-size: 3rem;
  }
  .empty-state-heading {
    font-size: 1.15rem;
  }
  .empty-state-text {
    font-size: 0.9rem;
  }
}
