/* Community Forum — warm peer support space */

.community-body {
  background: #faf7f2;
  color: #2d2a26;
  font-family: 'General Sans', -apple-system, sans-serif;
  min-height: 100vh;
}

/* --- Header --- */
.community-header {
  background: #fff;
  border-bottom: 1px solid #e8e3d9;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.community-nav {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.community-logo {
  font-family: 'Fraunces', serif;
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  color: #2d2a26;
}
.community-logo span { color: #d97706; }
.community-nav-links {
  display: flex;
  gap: 24px;
}
.community-nav-links a {
  text-decoration: none;
  color: #6b5e52;
  font-size: 0.9rem;
  font-weight: 500;
}
.community-nav-links a:hover { color: #d97706; }

/* --- Hero --- */
.community-hero {
  background: linear-gradient(135deg, #fdf6e9 0%, #f5ede0 100%);
  padding: 48px 24px 40px;
  text-align: center;
  border-bottom: 1px solid #e8e3d9;
}
.community-hero-badge {
  display: inline-block;
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.community-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: #2d2a26;
  margin-bottom: 12px;
  line-height: 1.2;
}
.community-hero-sub {
  font-size: 1rem;
  color: #6b5e52;
  max-width: 560px;
  margin: 0 auto 20px;
  line-height: 1.65;
}
.community-hero-cats {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.cat-chip {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}
.cat-worry { background: #fef3c7; color: #92400e; }
.cat-wonder { background: #dbeafe; color: #1e40af; }
.cat-remedy { background: #d1fae5; color: #065f46; }

/* --- Main Layout --- */
.community-main { padding: 32px 24px; }
.community-layout {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}

/* --- Sidebar --- */
.community-sidebar { position: sticky; top: 80px; }
.new-post-btn { width: 100%; margin-bottom: 24px; }

.sidebar-section { margin-bottom: 24px; }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9c8e80;
  margin-bottom: 10px;
}

.tag-filter-list { display: flex; flex-direction: column; gap: 4px; }
.tag-filter {
  text-align: left;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: #6b5e52;
  transition: background 0.15s;
}
.tag-filter:hover { background: #f5ede0; color: #2d2a26; }
.tag-filter.active { background: #fdf6e9; color: #d97706; font-weight: 600; }

.guidelines-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.guidelines-list li {
  font-size: 0.8rem;
  color: #9c8e80;
  line-height: 1.5;
}

.upgrade-banner {
  display: block;
  background: #fdf6e9;
  border: 1px solid #f0d090;
  border-radius: 12px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s;
}
.upgrade-banner:hover { transform: translateY(-2px); }
.upgrade-banner-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: #92400e;
  margin-bottom: 4px;
}
.upgrade-banner p { font-size: 0.78rem; color: #9c8e80; margin-bottom: 8px; }
.upgrade-banner-cta { font-size: 0.82rem; color: #d97706; font-weight: 600; }

/* --- Feed --- */
.community-feed { min-width: 0; }

.feed-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e8e3d9;
  padding-bottom: 0;
}
.feed-tab {
  background: none;
  border: none;
  padding: 8px 16px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9c8e80;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.feed-tab:hover { color: #2d2a26; }
.feed-tab.active { color: #2d2a26; border-bottom-color: #d97706; }

/* --- Post Cards --- */
.post-card {
  background: #fff;
  border: 1px solid #e8e3d9;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  border-left: 4px solid transparent;
}
.post-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); transform: translateY(-1px); border-color: #d4c9b8; }
.post-card.cat-worry { border-left-color: #f59e0b; }
.post-card.cat-wonder { border-left-color: #3b82f6; }
.post-card.cat-remedy { border-left-color: #10b981; }

.post-cat-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.post-cat-tag.cat-worry { background: #fef3c7; color: #92400e; }
.post-cat-tag.cat-wonder { background: #dbeafe; color: #1e40af; }
.post-cat-tag.cat-remedy { background: #d1fae5; color: #065f46; }

.post-title {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2d2a26;
  margin-bottom: 6px;
  line-height: 1.4;
}
.post-body-preview {
  font-size: 0.88rem;
  color: #6b5e52;
  line-height: 1.6;
  margin-bottom: 12px;
}
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.post-meta { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #9c8e80; }
.post-author { font-weight: 500; color: #6b5e52; }
.post-time { }
.educator-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
}
.post-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-stat { font-size: 0.78rem; color: #9c8e80; }
.post-tag {
  background: #f5ede0;
  color: #6b5e52;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
}

/* --- Skeleton --- */
.post-skeleton { padding: 16px 0; }
.skeleton-line { height: 14px; background: linear-gradient(90deg, #e8e3d9 25%, #f0ebe3 50%, #e8e3d9 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; margin-bottom: 10px; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-90 { width: 90%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- Modal --- */
.community-modal { max-width: 600px; width: 90vw; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-header h3 { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #9c8e80; padding: 4px; }

.category-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 8px; }
.cat-option {
  border: 2px solid #e8e3d9;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  color: inherit;
}
.cat-option:hover { border-color: #d4c9b8; background: #fdf6e9; }
.cat-option.selected {
  border-color: #d97706;
  background: #fdf6e9;
}
.cat-option.selected.cat-worry { border-color: #f59e0b; background: #fef3c7; }
.cat-option.selected.cat-wonder { border-color: #3b82f6; background: #dbeafe; }
.cat-option.selected.cat-remedy { border-color: #10b981; background: #d1fae5; }
.cat-emoji { font-size: 1.5rem; display: block; margin-bottom: 4px; }
.cat-option small { display: block; font-size: 0.72rem; color: #9c8e80; margin-top: 2px; }

.topic-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.topic-tag {
  padding: 5px 12px;
  border: 1px solid #e8e3d9;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  background: #fff;
  color: #6b5e52;
  transition: all 0.15s;
}
.topic-tag:hover { background: #f5ede0; border-color: #d4c9b8; }
.topic-tag.selected { background: #fdf6e9; border-color: #d97706; color: #92400e; font-weight: 600; }

.form-textarea { resize: vertical; min-height: 120px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: #6b5e52; cursor: pointer; }

/* --- Thread Detail --- */
.thread-detail { min-width: 0; }
.back-btn { margin-bottom: 16px; color: #6b5e52; }

.thread-post {
  background: #fff;
  border: 1px solid #e8e3d9;
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
  border-left: 5px solid transparent;
}
.thread-post.cat-worry { border-left-color: #f59e0b; }
.thread-post.cat-wonder { border-left-color: #3b82f6; }
.thread-post.cat-remedy { border-left-color: #10b981; }

.thread-title {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2d2a26;
  margin: 10px 0 8px;
  line-height: 1.35;
}
.thread-meta { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #9c8e80; margin-bottom: 16px; }
.thread-body { font-size: 0.95rem; line-height: 1.75; color: #2d2a26; margin-bottom: 16px; white-space: pre-wrap; }
.thread-image { max-width: 100%; border-radius: 8px; margin-bottom: 16px; }
.thread-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.thread-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.thread-action-btn {
  background: #f5ede0;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  color: #6b5e52;
  transition: background 0.15s;
}
.thread-action-btn:hover { background: #e8dfd0; }

.community-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 10px;
  margin-top: 8px;
}

/* --- Replies --- */
.replies-section { margin-bottom: 32px; }
.replies-heading { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; color: #2d2a26; }
.no-replies { font-size: 0.88rem; color: #9c8e80; margin-bottom: 20px; }
.replies-list { display: flex; flex-direction: column; gap: 16px; }

.reply-card {
  background: #fff;
  border: 1px solid #e8e3d9;
  border-radius: 10px;
  padding: 18px 20px;
}
.reply-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.reply-body { font-size: 0.92rem; line-height: 1.65; color: #2d2a26; white-space: pre-wrap; }
.reply-actions { display: flex; gap: 8px; margin-top: 12px; }

/* --- Reply Box --- */
.reply-box-section { background: #fff; border: 1px solid #e8e3d9; border-radius: 12px; padding: 20px; margin-top: 8px; }
.reply-label { font-weight: 600; font-size: 0.92rem; margin-bottom: 12px; color: #2d2a26; }
.reply-form { display: flex; flex-direction: column; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 600; margin-bottom: 6px; }
.empty-state p { color: #9c8e80; font-size: 0.9rem; }

/* --- Loading --- */
.loading { text-align: center; padding: 40px; color: #9c8e80; }
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8e3d9;
  border-top-color: #d97706;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utilities --- */
.hidden { display: none !important; }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.82rem; font-weight: 600; color: #6b5e52; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4c9b8;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
  color: #2d2a26;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: #d97706; }
.form-select { width: 100%; padding: 10px 12px; border: 1px solid #d4c9b8; border-radius: 8px; font-size: 0.9rem; background: #fff; color: #2d2a26; font-family: inherit; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary { background: #d97706; color: #fff; }
.btn-primary:hover { background: #b45309; }
.btn-secondary { background: #f5ede0; color: #6b5e52; }
.btn-secondary:hover { background: #e8dfd0; }
.btn-ghost { background: none; color: #6b5e52; padding: 6px 12px; }
.btn-ghost:hover { background: #f5ede0; }

/* --- Modal Overlay (from app.css — app.css not loaded on /community) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: #fff;
  border: 1px solid #e8e3d9;
  border-radius: 12px;
  padding: 28px;
  max-width: 560px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-overlay.open .modal { transform: translateY(0); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .community-layout { grid-template-columns: 1fr; }
  .community-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 12px; }
  .sidebar-section { margin-bottom: 0; }
  .tag-filter-list { flex-direction: row; flex-wrap: wrap; }
  .category-picker { grid-template-columns: 1fr; }
  .community-hero h1 { font-size: 1.8rem; }
  .upgrade-banner { flex: 1; }
  .modal { padding: 20px; }
}