/* content_sample.css - 도서 목록 페이지 스타일 */

/* 전체 페이지 컨테이너 */
/* 헤더에 영향을 주지 않도록 본문 영역에만 적용 */
.sub-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* 헤더 내부의 .sub-inner는 제외 (혹시 모를 충돌 방지) */
#header-wrap .sub-inner,
#header .sub-inner {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* 상단 정보 그룹 */
.top-info-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f8f8;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

/* 총권수 표시 */
.total-books {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.total-label {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.total-number {
  font-size: 24px;
  font-weight: 700;
  color: #000;
}

.total-unit {
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

/* 검색 UI - 본문 전용 (헤더 제외) */
/* 헤더의 .search-container와 충돌 방지 */
.sub-inner .search-container,
.top-info-group .search-container {
  flex: 1;
  max-width: 500px;
}

/* 헤더의 .search-container는 원래 스타일 유지 */
#header-wrap .search-container,
#header .search-container {
  flex: none !important;
  max-width: none !important;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.search-options {
  flex-shrink: 0;
}

.search-select {
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.search-select:hover {
  border-color: #333;
}

.search-select:focus {
  outline: none;
  border-color: #333;
  box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.search-input-group {
  display: flex;
  flex: 1;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 10px 15px;
  font-size: 14px;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #333;
  box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.1);
}

.search-input::placeholder {
  color: #999;
}

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #333;
  border: 1px solid #333;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-btn:hover {
  background: #555;
  border-color: #555;
  transform: translateY(-1px);
}

.search-btn:active {
  transform: translateY(0);
}

.search-icon {
  font-size: 16px;
}

.search-text {
  font-size: 14px;
}

/* 리스트 타입 스위처 */
.list-type-switcher {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}

.btn-list-type {
  background: #fff;
  color: #333;
  border: 2px solid #ddd;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-list-type:hover {
  border-color: #333;
  background: #f8f8f8;
}

.btn-list-type.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

.btn-list-type .icon {
  font-size: 18px;
}

/* 리스트 타입 1 (카드형) 스타일 */
.list01 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.book-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.book-cover {
  text-align: center;
  margin-bottom: 20px;
}

.book-image {
  width: 200px;
  height: 280px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.book-image-link {
  display: block;
  transition: transform 0.3s ease;
}

.book-image-link:hover {
  transform: scale(1.05);
}

.book-info {
  text-align: center;
}

.book-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #000;
  text-align: center;
  line-height: 1.3;
}

.book-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.book-title-link:hover {
  color: #073d38;
}

.book-author {
  font-size: 14px;
  color: #666;
  margin: 0 0 6px 0;
  text-align: center;
}

.book-price {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  margin: 0 0 6px 0;
  text-align: center;
}

.book-date {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px 0;
  text-align: center;
}

.book-materials-card {
  text-align: center;
  margin: 8px 0;
}

.btn-ppt-card {
  background: #333;
  color: #fff;
  border: 1px solid #333;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 500;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ppt-card:hover {
  background: #555;
  border-color: #555;
}

.book-summary {
  margin-top: 12px;
}

.book-summary p {
  font-size: 12px;
  line-height: 1.5;
  color: #333;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 리스트 타입 2 (테이블형) 스타일 */
.list02 {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
}

.book-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #fff;
  border: none;
  table-layout: fixed; /* 컬럼 크기 고정을 위해 추가 */
}

.book-table th {
  background: #f5f5f5;
  color: #333;
  padding: 12px 8px;
  text-align: center;
  font-weight: 600;
  border-bottom: 2px solid #ddd;
  border-left: none;
  border-right: none;
  border-top: none;
  font-size: 13px;
}

.book-table td {
  padding: 12px 8px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  border-left: none;
  border-right: none;
  border-top: none;
  vertical-align: middle;
  font-size: 12px;
}

/* 테이블 컬럼 크기 최적화 */
.book-table th:nth-child(1),
.book-table td:nth-child(1) {
  /* 도서 이미지 */
  width: 80px;
  min-width: 80px;
  max-width: 80px;
}

.book-table th:nth-child(2),
.book-table td:nth-child(2) {
  /* 도서명 */
  width: 200px;
  min-width: 180px;
}

.book-table th:nth-child(3),
.book-table td:nth-child(3) {
  /* 저자 - 크기 축소 */
  width: 100px;
  min-width: 80px;
  max-width: 120px;
}

.book-table th:nth-child(4),
.book-table td:nth-child(4) {
  /* ISBN */
  width: 150px;
  min-width: 130px;
}

.book-table th:nth-child(5),
.book-table td:nth-child(5) {
  /* PPT */
  width: 60px;
  min-width: 60px;
  max-width: 60px;
}

.book-table th:nth-child(6),
.book-table td:nth-child(6) {
  /* 가격 */
  width: 100px;
  min-width: 90px;
}

.book-table th:nth-child(7),
.book-table td:nth-child(7) {
  /* 발행일 */
  width: 100px;
  min-width: 90px;
}

.book-table th:nth-child(8),
.book-table td:nth-child(8) {
  /* 도서소개 - 크기 확대 */
  width: auto;
  min-width: 300px;
}

.book-table tr:nth-child(even) {
  background: none;
}

.book-table tr:hover {
  background: #f5f5f5;
}

.book-table tr:hover td {
  background: #f5f5f5;
}

.book-title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  text-align: center;
  line-height: 1.3;
  /* width: 200px; */
}

.book-title .book-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.book-title .book-title-link:hover {
  color: #073d38;
}

.book-author {
  font-size: 13px;
  color: #333;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.book-price {
  font-size: 14px;
  font-weight: 600;
  color: #000;
  text-align: center;
  /* width: 120px; */
}

.book-date {
  font-size: 13px;
  color: #333;
  text-align: center;
  /* width: 120px; */
}

.book-summary {
  margin-top: 0;
  width: 100%;
  min-width: 300px;
  text-align: left;
  padding: 0 5px;
}

/* 모바일에서 .book-summary width 100% */
@media (max-width: 768px) {
  .book-summary {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.summary-text {
  line-height: 1.5;
  padding: 0;
  font-size: 13px;
  color: #333;
  text-align: left;
  word-break: keep-all;
  word-wrap: break-word;
  background: none;
  border: none;
  box-shadow: none;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 테이블형에서 summary-text의 max-width 제거 */
.book-table .summary-text {
  max-width: none;
}

/* 도서소개 링크 스타일 */
.summary-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.summary-link:hover {
  color: #073d38;
}

.summary-link:hover .summary-text {
  color: #073d38;
}

/* 카드형 도서소개 링크 */
.book-summary .summary-link {
  display: block;
}

.book-summary .summary-link p {
  color: inherit;
  transition: color 0.3s ease;
}

.book-summary .summary-link:hover p {
  color: #073d38;
}

.book-materials {
  text-align: center;
  width: 80px;
}

.btn-ppt {
  background: #333;
  color: #fff;
  border: 1px solid #333;
  padding: 3px 6px;
  font-size: 9px;
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 30px;
}

.btn-ppt:hover {
  background: #555;
  border-color: #555;
}

.book-image-cell {
  text-align: center;
  width: 80px;
  padding: 8px;
}

.table-book-image {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-table tr:hover .table-book-image {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.book-image-link {
  display: block;
  transition: transform 0.3s ease;
}

.book-image-link:hover {
  transform: scale(1.05);
}

/* 페이지 구분 디자인 */
.pagination-container {
  margin-top: 40px;
  text-align: center;
}

.pagination {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-prev,
.btn-next {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-prev:hover,
.btn-next:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.page-numbers {
  display: flex;
  gap: 4px;
}

.btn-page {
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 40px;
}

.btn-page:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.btn-page.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
  .list01 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
  }

  .book-image {
    width: 180px;
    height: 252px;
  }
}

@media (max-width: 768px) {
  .sub-inner {
    padding: 15px;
  }

  /* 상단 정보 그룹 반응형 */
  .top-info-group {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    margin-bottom: 20px;
    align-items: stretch;
  }

  .total-books {
    order: 1;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
  }

  .total-label {
    font-size: 15px;
  }

  .total-number {
    font-size: 22px;
  }

  .total-unit {
    font-size: 15px;
  }

  .sub-inner .search-container,
  .top-info-group .search-container {
    order: 2;
    max-width: 100%;
    width: 100%;
  }

  .list-type-switcher {
    order: 3;
    justify-content: center;
    width: 100%;
    gap: 10px;
  }

  /* 검색 UI 반응형 */
  .search-form {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .search-options {
    width: 100%;
  }

  .search-select {
    width: 100%;
    text-align: left;
    padding: 12px 15px;
    font-size: 14px;
  }

  .search-input-group {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .search-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 14px;
  }

  .search-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    justify-content: center;
  }

  .clear-search-btn {
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
  }

  .list-type-switcher {
    flex-direction: row;
    gap: 10px;
    margin-bottom: 0;
    justify-content: center;
  }

  .btn-list-type {
    padding: 12px 20px;
    font-size: 14px;
    flex: 1;
    max-width: 150px;
  }

  .list01 {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .book-image {
    width: 160px;
    height: 224px;
  }

  .book-title {
    font-size: 18px;
  }

  .book-author,
  .book-price,
  .book-date {
    font-size: 13px;
  }

  .book-summary p {
    font-size: 11px;
  }

  /* 모바일 테이블형 리스트 높이 최적화 */
  .book-table {
    font-size: 11px;
    table-layout: fixed;
  }
  .book-table th {
    padding: 8px 4px;
    font-size: 11px;
  }
  .book-table td {
    padding: 8px 4px;
    font-size: 11px;
    vertical-align: top;
  }
  /* 모바일 컬럼 크기 최적화 */
  .book-table th:nth-child(1),
  .book-table td:nth-child(1) {
    /* 도서 이미지 */
    width: 50px;
    min-width: 50px;
    max-width: 50px;
  }
  .book-table th:nth-child(2),
  .book-table td:nth-child(2) {
    /* 도서명 */
    width: 120px;
    min-width: 100px;
  }
  .book-table th:nth-child(3),
  .book-table td:nth-child(3) {
    /* 저자 - 모바일에서 더 작게 */
    width: 70px;
    min-width: 60px;
    max-width: 80px;
  }
  .book-table th:nth-child(4),
  .book-table td:nth-child(4) {
    /* ISBN */
    width: 100px;
    min-width: 90px;
  }
  .book-table th:nth-child(5),
  .book-table td:nth-child(5) {
    /* PPT */
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }
  .book-table th:nth-child(6),
  .book-table td:nth-child(6) {
    /* 가격 */
    width: 70px;
    min-width: 60px;
  }
  .book-table th:nth-child(7),
  .book-table td:nth-child(7) {
    /* 발행일 */
    width: 80px;
    min-width: 70px;
  }
  .book-table th:nth-child(8),
  .book-table td:nth-child(8) {
    /* 도서소개 - 모바일에서도 충분한 공간 확보 */
    width: auto;
    min-width: 200px;
  }
  .book-table .book-image-cell {
    width: 50px;
    padding: 4px;
  }
  .table-book-image {
    width: 40px;
    height: 55px;
  }
  .book-table .book-title {
    font-size: 12px;
    line-height: 1.3;
  }
  .book-table .book-author {
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .book-table .book-isbn,
  .book-table .book-price,
  .book-table .book-date {
    font-size: 10px;
    line-height: 1.3;
  }
  .book-table .book-summary {
    width: 100%;
    max-width: 100%;
    padding: 0 3px;
  }
  .book-table .summary-text {
    font-size: 10px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }

  .btn-prev,
  .btn-next {
    padding: 6px 12px;
    font-size: 13px;
  }

  .btn-page {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 35px;
  }
}

@media (max-width: 480px) {
  .sub-inner {
    padding: 10px;
  }

  /* 상단 정보 그룹 반응형 - 작은 모바일 */
  .top-info-group {
    padding: 12px;
    gap: 12px;
    margin-bottom: 15px;
  }

  .total-books {
    gap: 5px;
    padding: 8px 0;
  }

  .total-label {
    font-size: 13px;
  }

  .total-number {
    font-size: 18px;
  }

  .total-unit {
    font-size: 13px;
  }

  .sub-inner .search-container,
  .top-info-group .search-container {
    margin-bottom: 0;
  }

  .search-form {
    gap: 8px;
  }

  .search-select {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .clear-search-btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  .list-type-switcher {
    margin-bottom: 0;
    gap: 8px;
  }

  .btn-list-type {
    padding: 10px 16px;
    font-size: 13px;
    max-width: 120px;
  }

  .book-item {
    padding: 15px;
  }

  .book-image {
    width: 140px;
    height: 196px;
  }

  .book-title {
    font-size: 16px;
  }

  .book-author,
  .book-price,
  .book-date {
    font-size: 12px;
  }

  .book-summary p {
    font-size: 10px;
  }

  /* 작은 모바일 테이블형 리스트 높이 최적화 */
  .book-table {
    table-layout: fixed;
  }
  .book-table th {
    padding: 6px 3px;
    font-size: 9px;
  }
  .book-table td {
    padding: 6px 3px;
    font-size: 9px;
  }
  /* 작은 모바일 컬럼 크기 최적화 */
  .book-table th:nth-child(1),
  .book-table td:nth-child(1) {
    /* 도서 이미지 */
    width: 40px;
    min-width: 40px;
    max-width: 40px;
  }
  .book-table th:nth-child(2),
  .book-table td:nth-child(2) {
    /* 도서명 */
    width: 100px;
    min-width: 80px;
  }
  .book-table th:nth-child(3),
  .book-table td:nth-child(3) {
    /* 저자 - 작은 모바일에서 더 작게 */
    width: 60px;
    min-width: 50px;
    max-width: 70px;
  }
  .book-table th:nth-child(4),
  .book-table td:nth-child(4) {
    /* ISBN */
    width: 90px;
    min-width: 80px;
  }
  .book-table th:nth-child(5),
  .book-table td:nth-child(5) {
    /* PPT */
    width: 35px;
    min-width: 35px;
    max-width: 35px;
  }
  .book-table th:nth-child(6),
  .book-table td:nth-child(6) {
    /* 가격 */
    width: 60px;
    min-width: 50px;
  }
  .book-table th:nth-child(7),
  .book-table td:nth-child(7) {
    /* 발행일 */
    width: 70px;
    min-width: 60px;
  }
  .book-table th:nth-child(8),
  .book-table td:nth-child(8) {
    /* 도서소개 - 작은 모바일에서도 최소 공간 확보 */
    width: auto;
    min-width: 150px;
  }
  .book-table .book-image-cell {
    width: 40px;
    padding: 3px;
  }
  .table-book-image {
    width: 35px;
    height: 48px;
  }
  .book-table .book-title {
    font-size: 10px;
    line-height: 1.2;
  }
  .book-table .book-author {
    font-size: 9px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .book-table .book-isbn,
  .book-table .book-price,
  .book-table .book-date {
    font-size: 9px;
    line-height: 1.2;
  }
  .book-table .summary-text {
    font-size: 9px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }

  .pagination {
    gap: 6px;
  }

  .btn-prev,
  .btn-next {
    padding: 5px 10px;
    font-size: 12px;
  }

  .btn-page {
    padding: 5px 8px;
    font-size: 12px;
    min-width: 30px;
  }
}
