/**
 * HrdFlex Community Theme CSS
 * 커뮤니티 & Q&A 섹션 전용 스타일
 * Created: 배서연
 */

/* ========================================
   1. 커뮤니티 리스트 테이블 레이아웃
   ======================================== */

/* 헤더 겹침 방지 & 중앙 정렬 */
#section {
  padding-top: 110px;
  max-width: 1400px;
  margin: 0 auto;
}

.community-container,
.qna-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 12%;
}

.search__input {
    margin-top: 0%;
}

/* 게시판 헤더 */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-light);
}

.board-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.board-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* 검색 박스 스타일 */
.board-search {
  margin-bottom: 2rem;
}

.board-search form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: nowrap;
}

.board-search select {
  min-width: 120px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-base);
  background: white;
  cursor: pointer;
  color: var(--text-dark);
  width: initial;
  margin-bottom: initial;
}


.board-search select:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.board-search input[type="text"],
.board-search input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  transition: var(--transition-base);
  color: var(--text-dark);
  background: white;
  width: initial;
  margin-bottom: initial;
}

.board-search input[type="text"]:focus,
.board-search input[type="search"]:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.board-search input[type="text"]::placeholder,
.board-search input[type="search"]::placeholder {
  color: var(--text-gray);
}

.board-search button,
.board-search input[type="image"] {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  background: var(--primary-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.board-search button:hover,
.board-search input[type="image"]:hover {
  background: #0052cc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
}

/* 리스트 아이템 카드 스타일 */
.board-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 3rem;
}

.board-item {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
}

.board-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-blue);
  background: linear-gradient(135deg, white 0%, #f8f9fa 100%);
}

/* 전체 클릭 영역 확장 */
.board-item .board-item-title a::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.board-item-number {
  width: 50px;
  font-size: 0.9rem;
  color: var(--text-gray);
  font-weight: 500;
}

.board-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0 1.5rem;
}

.board-item-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-item-title a {
  color: inherit;
  text-decoration: none;
}

.board-item-title a:hover {
  color: var(--primary-blue);
}

.board-item-meta {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-gray);
  align-items: center;
}

.board-item-meta .meta-author,
.board-item-meta .meta-date,
.board-item-meta .meta-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.board-item-meta svg {
  flex-shrink: 0;
}

.board-item-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    background-color: white;
}

input, textarea, select {
    border-radius: 4px;
    color: black;
    margin-bottom: initial;
}

/* Q&A 상태 배지 */
.status-waiting {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-progress {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-complete {
  background: rgba(34, 197, 94, 0.1);
  color: #059669;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 커뮤니티 카테고리 배지 */
.category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(147, 51, 234, 0.1);
  color: #7c3aed;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
}

/* ========================================
   2. 상세 보기 페이지
   ======================================== */
.board-detail {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 2rem;
}

.board-detail-header {
  padding: 2rem;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(135deg, #f8f9fa 0%, white 100%);
}

.board-detail-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.board-detail-meta {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-gray);
}

.board-detail-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.board-detail-meta-item i {
  font-size: 1rem;
  color: var(--primary-blue);
}

.board-detail-content {
  padding: 2rem;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.board-detail-content p {
  margin-bottom: 1rem;
}

.board-detail-actions {
  padding: 1.5rem 2rem;
  background: var(--bg-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Q&A 답변 섹션 */
.answer-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--border-light);
}

.answer-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
  color: white;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.answer-content {
  padding: 1.5rem;
  background: rgba(0, 102, 255, 0.03);
  border-left: 4px solid var(--primary-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ========================================
   3. 글쓰기/수정 폼
   ======================================== */
.board-form {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-label .required {
  color: #dc2626;
  margin-left: 0.25rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  transition: var(--transition-base);
  background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--primary-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

.form-textarea {
  min-height: 200px;
  resize: vertical;
}

.form-readonly {
  background: var(--bg-light);
  cursor: not-allowed;
  color: var(--text-gray);
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-top: 0.25rem;
}

.char-counter {
  font-size: 0.85rem;
  color: var(--text-gray);
  text-align: right;
  margin-top: 0.25rem;
}

/* ========================================
   4. 댓글 (커뮤니티)
   ======================================== */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-light);
}

.comments-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
}

.comment-item {
  padding: 1rem;
  margin-bottom: 1rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.comment-item:hover {
  background: #f1f3f5;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.comment-date {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-left: auto;
}

.comment-content {
  color: var(--text-dark);
  line-height: 1.6;
}

.comment-form {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: var(--radius-md);
}

/* ========================================
   5. 반응형 디자인
   ======================================== */
@media (max-width: 1024px) {
  .community-container,
  .qna-container {
    padding: 2rem 5%;
  }
}

@media (max-width: 768px) {
  #section {
    padding-top: 80px;
  }

  .community-container,
  .qna-container {
    padding: 1.5rem 3%;
  }

  .board-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .board-search form {
    flex-wrap: wrap;
  }

  .board-search select {
    width: 100%;
  }

  .board-search input[type="text"],
  .board-search input[type="search"] {
    width: 100%;
    min-width: auto;
  }

  .board-search button,
  .board-search input[type="image"] {
    width: 100%;
  }

  .board-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-item-number {
    width: auto;
    margin-bottom: 0.5rem;
  }

  .board-item-content {
    margin: 0;
    width: 100%;
  }

  .board-detail-header {
    padding: 1.5rem;
  }

  .board-detail-title {
    font-size: 1.5rem;
  }

  .board-detail-meta {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions button,
  .form-actions .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  #section {
    padding-top: 60px;
  }

  .community-container,
  .qna-container {
    padding: 1rem 1rem;
  }

  .board-title {
    font-size: 1.5rem;
  }

  .board-item {
    padding: 1rem;
  }

  .board-item-title {
    font-size: 1rem;
  }

  .board-detail-content {
    padding: 1.5rem 1rem;
  }

  .board-detail-title {
    font-size: 1.25rem;
  }
}

/* ========================================
   6. 파일 첨부 UI
   ======================================== */
.file-upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  transition: var(--transition-base);
  cursor: pointer;
  background: var(--bg-light);
}

.file-upload-area:hover {
  border-color: var(--primary-blue);
  background: rgba(0, 102, 255, 0.03);
}

.file-upload-area.dragover {
  border-color: var(--primary-blue);
  background: rgba(0, 102, 255, 0.05);
}

.file-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.file-item-name {
  flex: 1;
  margin: 0 1rem;
  font-size: 0.9rem;
}

.file-item-size {
  color: var(--text-gray);
  font-size: 0.85rem;
}

.file-item-remove {
  padding: 0.25rem 0.5rem;
  background: none;
  border: none;
  color: #dc2626;
  cursor: pointer;
  transition: var(--transition-base);
}

.file-item-remove:hover {
  color: #991b1b;
}