/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕", helvetica, "Apple SD Gothic Neo",
    sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

.container-fluid {
  padding: 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* Sidebar Styles */
.sidebar {
  background-color: #fff;
  border-right: 1px solid #e9ecef;
  min-height: 100vh;
  padding: 20px 0;
}

.sidebar-menu {
  padding: 0 20px;
}

.menu-title {
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}

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

.menu-item {
  margin-bottom: 5px;
}

.menu-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.menu-link:hover {
  background-color: #f8f9fa;
  color: #333;
}

.menu-item.active .menu-link {
  background-color: #007bff;
  color: white;
  font-weight: 600;
}

.menu-link i {
  font-size: 12px;
  opacity: 0.7;
}

/* Main Content Styles */
.main-content {
  background-color: #fff;
  min-height: 100vh;
  padding: 30px;
}

.page-header {
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin: 0;
}

/* Notice Section */
.notice-section {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.notice-content {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.notice-icon {
  color: #007bff;
  font-size: 20px;
  margin-top: 2px;
}

.notice-text {
  flex: 1;
}

.notice-text p {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
}

.notice-text p:last-child {
  margin-bottom: 0;
}

/* Search Section */
.search-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 20px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.search-form {
  flex: 1;
}

.search-options {
  margin-bottom: 15px;
}

.form-check-inline {
  margin-right: 20px;
}

.form-check-label {
  font-size: 14px;
  color: #666;
  cursor: pointer;
}

.search-input-group {
  display: flex;
  gap: 10px;
  max-width: 400px;
}

.search-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
}

.search-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.qna-search {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.qna-search:hover {
  background-color: #5a6268;
}

.write-button-container {
  margin-left: 20px;
}

.qna-write {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.qna-write:hover {
  background-color: #0056b3;
}

/* Board Table */
.board-section {
  margin-bottom: 30px;
}

.board-table {
  margin: 0;
  border-collapse: collapse;
  background-color: white;
}

.board-table thead th {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 12px 8px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.board-table tbody td {
  border: 1px solid #dee2e6;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  color: #666;
  vertical-align: middle;
}

.col-number {
  width: 60px;
}

.col-title {
  width: auto;
  min-width: 300px;
}

.col-author {
  width: 100px;
}

.col-date {
  width: 100px;
}

.col-views {
  width: 60px;
}

.col-attach {
  width: 60px;
}

.col-answer {
  width: 80px;
}

.title-cell {
  text-align: left !important;
  padding-left: 15px !important;
}

.title-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.title-link:hover {
  color: #007bff;
  text-decoration: underline;
}

.long-title {
  display: block;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-masked {
  font-family: monospace;
  color: #666;
}

.attach-icon {
  color: #28a745;
  font-size: 14px;
}

.answer-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.answer-waiting {
  background-color: #ffeaa7;
  color: #d63031;
}

.answer-completed {
  background-color: #d1ecf1;
  color: #0c5460;
}

.views-count {
  font-weight: 600;
  color: #495057;
}

/* Pagination */
.pagination-section {
  margin-top: 40px;
}

.pagination {
  margin: 0;
}

.pagination .page-link {
  color: #666;
  border: 1px solid #dee2e6;
  padding: 8px 12px;
  font-size: 14px;
  text-decoration: none;
}

.pagination .page-link:hover {
  background-color: #e9ecef;
  border-color: #dee2e6;
  color: #333;
}

.pagination .page-item.active .page-link {
  background-color: #007bff;
  border-color: #007bff;
  color: white;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #fff;
  border-color: #dee2e6;
}

/* Modal Styles */
.modal-content {
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-radius: 8px 8px 0 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.modal-body {
  padding: 30px;
}

.post-detail-content {
  line-height: 1.6;
}

.post-detail-header {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.post-detail-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
}

.post-detail-meta {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: #666;
}

.post-detail-body {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  min-height: 200px;
}

.form-label {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.required {
  color: #dc3545;
}

.form-control {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
}

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

.form-text {
  font-size: 12px;
  color: #6c757d;
  margin-top: 5px;
}

/* Post Detail Styles */
.question-section,
.answer-section {
  margin-bottom: 30px;
  padding: 20px;
  border-radius: 8px;
}

.question-section {
  background-color: #f8f9fa;
  border-left: 4px solid #007bff;
}

.answer-section {
  background-color: #e8f5e8;
  border-left: 4px solid #28a745;
}

.section-label {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.question-content,
.answer-content {
  font-size: 14px;
  line-height: 1.8;
  color: #333;
  white-space: pre-wrap;
}

.answer-meta {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: #666;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d4edda;
}

.answer-content {
  background-color: white;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #d4edda;
}

/* Answer status styling in table */
.answer-completed {
  background-color: #d1ecf1;
  color: #0c5460;
  font-weight: 600;
}

.answer-waiting {
  background-color: #fff3cd;
  color: #856404;
  font-weight: 600;
}

/* Answered post styling */
.board-table tbody tr.answered-post {
  background-color: #f8fff8;
}

.board-table tbody tr.answered-post:hover {
  background-color: #e8f5e8;
}

.answered-title {
  color: #28a745;
  font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container-fluid {
    padding: 0;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .main-content {
    padding: 20px 15px;
  }

  .search-section {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }

  .write-button-container {
    margin-left: 0;
    text-align: right;
  }

  .search-input-group {
    max-width: none;
  }

  .board-table {
    font-size: 12px;
  }

  .board-table thead th,
  .board-table tbody td {
    padding: 8px 4px;
  }

  .col-title {
    min-width: 200px;
  }

  .long-title {
    max-width: 200px;
  }

  .modal-body {
    padding: 20px;
  }
}

@media (max-width: 576px) {
  .page-title {
    font-size: 20px;
  }

  .notice-content {
    flex-direction: column;
    gap: 10px;
  }

  .search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .form-check-inline {
    margin-right: 0;
  }

  .board-table {
    font-size: 11px;
  }

  .col-title {
    min-width: 150px;
  }

  .long-title {
    max-width: 150px;
  }

  .post-detail-meta {
    flex-direction: column;
    gap: 5px;
  }
}

/* Animation Effects */
.board-table tbody tr {
  transition: background-color 0.2s ease;
}

.board-table tbody tr:hover {
  background-color: #f8f9fa;
}

.menu-link {
  transition: all 0.2s ease;
}

.qna-search,
.qna-write {
  transition: all 0.2s ease;
}

.qna-search:active,
.qna-write:active {
  transform: translateY(1px);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
}

/* Focus States */
.form-control:focus,
.btn:focus {
  outline: none;
}

.menu-link:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .sidebar,
  .search-section,
  .write-button-container,
  .pagination-section {
    display: none;
  }

  .main-content {
    padding: 0;
  }

  .board-table {
    border-collapse: collapse;
  }

  .board-table th,
  .board-table td {
    border: 1px solid #000;
    padding: 8px;
  }
}
