/* 도서 상세 페이지 스타일 */

/* 기본 레이아웃 */
.book-detail-header {
  background: #fff;
  padding: 60px 0;
  border-bottom: 1px solid #eee;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.book-info-wrapper {
  display: flex;
  gap: 50px;
  align-items: flex-start;
  justify-content: center;
  max-width: 1000px;
  margin: 0 auto;
}

/* 도서 표지 */
.book-cover {
  flex-shrink: 0;
  width: 400px;
}

.cover-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 도서 정보 */
.book-info {
  flex: 1;
  width: 100%;
}

.book-title-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.book-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  line-height: 1.2;
}

.book-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin: 0 0 30px 0;
  font-weight: 400;
}

.book-meta {
  margin-bottom: 30px;
}

.meta-item {
  display: flex;
  margin-bottom: 15px;
  align-items: center;
}

.meta-item .label {
  width: 110px;
  font-weight: 600;
  color: #555;
  flex-shrink: 0;
  font-size: 15px;
}

.meta-item .value {
  color: #333;
  font-size: 15px;
}

.meta-item .price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #073d38;
}

.book-tags {
  margin-bottom: 30px;
}

.tag {
  display: inline-block;
  background: #f5f5f5;
  color: #666;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
  margin-right: 10px;
  margin-bottom: 8px;
}

.book-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}


.btn-download,
.btn-purchase {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-download {
  background: #f8f9fa;
  color: #666;
  border: 1px solid #ddd;
}

.btn-download:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.btn-purchase {
  background: #6d1141;
  color: #fff;
  border: 1px solid #6d1141;
}

.btn-purchase:hover {
  background: #5a0e35;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(109, 17, 65, 0.3);
}

.btn-edit {
  background-color: #4caf50 !important;
  color: #fff !important;
  border: 1px solid #4caf50 !important;
}

.btn-edit:hover {
  background-color: #45a049 !important;
  border-color: #45a049 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-coupang {
  background: #fa622f;
  border: 1px solid #fa622f;
}

.btn-coupang:hover {
  background: #e8551f;
  box-shadow: 0 4px 12px rgba(250, 98, 47, 0.3);
}

.btn-kyobo {
  background: #3c9a17;
  border: 1px solid #3c9a17;
}

.btn-kyobo:hover {
  background: #2f7a12;
  box-shadow: 0 4px 12px rgba(60, 154, 23, 0.3);
}

.btn-yes24 {
  background: #0955a1;
  border: 1px solid #0955a1;
}

.btn-yes24:hover {
  background: #074482;
  box-shadow: 0 4px 12px rgba(9, 85, 161, 0.3);
}

/* 탭 네비게이션 */
.book-tab-navigation {
  background: #fff;
  border-bottom: 1px solid #ddd;
  position: -webkit-sticky; /* Safari 지원 */
  position: sticky;
  top: 90px;
  z-index: 999;
  width: 100%;
  margin: 0;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  left: 0;
  right: 0;
}

/* sticky가 활성화될 때 시각적 피드백 */
.book-tab-navigation.sticky-active {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* container 내부 스타일 조정 */
.book-tab-navigation .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* placeholder 스타일 (레이아웃 유지용) */
.book-tab-navigation-placeholder {
  display: none;
  width: 100%;
}

.book-tabs ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
}

.book-tabs li {
  margin: 0;
}

.book-tabs a {
  display: block;
  padding: 20px 30px;
  text-decoration: none;
  color: #666;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.book-tabs a:hover {
  color: #073d38;
}

.book-tabs a.active {
  color: #073d38;
  border-bottom-color: #073d38;
}

/* 탭 콘텐츠 */
.book-tab-content {
  background: #fff;
  min-height: 600px;
}

.tab-panel {
  display: none;
  padding: 50px 0;
}

.tab-panel.active {
  display: block;
}

.content-section {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0 0 80px 0;
  text-align: center;
}

/* 도서 소개 */
.book-description .lead-text {
  font-size: 1.3rem;
  color: #073d38;
  font-weight: 600;
  margin-bottom: 25px;
  line-height: 1.6;
  font-style: italic;
}

.book-description p {
  font-size: 0.95rem;
  line-height: 1.8 !important;
  color: #555;
  margin-bottom: 20px;
}

.book-description h3 {
  font-size: 1.5rem;
  color: #333;
  margin: 30px 0 15px 0;
}

.feature-list {
  list-style: none;
  padding: 0;
}

.feature-list li {
  padding: 8px 0 8px 25px;
  position: relative;
  color: #555;
  font-size: 1.1rem;
}

.feature-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #073d38;
  font-weight: bold;
}

/* 목차 및 본문 */
.contents-list .chapter {
  margin-bottom: 30px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.contents-list h4 {
  color: #073d38;
  margin: 0 0 15px 0;
  font-size: 1.3rem;
}

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

.contents-list li {
  padding: 5px 0 5px 20px;
  position: relative;
  color: #666;
}

.contents-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: #073d38;
}

.sample-text {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid #eee;
}

.text-excerpt h4 {
  color: #073d38;
  margin: 0 0 20px 0;
}

.text-excerpt p {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 20px;
  text-align: justify;
}

