/* 커뮤니티 페이지 전용 스타일 */

/* ✅ 커뮤니티 메인 컨테이너 */
.community-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ✅ 헤더 영역 */
.community-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.community-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--white);
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.back-btn:hover {
  background: var(--gray-100);
  transform: translateX(-2px);
}

.community-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
}

.community-header-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

/* ✅ 카테고리 탭 컨테이너 */
.community-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.community-tabs::-webkit-scrollbar {
  height: 4px;
}

.community-tabs::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 4px;
}

/* 카테고리 탭 */
.community-category-tab {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: var(--white);
  color: var(--gray-600);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.community-category-tab:hover {
  background: var(--gray-50);
  color: var(--gray-900);
}

.community-category-tab.active {
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: var(--white);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

/* ✅ 게시글 목록 컨테이너 */
.community-posts {
  display: grid;
  gap: 20px;
}

/* ✅ 커뮤니티 카드 */
.community-post-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  cursor: pointer;
}

.community-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* ✅ 카테고리 라벨 */
.community-post-category {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 10px;
}

/* 카테고리별 색상 */
.community-post-category.safety {
  background: #5b8def;
}
.community-post-category.tip {
  background: #67c587;
}
.community-post-category.story {
  background: #f7a54b;
}
.community-post-category.qna {
  background: #e45858;
}

/* ✅ 게시글 제목 */
.community-post-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #222;
  line-height: 1.4;
}

/* ✅ 게시글 내용 */
.community-post-content {
  font-size: 14px;
  color: #555;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* ✅ 작성자 + 좋아요/조회수 영역 */
.community-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.community-post-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-author-avatar {
  background: linear-gradient(135deg, #74b9ff, #a29bfe);
  color: white;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.community-author-name {
  font-size: 13px;
  color: #333;
  font-weight: 500;
}

/* ✅ 좋아요/조회수 아이콘 */
.community-post-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #777;
  font-size: 13px;
}

.community-post-stats .community-stat-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.community-post-stats .community-stat-item svg {
  width: 16px;
  height: 16px;
}

/* 새 게시글 버튼 */
.btn-new-post {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: var(--white);
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  transition: all 0.3s;
  z-index: 50;
}

.btn-new-post:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.5);
}

/* 반응형 */
@media (max-width: 768px) {
  .community-container {
    padding: 24px 16px;
  }

  .community-header {
    margin-bottom: 24px;
  }

  .community-title {
    font-size: 24px;
  }

  .community-header-right {
    width: 100%;
    justify-content: flex-end;
  }

  .community-tabs {
    margin-bottom: 24px;
  }

  .community-post-card {
    padding: 20px;
  }

  .community-post-title {
    font-size: 16px;
  }

  .btn-new-post {
    width: 56px;
    height: 56px;
    bottom: 24px;
    right: 24px;
  }
}

@media (max-width: 480px) {
  .community-header-left {
    gap: 12px;
  }

  .community-title {
    font-size: 20px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 20px;
    font-size: 14px;
  }

  .btn-primary svg {
    width: 16px !important;
    height: 16px !important;
  }
}