/* Community Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
  margin-right: 1rem;
}

.dropdown-btn {
  background: #17a2b8;
  color: white;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.dropdown-btn:hover {
  background: #138496;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--bg-color, white);
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1000;
  border-radius: 4px;
  top: 100%;
  left: 0;
  margin-top: 2px;
  border: 1px solid var(--border-color, #dee2e6);
}

.dropdown-content a {
  color: var(--text-color, #333) !important;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light, #eee);
}

.dropdown-content a:last-child {
  border-bottom: none;
}

.dropdown-content a:hover {
  background-color: var(--hover-bg, #f1f1f1);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Community Layout */
.community-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.community-header {
  background: var(--header-bg, #f8f9fa);
  color: var(--header-text, #495057);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  text-align: center;
  border: 1px solid var(--border-color, #dee2e6);
}

.community-header h1 {
  margin: 0 0 8px 0;
  font-size: 2rem;
  font-weight: 600;
}

.community-header p {
  margin: 0;
  opacity: 0.8;
  font-size: 1rem;
}

/* Board Styles */
.board-container {
  background: var(--bg-color, white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  border: 1px solid var(--border-color, #dee2e6);
}

.board-header {
  background: var(--header-bg, #f8f9fa);
  padding: 20px;
  border-bottom: 1px solid var(--border-color, #dee2e6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.board-title {
  font-size: 1.5rem;
  margin: 0;
  color: var(--text-color, #495057);
}

.board-actions {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #1e7e34;
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #545b62;
}

/* Board Table */
.board-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.board-table th,
.board-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.board-table th {
  background: var(--header-bg, #f8f9fa);
  font-weight: 600;
  color: var(--text-color, #495057);
}

.board-table tbody tr {
  transition: all 0.2s ease;
}

.board-table tbody tr:hover {
  background: var(--hover-bg, #f8f9fa);
  transform: translateX(2px);
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.board-table .text-center {
  text-align: center;
}

/* 공지사항 배지 개선 */
.board-table .notice-badge {
  background: linear-gradient(135deg, #dc3545, #c82333) !important;
  color: white !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
  font-size: 10px !important;
  font-weight: bold !important;
  margin-right: 8px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

/* Reply depth 스타일 */
.reply-title {
  color: var(--text-muted, #6c757d) !important;
  font-size: 0.95em;
  text-decoration: none;
}

.reply-title:hover {
  color: var(--link-color, #007bff) !important;
  text-decoration: underline;
}

.reply-prefix {
  color: var(--text-muted, #6c757d);
  font-weight: normal;
  font-size: 0.9em;
}

.reply-indicator {
  color: var(--text-muted, #6c757d);
  font-weight: bold;
  font-size: 1.1em;
}

.post-title-link {
  text-decoration: none;
  color: var(--text-color, #495057);
  font-weight: normal;
  font-size: 0.875rem;
}

.post-title-link:hover {
  text-decoration: none;
  color: var(--link-color, #007bff);
}

/* 답글 들여쓰기 개선 */
.post-title[style*="padding-left"] {
  position: relative;
  border-left: 2px solid var(--border-color, #dee2e6);
  background: linear-gradient(90deg, var(--hover-bg, #f8f9fa) 0%, transparent 100%);
}

.post-title[style*="padding-left"]:before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  width: 12px;
  height: 1px;
  background: var(--border-color, #dee2e6);
}

.reply-count {
  color: #dc3545;
  font-size: 0.85em;
  margin-left: 5px;
  font-weight: bold;
}

.attachment-icon {
  color: var(--text-muted, #6c757d);
  margin-left: 5px;
  font-size: 0.9em;
}

/* Post View */
.post-container {
  background: var(--bg-color, white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: 1px solid var(--border-color, #dee2e6);
}

.post-header {
  background: var(--header-bg, #f8f9fa);
  padding: 20px;
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.post-title {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: var(--text-color, #495057);
}

.post-meta {
  color: var(--text-muted, #6c757d);
  font-size: 0.875rem;
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.post-content {
  padding: 30px 20px;
  line-height: 1.6;
  min-height: 200px;
  color: var(--text-color, #495057);
}

.post-actions {
  padding: 15px 20px;
  background: var(--header-bg, #f8f9fa);
  border-top: 1px solid var(--border-color, #dee2e6);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* Comments */
.comments-section {
  background: var(--bg-color, white);
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border: 1px solid var(--border-color, #dee2e6);
}

.comments-header {
  background: var(--header-bg, #f8f9fa);
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color, #dee2e6);
  font-weight: 600;
  color: var(--text-color, #495057);
}

.comment-item {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-light, #f1f3f4);
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-author {
  font-weight: 600;
  color: var(--text-color, #495057);
  margin-bottom: 5px;
}

.comment-meta {
  color: var(--text-muted, #6c757d);
  font-size: 0.75rem;
  margin-bottom: 8px;
}

.comment-content {
  line-height: 1.5;
  margin-bottom: 10px;
  color: var(--text-color, #495057);
}

.comment-actions {
  display: flex;
  gap: 10px;
}

.comment-actions a {
  color: var(--text-muted, #6c757d);
  text-decoration: none;
  font-size: 0.75rem;
}

.comment-actions a:hover {
  color: #007bff;
}

/* Reply */
.reply-item {
  margin-left: 30px;
  border-left: 3px solid var(--border-color, #dee2e6);
  padding-left: 15px;
  background: var(--hover-bg, #f8f9fa);
}

/* Comment Form */
.comment-form {
  background: var(--header-bg, #f8f9fa);
  padding: 20px;
  border-top: 1px solid var(--border-color, #dee2e6);
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: var(--text-color, #495057);
}

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color, #ced4da);
  border-radius: 4px;
  font-size: 0.875rem;
  box-sizing: border-box;
  background: var(--input-bg, white);
  color: var(--text-color, #495057);
}

.form-control:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Editor Styles */
.editor-container {
  margin-bottom: 15px;
}

.file-upload {
  margin-bottom: 15px;
}

.file-upload input[type="file"] {
  display: none;
}

.file-upload-label {
  display: inline-block;
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
}

.file-upload-label:hover {
  background: #545b62;
}

.file-list {
  margin-top: 10px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #eee);
}

.file-item:last-child {
  border-bottom: none;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  gap: 5px;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  text-decoration: none;
  border: 1px solid var(--border-color, #dee2e6);
  color: var(--link-color, #007bff);
  border-radius: 4px;
  background: var(--bg-color, white);
}

.pagination a:hover {
  background: var(--hover-bg, #e9ecef);
}

.pagination .current {
  background: #007bff;
  color: white;
  border-color: #007bff;
}

/* Search */
.search-form {
  background: var(--header-bg, #f8f9fa);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color, #dee2e6);
}

.search-container {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.search-container select {
  flex-shrink: 0;
  width: auto;
  min-width: 120px;
}

.search-container input[type="text"] {
  flex: 1;
  min-width: 200px;
}

.search-container button {
  flex-shrink: 0;
  white-space: nowrap;
}

.search-group {
  flex: 1;
  min-width: 200px;
}

/* 모바일용 메타 정보 (기본 숨김) */
.mobile-meta {
  display: none;
}

/* Alert Messages */
.alert {
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* QnA 관련 스타일 개선 */
.qna-badge {
  background: linear-gradient(135deg, #17a2b8, #138496);
  color: white;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.admin-badge {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: white;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(220, 53, 69, 0.4);
}

.status-badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  display: inline-block;
  min-width: 70px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.status-badge.answered {
  background: linear-gradient(135deg, #28a745, #1e7e34);
  color: white;
}

.status-badge.waiting {
  background: linear-gradient(135deg, #ffc107, #e0a800);
  color: #212529;
}

/* QnA 비공개 제목 스타일 개선 */
.restricted-title {
  color: var(--text-muted, #6c757d);
  cursor: default;
  font-style: italic;
  opacity: 0.8;
}

.privacy-notice {
  font-size: 10px;
  color: #dc3545;
  font-weight: bold;
  margin-left: 8px;
  padding: 1px 6px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* QnA 답변 스타일 */
.qna .reply-item {
  background-color: #f8f9fa;
  border-left: 4px solid #17a2b8;
  padding: 15px;
  margin-top: 10px;
  border-radius: 0 4px 4px 0;
}

.qna .reply-header {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

/* QnA 테이블 배지 스타일 */
.board-table .status-badge {
  font-size: 11px;
  padding: 2px 6px;
}

/* 접근 권한 안내 메시지 */
.access-denied {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--header-bg, #f8f9fa);
  border-radius: 8px;
  margin: 20px 0;
}

.access-denied h3 {
  color: var(--text-muted, #6c757d);
  margin-bottom: 10px;
}

.access-denied p {
  color: var(--text-muted, #6c757d);
  margin-bottom: 20px;
}

/* QnA 문의하기 버튼 */
.btn.qna-write {
  background-color: #17a2b8;
  border-color: #17a2b8;
  color: white;
}

.btn.qna-write:hover {
  background-color: #138496;
  border-color: #117a8b;
}

/* No posts 스타일 개선 */
.no-posts {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted, #6c757d);
  font-style: italic;
  font-size: 1.1em;
  background: var(--hover-bg, #f8f9fa);
  border-radius: 8px;
}

.no-posts a {
  color: var(--link-color, #007bff);
  text-decoration: none;
  font-weight: bold;
  padding: 8px 16px;
  background: var(--bg-color, white);
  border-radius: 20px;
  border: 2px solid var(--link-color, #007bff);
  display: inline-block;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.no-posts a:hover {
  background: var(--link-color, #007bff);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* CSS Variables for Light Theme */
:root {
  --bg-color: #ffffff;
  --header-bg: #f8f9fa;
  --text-color: #495057;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --border-light: #f1f3f4;
  --hover-bg: #f8f9fa;
  --input-bg: #ffffff;
  --link-color: #007bff;
  --header-text: #495057;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-color: #2d3748;
  --header-bg: #4a5568;
  --text-color: #e2e8f0;
  --text-muted: #a0aec0;
  --border-color: #4a5568;
  --border-light: #4a5568;
  --hover-bg: #4a5568;
  --input-bg: #4a5568;
  --link-color: #63b3ed;
  --header-text: #e2e8f0;
}

/* 다크 테마 추가 */
[data-theme="dark"] .reply-title {
  color: var(--text-muted, #a0aec0) !important;
}

[data-theme="dark"] .reply-title:hover {
  color: var(--link-color, #63b3ed) !important;
}

[data-theme="dark"] .post-title[style*="padding-left"] {
  background: linear-gradient(90deg, var(--hover-bg, #4a5568) 0%, transparent 100%);
  border-left-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .post-title[style*="padding-left"]:before {
  background: var(--border-color, #4a5568);
}

[data-theme="dark"] .restricted-title {
  color: var(--text-muted, #a0aec0);
}

[data-theme="dark"] .privacy-notice {
  color: #fc8181;
  background: rgba(252, 129, 129, 0.15);
}

[data-theme="dark"] .status-badge.waiting {
  background: linear-gradient(135deg, #d69e2e, #b7791f);
  color: #1a202c;
}

[data-theme="dark"] .qna-badge {
  box-shadow: 0 2px 4px rgba(99, 179, 237, 0.3);
}

[data-theme="dark"] .admin-badge {
  box-shadow: 0 1px 3px rgba(252, 129, 129, 0.4);
}

[data-theme="dark"] .notice-badge {
  box-shadow: 0 2px 4px rgba(252, 129, 129, 0.3) !important;
}

[data-theme="dark"] .no-posts {
  background: var(--hover-bg, #4a5568);
}

[data-theme="dark"] .no-posts a {
  background: var(--bg-color, #2d3748);
  border-color: var(--link-color, #63b3ed);
}

[data-theme="dark"] .no-posts a:hover {
  background: var(--link-color, #63b3ed);
  color: #1a202c;
  box-shadow: 0 4px 12px rgba(99, 179, 237, 0.3);
}

[data-theme="dark"] .board-table tbody tr:hover {
  background: var(--hover-bg, #4a5568);
  box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}

/* Dark Mode Specific Overrides */
[data-theme="dark"] .dropdown-content {
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.4);
}

[data-theme="dark"] .board-container,
[data-theme="dark"] .post-container,
[data-theme="dark"] .comments-section {
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

[data-theme="dark"] .community-header {
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

[data-theme="dark"] .alert-success {
  color: #68d391;
  background-color: #276749;
  border-color: #38a169;
}

[data-theme="dark"] .alert-danger {
  color: #fc8181;
  background-color: #742a2a;
  border-color: #e53e3e;
}

[data-theme="dark"] .alert-info {
  color: #63b3ed;
  background-color: #2a4365;
  border-color: #3182ce;
}

/* 모바일 반응형 개선 - 테이블 헤더 유지 */
@media (max-width: 768px) {
  .community-container {
    padding: 10px;
  }

  .community-header {
    padding: 15px;
  }

  .community-header h1 {
    font-size: 1.5rem;
  }

  .board-header {
    flex-direction: column;
    align-items: stretch;
  }

  .board-actions {
    justify-content: center;
  }

  /* 모바일 테이블 개선 - 헤더는 유지 */
  .board-table {
    display: table !important;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;
  }

  /* 헤더는 그대로 표시 */
  .board-table thead {
    display: table-header-group !important;
  }

  .board-table thead th {
    font-size: 0.75rem;
    padding: 8px 4px;
    text-align: center;
  }

  /* QnA가 아닌 경우 상태 컬럼 숨김 */
  .board-table thead th:nth-child(3):not(.qna-status),
  .board-table tbody td:nth-child(3):empty {
    display: none;
  }

  .board-table tbody {
    display: table-row-group;
    width: 100%;
  }

  .board-table tbody tr {
    display: table-row;
    width: 100%;
  }

  .board-table td {
    display: table-cell;
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
    font-size: 0.75rem;
  }

  /* 번호 컬럼 */
  .board-table td:nth-child(1) {
    width: 40px;
    text-align: center;
  }

  /* 제목 컬럼 - 좌측 정렬, 텍스트 줄임 */
  .board-table td:nth-child(2) {
    text-align: left !important;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-table td:nth-child(2) .post-title-link {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  /* QnA 상태 컬럼 */
  .board-table td:nth-child(3) {
    width: 60px;
    font-size: 0.7rem;
  }

  /* 작성자 컬럼 */
  .board-table td:nth-child(4) {
    width: 60px;
    font-size: 0.7rem;
  }

  /* 작성일 컬럼 - 짧게 표시 */
  .board-table td:nth-child(5) {
    width: 50px;
    font-size: 0.7rem;
  }

  /* 조회수 컬럼 */
  .board-table td:nth-child(6) {
    width: 40px;
    font-size: 0.7rem;
  }

  /* 답글 들여쓰기 모바일에서 제거 */
  .board-table .post-title[style*="padding-left"] {
    padding-left: 4px !important;
    background: none !important;
    border-left: none !important;
  }

  .board-table .post-title[style*="padding-left"]:before {
    display: none !important;
  }

  /* 모바일용 메타 정보 숨김 */
  .mobile-meta {
    display: none !important;
  }

  /* 모바일 검색폼 개선 */
  .search-container {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-container select {
    width: 100%;
    margin-bottom: 8px;
    min-width: auto;
  }

  .search-container input[type="text"] {
    width: 100%;
    margin-bottom: 8px;
    min-width: auto;
  }

  .search-container button {
    width: 100%;
  }

  .search-group {
    min-width: auto;
  }

  .post-actions {
    flex-direction: column;
  }

  .reply-item {
    margin-left: 15px;
  }

  .search-form {
    flex-direction: column;
  }

  .reply-indicator {
    color: var(--text-muted, #6c757d);
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 8px;
  }

  /* 배지들 크기 조정 */
  .notice-badge, .status-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
  }

  .reply-count {
    font-size: 0.7rem;
  }

  .attachment-icon {
    font-size: 0.8rem;
  }
}

/* Editor Styles */
.editor-container {
  padding: 20px;
  margin-bottom: 15px;
}

.editor-container label {
  display: block;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-color, #495057);
}

/* Summernote 커스터마이징 */
.note-editor {
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 4px;
}

.note-toolbar {
  background: var(--header-bg, #f8f9fa);
  border-bottom: 1px solid var(--border-color, #dee2e6);
}

.note-editable {
  background: var(--bg-color, white);
  color: var(--text-color, #495057);
  line-height: 1.6;
}

.note-editable.dragover {
  border: 2px dashed #007bff;
  background-color: rgba(0, 123, 255, 0.1);
}

/* 다크모드 Summernote */
[data-theme="dark"] .note-editor {
  background: var(--bg-color, #2d3748);
}

[data-theme="dark"] .note-toolbar {
  background: var(--header-bg, #4a5568);
  border-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .note-editable {
  background: var(--bg-color, #2d3748);
  color: var(--text-color, #e2e8f0);
}

[data-theme="dark"] .note-btn {
  color: var(--text-color, #e2e8f0);
}

[data-theme="dark"] .note-dropdown-menu {
  background: var(--bg-color, #2d3748);
  border-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .note-dropdown-item {
  color: var(--text-color, #e2e8f0);
}

/* File Upload */
.file-upload {
  padding: 20px;
  background: var(--header-bg, #f8f9fa);
  border-top: 1px solid var(--border-color, #dee2e6);
  margin-bottom: 15px;
}

.file-upload input[type="file"] {
  display: none;
}

.file-upload-label {
  display: inline-block;
  padding: 8px 16px;
  background: #6c757d;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.875rem;
  margin-bottom: 10px;
}

.file-upload-label:hover {
  background: #545b62;
}

.file-list {
  margin-top: 10px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light, #eee);
}

.file-item:last-child {
  border-bottom: none;
}

.file-item .btn-sm {
  padding: 2px 8px;
  font-size: 0.75rem;
}

/* Bootstrap 다크 테마 강제 적용 */
[data-theme="dark"] .form-control {
  background-color: #2d3748 !important;
  color: #e2e8f0 !important;
  border: 2px solid #4a5568 !important;
  border-radius: 6px;
}
[data-theme="dark"] .form-control:focus {
  background-color: #2d3748 !important;
  color: #f7fafc !important;
  border-color: #63b3ed !important;
  box-shadow: 0 0 0 3px rgba(99, 179, 237, 0.2) !important;
  outline: none;
}
[data-theme="dark"] .form-control::placeholder {
  color: #a0aec0 !important;
  opacity: 0.8;
}
[data-theme="dark"] select.form-control {
  background-color: #2d3748 !important;
}
[data-theme="dark"] textarea.form-control {
  resize: vertical;
  min-height: 100px;
}
[data-theme="dark"] .btn-primary {
  background-color: #007bff !important;
  border-color: #007bff !important;
  color: white !important;
}

[data-theme="dark"] .btn-secondary {
  background-color: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
}

[data-theme="dark"] .community-container {
  background-color: #1a202c !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .board-container {
  background-color: #2d3748 !important;
  color: #e2e8f0 !important;
}

/* Summernote 버튼 그룹 다크 테마 */
[data-theme="dark"] .note-btn-group,
[data-theme="dark"] .btn-group {
  background-color: #4a5568 !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .note-btn-group .note-btn,
[data-theme="dark"] .btn-group .btn {
  background-color: #4a5568 !important;
  color: #e2e8f0 !important;
  border-color: #4a5568 !important;
}

[data-theme="dark"] .note-btn-group .note-btn:hover,
[data-theme="dark"] .btn-group .btn:hover {
  background-color: #2d3748 !important;
  color: #f7fafc !important;
}

[data-theme="dark"] .note-btn-group .note-btn.active,
[data-theme="dark"] .btn-group .btn.active {
  background-color: #007bff !important;
  color: white !important;
}

/* Summernote 드롭다운 버튼 */
[data-theme="dark"] .note-btn-group .dropdown-toggle::after,
[data-theme="dark"] .btn-group .dropdown-toggle::after {
  border-top-color: #e2e8f0 !important;
}

/* 첨부파일 업로드 스타일 추가/수정 */
.attachments-section {
  padding: 20px;
  background: var(--header-bg, #f8f9fa);
  border-top: 1px solid var(--border-color, #dee2e6);
  margin-top: 0;
}

.attachments-section h4 {
  margin: 0 0 15px 0;
  color: var(--text-color, #495057);
  font-size: 1rem;
  font-weight: 600;
}

.attachment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.attachment-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light, #f1f3f4);
}

.attachment-list li:last-child {
  border-bottom: none;
}

.attachment-list a {
  color: var(--link-color, #007bff);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-list a:hover {
  text-decoration: underline;
}

.file-size, .download-count {
  color: var(--text-muted, #6c757d);
  font-size: 0.875rem;
  margin-left: auto;
}

/* 다크 테마 */
[data-theme="dark"] .attachments-section {
  background: var(--hover-bg, #4a5568);
}

/* 모바일 전용 게시판 스타일 */
.mobile-board-list {
  padding: 0;
  margin: 0;
}

.mobile-post-item {
  background: var(--bg-color, white);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 8px;
  margin-bottom: 10px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s ease;
}

.mobile-post-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.mobile-post-item.reply-item {
  margin-left: 20px;
  border-left: 3px solid var(--border-color, #dee2e6);
  background: var(--hover-bg, #f8f9fa);
}

.mobile-post-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.post-number {
  background: var(--text-muted, #6c757d);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}

.mobile-post-title {
  flex: 1;
  color: var(--text-color, #495057);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
  font-size: 0.9rem;
}

.mobile-post-title:hover {
  color: var(--link-color, #007bff);
}

.mobile-post-title.restricted {
  color: var(--text-muted, #6c757d);
  font-style: italic;
}

.mobile-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted, #6c757d);
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light, #f1f3f4);
}

.mobile-post-meta .author-info {
  font-weight: 500;
}

.mobile-post-meta .date-info {
  flex: 1;
  text-align: center;
}

.mobile-post-meta .view-info {
  text-align: right;
}

/* 다크 테마 지원 */
[data-theme="dark"] .mobile-post-item {
  background: var(--bg-color, #2d3748);
  border-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .mobile-post-item.reply-item {
  background: var(--hover-bg, #4a5568);
  border-left-color: var(--border-color, #4a5568);
}

[data-theme="dark"] .post-number {
  background: var(--text-muted, #a0aec0);
  color: #1a202c;
}


/* 기존 community.css 파일 끝에 추가할 스타일들 */

/* ===== 순위 계산기 전용 스타일 ===== */

/* 계산기 섹션 */
.calculator-section {
  padding: 25px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 15px;
  align-items: end;
  margin-bottom: 20px;
}

/* 금속 선택 버튼 */
.metal-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.metal-btn {
  padding: 10px 20px;
  border: 2px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  font-size: 0.875rem;
}

.metal-btn.active {
  background: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

.metal-btn:hover {
  background: var(--hover-bg);
}

.metal-btn.active:hover {
  background: #0056b3;
}

/* 결과 섹션 */
.results-section {
  background: var(--header-bg);
  padding: 25px;
  border-top: 1px solid var(--border-color);
  display: none;
}

.results-section.show {
  display: block;
}

/* 순위 카드 그리드 */
.ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.ranking-card {
  background: var(--bg-color);
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ranking-card h3 {
  margin-bottom: 15px;
  font-size: 1.2em;
  color: var(--text-color);
}

.rank-display {
  font-size: 2em;
  font-weight: bold;
  color: var(--link-color);
  margin-bottom: 10px;
}

.percentile {
  color: var(--text-muted);
  font-size: 0.9em;
}

/* 데이터 섹션 */
.data-section {
  background: var(--header-bg);
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.data-label {
  font-weight: 500;
  color: var(--text-muted);
}

.data-value {
  font-weight: 700;
  color: var(--text-color);
  font-size: 1.1em;
}

/* 예시 섹션 */
.examples-section {
  padding: 25px;
}

.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 15px;
}

.example-item {
  background: var(--hover-bg);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.example-amount {
  font-weight: bold;
  color: var(--link-color);
  margin-bottom: 8px;
  font-size: 1.1em;
}

.example-ranks {
  font-size: 0.9em;
  color: var(--text-color);
}

.example-ranks div {
  margin-bottom: 4px;
}

/* 테마 토글 버튼 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px;
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
}

.theme-toggle:hover {
  background: var(--hover-bg);
}

/* 다크 테마 적용 */
[data-theme="dark"] .metal-btn {
  background: var(--bg-color);
  color: var(--text-color);
  border-color: var(--border-color);
}

[data-theme="dark"] .metal-btn.active {
  background: var(--link-color);
  border-color: var(--link-color);
  color: #1a202c;
}

[data-theme="dark"] .metal-btn:hover {
  background: var(--hover-bg);
}

[data-theme="dark"] .metal-btn.active:hover {
  background: #4299e1;
}

[data-theme="dark"] .rank-display {
  color: var(--link-color);
}

[data-theme="dark"] .example-amount {
  color: var(--link-color);
}

[data-theme="dark"] .ranking-card {
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

[data-theme="dark"] .data-item {
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle {
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* 모바일 반응형 */
@media (max-width: 768px) {
  .input-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .metal-selector {
    flex-direction: column;
  }

  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .examples-grid {
    grid-template-columns: 1fr;
  }

  .calculator-section {
    padding: 15px;
  }

  .results-section {
    padding: 15px;
  }

  .examples-section {
    padding: 15px;
  }

  .theme-toggle {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    font-size: 1em;
  }
}

/* 순위 계산기 입력 폼 전용 폰트 크기 */
.calculator-section .form-control {
  font-size: 1.6em; /* 기존 1.1em의 2배 */
}

.calculator-section .btn {
  font-size: 1.6em; /* 기존 1.1em의 2배 */
}

/* 모바일에서도 큰 크기 유지 */
@media (max-width: 768px) {
  .calculator-section .form-control {
    font-size: 1.5em; /* 기존 1em의 2배 */
  }

  .calculator-section .btn {
    font-size: 1.5em; /* 기존 1em의 2배 */
  }
}