/* =========================
   Community Container
========================= */
#community-container {
  font-family: "Pretendard";
}

/* =========================
   Community Section
========================= */
#community {
}

#community .inner {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 150px 0;
}

#community .community-wrapper {
}

#community .community-top {
}

#community .community-top p {
  color: #5a63d8;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0;
  padding-left: 47px;
}

#community .community-top h2 {
  padding: 40px 0;
  line-height: 1.3;
  color: #111;
  font-weight: 300;
  font-size: 40px;
  margin: 0;
  padding-left: 47px;
}

#community .community-top h2 span {
  display: block;
  font-weight: 700;
}

#community .community-bottom {
  margin-top: 40px;
  padding-left: 47px;
}

/* =========================
   Community Search
========================= */
#community .community-search {
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

#community .search-select {
  position: relative;
  display: inline-block;
}

#searchTypeBtn {
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Pretendard", sans-serif;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px; /* 버튼 최소 너비 고정 */
  justify-content: space-between; /* 텍스트와 아이콘 간격 유지 */
}

#searchTypeList {
  position: absolute;
  left: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  list-style: none;
  padding: 4px 0;
  margin: 4px 0 0 0;
  width: 100px; /* 버튼과 동일한 너비 */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

#searchTypeBtn i {
  font-size: 12px;
}

#searchTypeList li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-family: "Pretendard", sans-serif;
}

#searchTypeList li:hover {
  background-color: #f9f9f9;
}

.hidden {
  display: none;
}

#community .community-search input {
  padding: 8px 12px;
  margin: 0 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: "Pretendard", sans-serif;
}

#community .community-search button:not(#searchTypeBtn) {
  padding: 8px 14px;
  background: #5a63d8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: "Pretendard", sans-serif;
}

#community .community-search button:hover:not(#searchTypeBtn) {
  background: #4a54c5;
}

/* =========================
   Community Table
========================= */
#community .community-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.8;
}

#community .community-table tbody tr {
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

#community .community-table tbody tr:hover {
  background-color: #f4f5ff;
  color: #333;
}

#community .community-table th {
  text-align: left;
  vertical-align: top;
  font-weight: 700;
  color: #5a63d8;
  padding: 16px 20px;
  border-top: 1px solid #e5e5e5;
}

#community .community-table td {
  text-align: left;
  padding: 16px 20px;
  border-top: 1px solid #e5e5e5;
  color: #666;
}

#community .community-table td.idx,
#community .community-table td.name,
#community .community-table td.date {
  width: 10%;
}

#community .community-table td.title {
  font-weight: 500;
  color: #222;
  width: 70%;
}

#community .community-table td.title a {
  color: #222;
  text-decoration: none;
}

#community .community-table td.title a:hover {
  text-decoration: underline;
}

/* =========================
   Pagination
========================= */
#community .pagination {
  margin-top: 20px;
  text-align: center;
}

#community .pagination .page-btn {
  background-color: #f0f0f5; /* 기본 연한색 */
  color: #333;
  font-size: 14px;
  font-family: "Pretendard", sans-serif;
  padding: 8px 14px;
  margin: 0 4px;
  cursor: pointer;
  border: none; /* 테두리 제거 */
  border-radius: 4px;
  transition: background-color 0.2s ease-in-out;
}

#community .pagination .page-btn:hover {
  background-color: #e0e0eb; /* hover 시 조금 더 진하게 */
}

#community .pagination .page-btn.active {
  background-color: #5a63d8; /* active 상태 진한색 */
  color: #fff;
  font-weight: 600;
}

/* 아이콘 버튼 (이전/다음) */
#community .pagination .page-btn i {
  font-size: 14px;
}

#community .pagination .page-btn.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* =========================
   Community Write Button
========================= */
#community .community-write {
  margin-top: 20px;
  text-align: right;
}

#community .community-write .write-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: #5a63d8;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Pretendard", sans-serif;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease-in-out;
}

#community .community-write .write-btn:hover {
  background: #4a54c5;
}

/* =========================
   Responsive
========================= */
@media (max-width: 768px) {
  #community {
    padding: 0 20px;
  }

  #community .inner {
    padding: 60px 0;
  }

  #community .community-wrapper {
    flex-direction: column;
    align-items: flex-start;
  }

  #community .community-top p {
    font-size: 13px;
    padding-left: 0;
  }

  #community .community-top h2 {
    font-size: 26px;
    padding: 20px 0 30px 0;
    padding-left: 0;
    line-height: 1.4;
  }

  #community .community-top h2 span {
    display: inline;
  }

  #community .community-search {
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }

  #community .search-select,
  #community .community-search input,
  #community .community-search button:not(#searchTypeBtn),
  #community #searchTypeBtn {
    width: 100%;
  }

  #community .search-select {
    flex: 1 1 100%;
  }

  #searchTypeBtn {
    justify-content: space-between;
  }

  #searchTypeList {
    width: 100%;
  }

  #community .community-search input {
    margin: 0;
  }

  #community .community-bottom {
    padding-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #community .community-table {
    font-size: 14px;
    min-width: 520px;
  }
  #community .community-table th,
  #community .community-table td {
    padding: 12px 12px;
  }
  #community .community-table th {
    font-size: 13px;
    white-space: nowrap;
  }
  #community .community-table td {
    font-size: 13px;
    line-height: 1.6;
  }

  #community .community-table td.title {
    width: 30%;
  }

  #community .community-write {
    text-align: center;
    margin-top: 16px;
  }

  #community .community-write .write-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 0;
  }
}
