/* Custom Forum System - Styles
   Designed to closely match the provided Diet Support Forum mobile UI
*/

.cfs-forum-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding: 100px 16px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  background: #fff;
}

/* Header */

.cfs-forum-header {
  text-align: center;
  margin-bottom: 24px;
}

.cfs-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.cfs-subtitle {
  font-size: 12px;
  color: #777;
  line-height: 1.5;
}

/* Search */

.cfs-search-form {
  margin-top: 16px;
  position: relative;
}

.cfs-search-input {
  width: 100%;
  border-radius: 24px;
  border: 1px solid #f2b5c7;
  padding: 10px 14px;
  font-size: 13px;
  box-sizing: border-box;
}

.cfs-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 12px;
  color: #fb6a9a;
  padding: 4px 8px;
  cursor: pointer;
}

/* Topic filters */

.cfs-topic-filter {
  margin-top: 24px;
}

.cfs-filter-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  text-align: center;
}

.cfs-filter-chips {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cfs-filter-chip {
  flex: 1;
  background: #fafafa;
  border-radius: 999px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid transparent;
  text-decoration: none;
  color: #333;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.cfs-filter-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #eee;
  background: #fff;
}

.cfs-filter-chip.is-active {
  border-color: #fb6a9a;
  background: #ffe8f0;
}

/* Tabs */

.cfs-tabs {
  display: flex;
  margin-top: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.cfs-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 4px;
  font-size: 13px;
  cursor: pointer;
  color: #888;
  position: relative;
}

.cfs-tab-btn.is-active {
  color: #fb6a9a;
  font-weight: 600;
}

.cfs-tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #fb6a9a;
  border-radius: 999px;
}

/* Topic list */

.cfs-topic-list {
  margin-top: 8px;
}

.cfs-topic-card {
  position: relative;
  padding: 12px 12px 14px;
  border-bottom: 1px dashed #e3e3e3;
}

.cfs-topic-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f0f9ff;
  font-size: 10px;
  color: #0185d0;
  margin-bottom: 6px;
}

/* Header row with avatar */

.cfs-topic-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cfs-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #ffd9e6;
  display: inline-block;
}

.cfs-topic-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cfs-topic-author {
  font-size: 12px;
  font-weight: 600;
}

.cfs-topic-time {
  font-size: 11px;
  color: #999;
}

/* Title + content */

.cfs-topic-title {
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: 600;
}

.cfs-topic-excerpt {
  font-size: 12px;
  line-height: 1.6;
  color: #555;
}

/* Footer row */

.cfs-topic-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cfs-see-more {
  border: none;
  background: none;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  padding: 0;
}

.cfs-topic-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.cfs-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  border: 1px solid #ffd1e0;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
}

.cfs-like-btn.is-liked {
  background: #fb6a9a6b;
  color: #fff;
  border-color: #fb6a9a;
}

.cfs-like-icon {
  font-size: 12px;
}

.cfs-reply-count {
  color: #777;
}

/* Pagination */

.cfs-pagination {
  margin: 16px 0;
  text-align: center;
}

.cfs-pagination .page-numbers {
  display: inline-block;
  margin: 0 4px;
  font-size: 11px;
}

/* Floating Post Button */

.cfs-floating-post-btn {
  border-radius: 999px;
  padding: 10px 18px;
  border: none;
  background: #fb6a9a;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
  cursor: pointer;
}

/* Modal */

.cfs-new-topic-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.cfs-new-topic-modal.is-open {
  display: flex;
}

.cfs-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

.cfs-modal-dialog {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px 18px;
  box-shadow: 0 18px 35px rgba(0,0,0,0.22);
}

.cfs-modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.cfs-form-group {
  margin-bottom: 10px;
}

.cfs-form-group label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.cfs-form-group input,
.cfs-form-group select,
.cfs-form-group textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 8px;
  font-size: 12px;
  box-sizing: border-box;
}

.cfs-submit-btn {
  width: 100%;
  border-radius: 999px;
  padding: 10px 0;
  border: none;
  background: #fb6a9a;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

/* No topics */

.cfs-no-topics {
  text-align: center;
  padding: 20px 0;
  font-size: 12px;
  color: #777;
}

/* Simple responsive improvements */

@media (min-width: 600px) {
  .cfs-forum-wrapper {
    max-width: 540px;
  }
}

/* HERO SECTION */

.cfs-topic-hero {
  background: linear-gradient(180deg, #ffe8f0, #ffffff);
  padding: 28px 20px 32px;
  margin: -10px -16px 20px -16px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
}

.cfs-hero-inner {
  max-width: 480px;
  margin: 0 auto;
}

.cfs-hero-back-btn {
  background: none;
  border: none;
  color: #fb6a9a;
  font-size: 13px;
  margin-bottom: 10px;
  cursor: pointer;
}

.cfs-hero-category {
  display: inline-block;
  background: #f7fbff;
  border: 1px solid #dbeaff;
  padding: 4px 12px;
  font-size: 11px;
  border-radius: 999px;
  margin-bottom: 12px;
  color: #0077c7;
}

.cfs-hero-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  margin: 2px 0 10px;
}

.cfs-hero-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #777;
}

.cfs-topic-toprow {
    display: flex;
    justify-content: space-between;
    align-items: center; /* <— THIS fixes vertical alignment */
    margin-bottom: 8px;
    width: 100%;
}

.cfs-topic-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 24px; /* consistent badge height */
    padding: 0 10px;
    font-size: 12px;
    border-radius: 12px;
    background: #f0f7ff;
    color: #0075c9;
}

.cfs-delete-topic-form {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.cfs-delete-icon {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity .2s;
    margin-left: 10px;
}

.cfs-delete-icon:hover {
    opacity: 1;
}

.cfs-reply-card-with-delete {
    position: relative;
}

.cfs-delete-reply-form {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
    padding: 0;
}

.cfs-delete-reply-icon {
    cursor: pointer;
    font-size: 18px;
    opacity: 0.6;
    transition: opacity .2s;
}

.cfs-delete-reply-icon:hover {
    opacity: 1;
}

/* Hide desktop header parts on forum pages */
body.force-mobile-header #header-navigation,
body.force-mobile-header .pc-menu,
body.force-mobile-header .d-pc {
    display: none !important;
}

/* Always show hamburger menu */
body.force-mobile-header #toggle {
    display: flex !important;
}

/* Always show mobile menu behavior */
body.force-mobile-header #mobile-menu {
    display: block !important;
}

/* Adjust layout spacing */
body.force-mobile-header #header .header-row {
    justify-content: space-between !important;
}

.mobile-forum.open {
    max-width: 520px;
    margin: auto;
    right: unset !important;
}

.cfs-like-btn .fa-heart {
    color: #ccc; /* default gray */
    transition: color 0.2s ease;
}

.cfs-like-btn.is-liked .fa-heart {
    color: #ff4d6d;
}

#footer.forum-footer {
  background: #fff !important;
}

.forum-footer  .footer-content {
  color: var(--color-gray-dark) !important;
}