* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: #ffffff;
  padding: 15px 32px;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.nav {
  display: flex;
  width: 100%;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: 12px;
  font-size: 1.2em;
  font-weight: 600;
  color: #666;
  text-decoration: none;
  transition: all 0.25s;
}

.nav-item:hover {
  background: rgba(250, 112, 154, 0.08);
  color: #fa709a;
}

/* 현재 페이지 */
.nav-item.active {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(250, 112, 154, 0.3);
}

.back-btn {
  font-size: 0.95em;
  font-weight: 500;
  color: #fa709a;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}

.back-btn:hover {
  background: rgba(250, 112, 154, 0.08);
  color: #e85b87;
}

.header h1 {
  text-align: center;
  font-size: 1.4em;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
}

.spacer {
  width: 100px;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px;
  overflow: hidden;
}

.search-section {
  background: white;
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: fadeInDown 0.5s ease;
}

.search-title {
  text-align: center;
  margin-bottom: 30px;
}

.search-title h2 {
  font-size: 2em;
  color: #333;
  margin-bottom: 10px;
}

.search-title p {
  font-size: 1.1em;
  color: #666;
}

.search-box {
  display: flex;
  gap: 15px;
  max-width: 800px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  padding: 18px 25px;
  font-size: 1.2em;
  border: 2px solid #e0e0e0;
  border-radius: 15px;
  transition: border-color 0.3s;
  font-family: inherit;
}

.search-input:focus {
  outline: none;
  border-color: #f5576c;
}

.search-btn {
  padding: 18px 40px;
  font-size: 1.2em;
  font-weight: 600;
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 20px rgba(245, 87, 108, 0.3);
}

.search-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(245, 87, 108, 0.4);
}

.results-section {
  flex: 1;
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  animation: fadeInUp 0.5s ease;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 5em;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.empty-state p {
  font-size: 1.1em;
}

.book-list {
  display: none;
}

.book-list.show {
  display: block;
}

.book-item {
  background: #f8f8f8;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.book-item:hover {
  background: #fff;
  border-color: #f5576c;
  transform: translateX(5px);
  box-shadow: 0 5px 20px rgba(245, 87, 108, 0.2);
}

.book-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.book-item-title {
  flex: 1;
}

.book-item-title h3 {
  font-size: 1.5em;
  color: #333;
  margin-bottom: 8px;
}

.book-item-title .author {
  font-size: 1.1em;
  color: #666;
}

.status-badge {
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95em;
}

.status-available {
  background: #d4edda;
  color: #155724;
}

.status-borrowed {
  background: #f8d7da;
  color: #721c24;
}

.book-item-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-label {
  font-size: 0.9em;
  color: #999;
  font-weight: 500;
}

.info-value {
  font-size: 1.05em;
  color: #333;
  font-weight: 600;
}

/* 상세 정보 모달 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 25px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.4s ease;
}

.modal-header {
  padding: 30px 40px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h2 {
  font-size: 2em;
  color: #333;
  margin-bottom: 10px;
}

.modal-header .author {
  color: #666;
  font-size: 1.2em;
}

.close-btn {
  background: none;
  border: none;
  font-size: 2em;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

.modal-body {
  padding: 30px 40px;
}

.detail-section {
  margin-bottom: 30px;
}

.detail-section h3 {
  font-size: 1.4em;
  color: #333;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-section p {
  color: #555;
  font-size: 1.1em;
  line-height: 1.8;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-item {
  background: #f8f8f8;
  padding: 20px;
  border-radius: 15px;
}

.detail-item label {
  font-weight: 600;
  color: #f5576c;
  display: block;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.detail-item span {
  color: #333;
  font-size: 1.1em;
}

.location-highlight {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  margin-top: 20px;
}

.location-highlight h4 {
  font-size: 1.3em;
  margin-bottom: 10px;
}

.location-highlight p {
  font-size: 1.4em;
  font-weight: 600;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 800px) {
  .search-box {
    flex-direction: column;
  }

  .book-item-info {
    grid-template-columns: 1fr;
  }

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