
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-gradient: linear-gradient(135deg, #eef2ff 0%, #ffffff 40%, #fdf5ff 100%);
  --primary: #4b5dff;
  --primary-soft: #eef0ff;
  --primary-dark: #3644cc;
  --border-subtle: #e1e4f2;
  --text-main: #222433;
  --text-sub: #676b80;
  --surface: #ffffff;
  --shadow-soft: 0 12px 30px rgba(40, 60, 140, 0.15);
  --radius-lg: 18px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
}

/* App shell */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(226, 228, 240, 0.9);
  backdrop-filter: blur(14px);
  background: rgba(250, 250, 255, 0.9);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  font-size: 26px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-sub);
}

/* Main layout */

.container {
  display: flex;
  flex: 1;
  padding: 16px 20px 24px;
  gap: 16px;
}

.left-panel,
.right-panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 18px;
}

.left-panel {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.right-panel {
  flex: 1;
  min-width: 0;
  display: flex;
}

/* Search area */

.search-area {
  margin-bottom: 14px;
}

.search-label {
  font-size: 12px;
  color: var(--text-sub);
  display: block;
  margin-bottom: 6px;
}

.search-row {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 12px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  font-size: 14px;
  outline: none;
  background: #fbfbff;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(75, 93, 255, 0.12);
  background: #ffffff;
}

.search-btn {
  padding: 0 16px;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease;
}

.search-btn:hover {
  background: var(--primary-dark);
  box-shadow: 0 8px 16px rgba(75, 93, 255, 0.35);
  transform: translateY(-1px);
}

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

.search-hint {
  margin: 6px 2px 0;
  font-size: 11px;
  color: var(--text-sub);
}

/* Autocomplete */

.autocomplete-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(228, 231, 245, 0.9);
  background: #ffffff;
  max-height: 210px;
  overflow-y: auto;
  box-shadow: 0 10px 26px rgba(40, 60, 140, 0.18);
  display: none;
  position: relative;
  z-index: 5;
}

.autocomplete-item {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.autocomplete-item strong {
  font-weight: 600;
}

.autocomplete-item span {
  font-size: 11px;
  color: var(--text-sub);
}

.autocomplete-item:hover {
  background: var(--primary-soft);
}

.autocomplete-list.visible {
  display: block;
}

/* Results panel */

.results-wrapper {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 8px;
}

.panel-title {
  margin: 0 0 6px 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.results-frame {
  flex: 1;
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 24px rgba(50, 60, 140, 0.12);
  background: #ffffff;
}

/* Right panel */

.book-details {
  flex: 1;
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px 22px;
}

.book-details.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-sub);
}

.placeholder h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.placeholder p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

/* Responsive */

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
    padding: 10px 12px 16px;
  }

  .left-panel,
  .right-panel {
    width: 100%;
  }

  .left-panel {
    order: 1;
  }

  .right-panel {
    order: 2;
    margin-top: 10px;
  }

  .results-frame {
    height: 260px;
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 10px 12px;
  }

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

  .brand-sub {
    display: none;
  }

  .container {
    padding: 8px;
  }

  .left-panel,
  .right-panel {
    padding: 14px 12px;
    box-shadow: 0 8px 18px rgba(40, 60, 140, 0.18);
  }

  .search-row {
    flex-direction: row;
  }

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

  .search-btn {
    font-size: 13px;
    padding: 0 12px;
  }

  .results-frame {
    height: 220px;
  }

  .book-details {
    padding: 16px 14px;
  }

  .placeholder h2 {
    font-size: 16px;
  }
}