/* 저자 소개 */
.author-profile {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.author-image {
  flex-shrink: 0;
  width: 200px;
}

.profile-image {
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.8rem;
  color: #333;
  margin: 0 0 10px 0;
}

.author-title {
  font-size: 1.1rem;
  color: #073d38;
  margin: 0 0 20px 0;
  font-weight: 600;
}

.author-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  margin-bottom: 20px;
}

.author-info h4 {
  color: #333;
  margin: 25px 0 15px 0;
  font-size: 1.3rem;
}

.author-books,
.author-awards {
  list-style: none;
  padding: 0;
}

.author-books li,
.author-awards li {
  padding: 8px 0 8px 20px;
  position: relative;
  color: #555;
  font-size: 1.1rem;
}

.author-books li:before,
.author-awards li:before {
  content: "▶";
  position: absolute;
  left: 0;
  color: #073d38;
  font-size: 0.8rem;
}

/* 독자 서평 */
.review-form-section {
  background: #f8f9fa;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
}

.review-form-section h3 {
  color: #333;
  margin: 0 0 20px 0;
  font-size: 1.4rem;
}

.review-form .form-group {
  margin-bottom: 20px;
}

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

.review-form input[type="text"],
.review-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.review-form input[type="text"]:focus,
.review-form textarea:focus {
  outline: none;
  border-color: #073d38;
}

.rating-input {
  display: flex;
  gap: 5px;
}

.rating-input input[type="radio"] {
  display: none;
}

.rating-input label {
  font-size: 1.5rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.3s ease;
}

.rating-input input[type="radio"]:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
  color: #ffd700;
}

.btn-submit-review {
  background: #073d38;
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-submit-review:hover {
  background: #052a26;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7, 61, 56, 0.3);
}

/* 서평 목록 */
.reviews-list h3 {
  color: #333;
  margin: 0 0 30px 0;
  font-size: 1.4rem;
}

.review-count {
  color: #666;
  font-weight: 400;
}

.review-item {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  background: #fff;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.reviewer-name {
  font-weight: 600;
  color: #333;
}

.review-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stars {
  color: #ffd700;
  font-size: 1.1rem;
}

.rating-text {
  color: #666;
  font-size: 0.9rem;
}

.review-date {
  color: #999;
  font-size: 0.9rem;
}

.review-title {
  font-size: 1.2rem;
  color: #333;
  margin: 0 0 15px 0;
}

.review-content {
  color: #555;
  line-height: 1.7;
  margin-bottom: 20px;
}

.review-actions {
  display: flex;
  gap: 15px;
}

.btn-like,
.btn-reply {
  background: none;
  border: 1px solid #ddd;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666;
  transition: all 0.3s ease;
}

.btn-like:hover,
.btn-reply:hover {
  border-color: #073d38;
  color: #073d38;
}

.btn-like.liked {
  background: #073d38;
  color: #fff;
  border-color: #073d38;
}

.like-count {
  font-size: 0.9rem;
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.page-link {
  display: inline-block;
  padding: 10px 15px;
  border: 1px solid #ddd;
  text-decoration: none;
  color: #666;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.page-link:hover,
.page-link.active {
  background: #073d38;
  color: #fff;
  border-color: #073d38;
}

.page-link.next {
  padding: 10px 20px;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .book-info-wrapper {
    flex-direction: column;
    gap: 30px;
  }

  .book-cover {
    width: 250px;
    margin: 0 auto;
  }

  .book-title {
    font-size: 2rem;
  }

  /* 모바일에서 sticky 메뉴 - JavaScript가 fixed로 제어 */
  .book-tab-navigation {
    position: relative; /* JavaScript가 fixed로 변경 */
    z-index: 999;
  }

  /* JavaScript가 fixed로 변경했을 때 */
  .book-tab-navigation.sticky-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .book-tabs ul {
    flex-wrap: wrap;
  }

  .book-tabs a {
    padding: 15px 20px;
    font-size: 0.9rem;
  }

  .author-profile {
    flex-direction: column;
    gap: 30px;
  }

  .author-image {
    width: 150px;
    margin: 0 auto;
  }

  .book-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 15px;
  }
  
  .book-actions-row {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  .book-actions-row .btn-download,
  .book-actions-row .btn-purchase {
    width: 100%;
    justify-content: center;
    margin-bottom: 15px !important;
    margin-top: 0 !important;
  }
  
  .book-actions-row .btn-download:first-child,
  .book-actions-row .btn-purchase:first-child {
    margin-top: 0 !important;
  }
  
  .book-actions-row .btn-download:last-child,
  .book-actions-row .btn-purchase:last-child {
    margin-bottom: 0 !important;
  }

  .btn-download,
  .btn-purchase {
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  .book-detail-header {
    padding: 10px 0;
  }

  .book-title {
    font-size: 1.8rem;
  }

  /* 작은 모바일에서도 sticky 메뉴 - JavaScript가 fixed로 제어 */
  .book-tab-navigation {
    position: relative; /* JavaScript가 fixed로 변경 */
    z-index: 999;
  }

  /* JavaScript가 fixed로 변경했을 때 */
  .book-tab-navigation.sticky-active {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
  }

  .book-tabs a {
    padding: 12px 15px;
    font-size: 0.8rem;
  }

  .tab-panel {
    padding: 0 0 30px 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .review-form-section {
    padding: 20px;
  }

  .review-item {
    padding: 20px;
  }

  .review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
