/* Google Books Search & Citation Lookup CSS (Prefix: gbs-) */

.gbs-body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.gbs-header {
  background-color: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.75rem 1.5rem;
}

.gbs-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gbs-logo-link {
  font-size: 1.25rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
}

.gbs-logo-link:hover {
  color: #7dd3fc;
}

.gbs-nav-badge {
  background-color: #1e293b;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gbs-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.gbs-breadcrumbs {
  margin-bottom: 1rem;
}

.gbs-bc-list {
  display: flex;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.gbs-bc-item {
  display: inline;
}

.gbs-bc-link {
  color: #0284c7;
  text-decoration: none;
}

.gbs-bc-link:hover {
  text-decoration: underline;
}

.gbs-bc-separator {
  margin: 0 0.5rem;
  color: #94a3b8;
}

.gbs-bc-current {
  color: #334155;
  font-weight: 500;
}

/* Hero */
.gbs-hero {
  margin-bottom: 1.5rem;
}

.gbs-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.gbs-subtitle {
  font-size: 1.05rem;
  color: #475569;
  margin: 0;
  max-width: 800px;
}

/* Filter Bar */
.gbs-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background-color: #e2e8f0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.gbs-filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
}

.gbs-genre-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gbs-genre-btn {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gbs-genre-btn:hover {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.gbs-genre-active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Search Card */
.gbs-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.gbs-search-card {
  margin-bottom: 1.5rem;
}

.gbs-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gbs-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.gbs-search-wrap {
  flex: 1 1 300px;
}

.gbs-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gbs-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.95rem;
  color: #0f172a;
  background-color: #fff;
  box-sizing: border-box;
}

.gbs-input:focus {
  outline: none;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.gbs-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gbs-label-inline {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
}

.gbs-select {
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #0f172a;
  background-color: #fff;
}

.gbs-search-stats {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}

/* Layout Grid */
.gbs-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 980px) {
  .gbs-layout {
    grid-template-columns: 1fr;
  }
}

/* Books Grid */
.gbs-catalog-column {
  min-height: 400px;
}

.gbs-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gbs-book-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.gbs-book-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.gbs-card-active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.4);
}

.gbs-book-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  overflow: hidden;
  background-color: #0f172a;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem;
  color: #ffffff;
  box-sizing: border-box;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.4);
}

.gbs-book-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.gbs-book-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.gbs-book-author {
  font-size: 0.8rem;
  color: #64748b;
}

.gbs-book-year {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Detail Drawer Card */
.gbs-drawer-column {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.gbs-detail-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gbs-detail-header {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.gbs-detail-cover {
  width: 90px;
  height: 135px;
  border-radius: 4px;
  flex-shrink: 0;
  background-color: #0f172a;
  color: #fff;
  padding: 0.5rem;
  box-sizing: border-box;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.gbs-detail-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gbs-pill {
  display: inline-block;
  background-color: #e0f2fe;
  color: #0369a1;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  width: fit-content;
  text-transform: uppercase;
}

.gbs-detail-h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  line-height: 1.3;
}

.gbs-detail-author {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 600;
}

.gbs-rating-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.gbs-stars {
  color: #f59e0b;
}

.gbs-rating-text {
  color: #64748b;
}

/* Meta List */
.gbs-meta-list {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.825rem;
}

.gbs-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.25rem;
}

.gbs-meta-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.gbs-meta-key {
  color: #64748b;
}

.gbs-meta-val {
  font-weight: 600;
  color: #0f172a;
}

.gbs-code {
  font-family: ui-monospace, monospace;
  background-color: #e2e8f0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.8rem;
  color: #0f172a;
}

/* Synopsis & Excerpt */
.gbs-synopsis-box, .gbs-excerpt-box {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.gbs-box-heading {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.gbs-desc-text {
  font-size: 0.825rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
}

.gbs-excerpt-quote {
  font-size: 0.8rem;
  font-style: italic;
  color: #334155;
  border-left: 3px solid #0284c7;
  padding-left: 0.75rem;
  margin: 0;
  background-color: #f0f9ff;
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
}

/* Citation Box */
.gbs-citation-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.75rem;
}

.gbs-citation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gbs-cite-format-pills {
  display: flex;
  gap: 0.25rem;
}

.gbs-cite-btn {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
}

.gbs-cite-btn:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.gbs-cite-active {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

.gbs-citation-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: #0f172a;
  background-color: #fff;
  resize: vertical;
  box-sizing: border-box;
}

.gbs-cite-actions {
  display: flex;
  gap: 0.5rem;
}

.gbs-btn-small {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.gbs-btn-small:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.gbs-table-wrap {
  overflow-x: auto;
}

.gbs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.gbs-table th, .gbs-table td {
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.gbs-table th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #1e293b;
}

/* Ads */
.gbs-ad-wrapper {
  margin: 2rem 0;
  min-height: 280px;
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Guide Section */
.gbs-guide-section {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.gbs-guide-article {
  margin-bottom: 2rem;
}

.gbs-guide-article:last-child {
  margin-bottom: 0;
}

.gbs-guide-article h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.75rem 0;
}

.gbs-guide-article p {
  color: #334155;
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.gbs-faq-list {
  margin: 0;
}

.gbs-faq-q {
  font-weight: 700;
  color: #0f172a;
  margin-top: 1rem;
  font-size: 1rem;
}

.gbs-faq-a {
  margin: 0.35rem 0 0.75rem 0;
  color: #475569;
  line-height: 1.5;
}

/* Related Tools */
.gbs-related-tools {
  margin-bottom: 2rem;
}

.gbs-related-heading {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1rem;
}

.gbs-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.gbs-related-card {
  display: block;
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.gbs-related-card:hover {
  border-color: #0284c7;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.gbs-related-title {
  display: block;
  font-weight: 700;
  color: #0284c7;
  margin-bottom: 0.35rem;
}

.gbs-related-desc {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.4;
}

.gbs-footer {
  background-color: #0f172a;
  color: #94a3b8;
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
  text-align: center;
}

.gbs-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.gbs-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: #0f172a;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
}
