/* Community Board Styles */
:root {
  --primary: #1a1a2e;
  --primary-light: #2d2d44;
  --accent: #4A90D9;
  --accent-hover: #3a7bc8;
  --bg: #f8f9fa;
  --bg-card: #fff;
  --text: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #e0e0e0;
  --border-light: #f0f0f0;
  --danger: #dc3545;
  --success: #28a745;
  --like-color: #e74c3c;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: var(--text); line-height: 1.6; background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.community-layout { min-height: 100vh; display: flex; flex-direction: column; }
.community-main { flex: 1; max-width: 900px; margin: 0 auto; padding: 24px 16px; width: 100%; }
.community-main.wide { max-width: 1100px; }

/* Nav */
.community-nav { background: var(--primary); color: #fff; padding: 0; position: sticky; top: 0; z-index: 100; }
.community-nav .nav-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.community-nav .nav-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.community-nav .nav-brand img { height: 32px; border-radius: 6px; }
.community-nav .nav-links { display: flex; align-items: center; gap: 16px; }
.community-nav .nav-links a { color: rgba(255,255,255,0.8); font-size: 0.9rem; text-decoration: none; padding: 6px 12px; border-radius: var(--radius); transition: background 0.2s; }
.community-nav .nav-links a:hover, .community-nav .nav-links a.active { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-user { display: flex; align-items: center; gap: 8px; }
.nav-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.nav-user-name { color: rgba(255,255,255,0.9); font-size: 0.85rem; }
.btn-login { background: var(--accent); color: #fff !important; padding: 6px 16px; border-radius: var(--radius); font-size: 0.85rem; font-weight: 600; }
.btn-login:hover { background: var(--accent-hover); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--border-light); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline.active { border-color: var(--accent); color: var(--accent); background: rgba(74,144,217,0.05); }

/* Category Tabs */
.category-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.category-tab { padding: 6px 14px; border-radius: 20px; font-size: 0.85rem; border: 1px solid var(--border); color: var(--text-secondary); background: #fff; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.category-tab:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.category-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.sort-selector select { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; background: #fff; color: var(--text); }
.search-box { display: flex; gap: 8px; }
.search-box input { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; width: 200px; }
.search-box button { padding: 6px 14px; }

/* Post Card */
.post-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow); transition: box-shadow 0.2s; }
.post-card:hover { box-shadow: var(--shadow-hover); }
.post-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.post-category { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; background: var(--border-light); color: var(--text-secondary); font-weight: 500; text-transform: capitalize; }
.post-category.tips { background: #e8f5e9; color: #2e7d32; }
.post-category.questions { background: #e3f2fd; color: #1565c0; }
.post-category.content_sharing { background: #fff3e0; color: #e65100; }
.post-category.general { background: #f3e5f5; color: #7b1fa2; }
.post-card-title { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-meta { display: flex; align-items: center; gap: 12px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.post-card-meta .author { color: var(--text-secondary); font-weight: 500; }
.post-card-stats { display: flex; gap: 12px; font-size: 0.8rem; color: var(--text-muted); }
.post-card-stats span { display: flex; align-items: center; gap: 3px; }

/* Post Detail */
.post-detail { background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); margin-bottom: 24px; }
.post-detail-title { font-size: 1.6rem; font-weight: 700; margin-bottom: 12px; }
.post-detail-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; font-size: 0.85rem; color: var(--text-muted); flex-wrap: wrap; }
.post-detail-meta .author-info { display: flex; align-items: center; gap: 8px; }
.post-detail-meta .author-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.post-detail-content { font-size: 1rem; line-height: 1.8; white-space: pre-wrap; word-break: break-word; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border-light); }
.post-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 0.9rem; transition: all 0.2s; }
.like-btn:hover { border-color: var(--like-color); color: var(--like-color); }
.like-btn.liked { border-color: var(--like-color); color: var(--like-color); background: #fef2f2; }
.edit-delete-actions { margin-left: auto; display: flex; gap: 8px; }

/* Comments */
.comments-section { background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); }
.comments-section h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }
.comment-form { margin-bottom: 24px; }
.comment-form textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.9rem; resize: vertical; min-height: 80px; font-family: inherit; }
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form .form-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.comment { padding: 16px 0; border-bottom: 1px solid var(--border-light); }
.comment:last-child { border-bottom: none; }
.comment.reply { margin-left: 40px; padding-left: 16px; border-left: 2px solid var(--border-light); }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.comment-author { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.comment-date { font-size: 0.75rem; color: var(--text-muted); }
.comment-content { font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; margin-bottom: 8px; }
.comment-actions { display: flex; gap: 12px; align-items: center; }
.comment-actions button, .comment-actions a { font-size: 0.8rem; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 2px 4px; }
.comment-actions button:hover, .comment-actions a:hover { color: var(--accent); text-decoration: none; }
.reply-form { margin-top: 8px; display: none; }
.reply-form.show { display: block; }
.reply-form textarea { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; resize: vertical; min-height: 60px; font-family: inherit; }

/* Post Form */
.post-form-container { background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.post-form-container h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(74,144,217,0.1); }
.form-group textarea { resize: vertical; min-height: 200px; }
.form-group .char-count { text-align: right; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }

/* Login */
.login-container { max-width: 420px; margin: 60px auto; padding: 0 16px; }
.login-box { background: var(--bg-card); border-radius: var(--radius-lg); padding: 40px 32px; box-shadow: var(--shadow); text-align: center; }
.login-box h2 { font-size: 1.4rem; margin-bottom: 8px; }
.login-box .subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; font-size: 0.85rem; color: var(--text-muted); }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.google-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; background: #fff; color: var(--text); cursor: pointer; width: 100%; justify-content: center; font-weight: 500; transition: background 0.2s; }
.google-btn:hover { background: var(--bg); text-decoration: none; }
.google-btn img { height: 20px; }
.login-form input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; margin-bottom: 12px; }
.login-form input:focus { outline: none; border-color: var(--accent); }

/* Profile */
.profile-header { background: var(--bg-card); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); margin-bottom: 24px; display: flex; align-items: center; gap: 20px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--border-light); }
.profile-info h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 4px; }
.profile-stats { display: flex; gap: 20px; font-size: 0.85rem; color: var(--text-secondary); }
.profile-stats span { font-weight: 600; color: var(--text); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 24px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); font-size: 0.85rem; color: var(--text-secondary); text-decoration: none; border: 1px solid var(--border); }
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .active { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .disabled { color: var(--border); cursor: default; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state p { font-size: 1rem; margin-bottom: 16px; }

/* Footer */
.community-footer { background: var(--bg-card); border-top: 1px solid var(--border-light); padding: 20px; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.community-footer a { color: var(--text-muted); margin: 0 8px; }
.community-footer a:hover { color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
  .community-main { padding: 16px 12px; }
  .post-detail { padding: 20px 16px; }
  .post-form-container { padding: 20px 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .search-box input { flex: 1; width: auto; }
  .post-detail-title { font-size: 1.3rem; }
  .comment.reply { margin-left: 20px; }
  .profile-header { flex-direction: column; text-align: center; }
  .nav-user-name { display: none; }
}
