/* === LIBRARY TAXONOMY SYSTEM === */

/* ---- Update Banner ---- */
.library-update-banner {
  position: fixed;
  top: 72px; /* sits directly below the nav */
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 24px;
  background: linear-gradient(90deg, #0d0d0d 0%, #111111 50%, #0d0d0d 100%);
  border-bottom: 1px solid rgba(192, 192, 192, 0.18);
  font-size: 0.83rem;
  color: var(--text-secondary);
  text-align: center;
}

.library-update-banner strong {
  color: var(--accent-bright);
}

.library-update-banner-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* Push library-hero down to account for banner height (~41px) */
.library-hero {
  padding-top: 155px !important; /* 72px nav + 41px banner + 42px breathing room */
}

/* ---- Taxonomy Filter System ---- */
.taxonomy-filter-system {
  margin-bottom: 40px;
  background: #111111;
  border: 1px solid rgba(192, 192, 192, 0.15);
  border-radius: 16px;
  overflow: hidden;
}

/* ---- Category Tabs Row ---- */
.category-tabs-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 6px;
  border-bottom: 1px solid rgba(192, 192, 192, 0.1);
  background: #0d0d0d;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.18s ease;
  white-space: nowrap;
}

.cat-tab:hover {
  color: var(--accent-bright);
  background: rgba(192, 192, 192, 0.06);
}

.cat-tab.active {
  background: var(--chrome-gradient);
  color: #000000;
  font-weight: 700;
}

.cat-tab.active .cat-count {
  background: rgba(0,0,0,0.18);
  color: #000000;
}

/* Coming-soon tab variant */
.cat-tab-coming-soon {
  opacity: 0.7;
}

.cat-tab-coming-soon:hover {
  opacity: 1;
}

/* Category count badge */
.cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 5px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(192, 192, 192, 0.12);
  color: var(--text-muted);
  line-height: 1;
}

/* Coming-soon badge (in biohacking tab) */
.cat-coming-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(201, 168, 76, 0.12);
  color: var(--amber);
}

/* ---- Subcategory Pills Row ---- */
.subcategory-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(192, 192, 192, 0.08);
  background: #0a0a0a;
}

.sub-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-right: 4px;
  flex-shrink: 0;
}

.sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.77rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid rgba(192, 192, 192, 0.18);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.16s ease;
}

.sub-pill:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(192, 192, 192, 0.06);
}

.sub-pill.active {
  border-color: var(--accent);
  color: var(--accent-bright);
  background: rgba(192, 192, 192, 0.1);
}

/* Subcategory count badge */
.sub-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(192, 192, 192, 0.12);
  color: var(--text-muted);
  line-height: 1;
}

.sub-pill.active .sub-count {
  background: rgba(192, 192, 192, 0.22);
  color: var(--accent);
}

/* ---- Library Search Bar ---- */
.library-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(192, 192, 192, 0.08);
  background: #0d0d0d;
  position: relative;
}

.library-search-icon {
  flex-shrink: 0;
  color: var(--text-muted);
  stroke-width: 2;
}

.library-search-input {
  flex: 1;
  background: rgba(192, 192, 192, 0.06);
  border: 1px solid rgba(192, 192, 192, 0.15);
  border-radius: 10px;
  padding: 10px 36px 10px 14px;
  font-size: 0.88rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
  width: 100%;
}

.library-search-input::placeholder {
  color: var(--text-muted);
}

.library-search-input:focus {
  border-color: var(--accent);
  background: rgba(192, 192, 192, 0.1);
}

.library-search-clear {
  position: absolute;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(192, 192, 192, 0.15);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: background 0.15s ease;
}

.library-search-clear:hover {
  background: rgba(192, 192, 192, 0.3);
  color: var(--text-primary);
}

/* ---- Filter Meta Row (count + mobile toggle) ---- */
.filter-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
}

.compound-count {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Mobile filter toggle (hidden on desktop) */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  border: 1px solid rgba(192, 192, 192, 0.2);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.16s ease;
}

.mobile-filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ---- Compound card tag: new category colors ---- */
.compound-tag.weight {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* Ensure all compound-tag variants have consistent base style */
.compound-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}

/* ---- Biohacking placeholder ---- */
.biohacking-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  padding: 60px 24px;
}

.biohacking-placeholder-inner {
  text-align: center;
  max-width: 420px;
}

.biohacking-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.biohacking-placeholder-inner h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.biohacking-placeholder-inner p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 24px;
}

.coming-soon-badge-lg {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(201, 168, 76, 0.12);
  color: var(--amber);
  border: 1px solid rgba(201, 168, 76, 0.25);
}

/* ---- Mobile Responsive ---- */
@media (max-width: 768px) {
  /* Show mobile toggle */
  .mobile-filter-toggle {
    display: inline-flex;
  }

  /* On mobile, category tabs and subcategory row are hidden by default */
  .taxonomy-filter-system:not(.mobile-expanded) .category-tabs-row {
    display: none;
  }

  .taxonomy-filter-system:not(.mobile-expanded) .subcategory-row {
    display: none !important;
  }

  /* When expanded, show them */
  .taxonomy-filter-system.mobile-expanded .category-tabs-row {
    display: flex;
  }

  /* Force the meta row to show always (count + toggle button) */
  .filter-meta-row {
    padding: 12px 16px;
  }

  .cat-tab {
    font-size: 0.8rem;
    padding: 7px 12px;
  }

  .cat-count {
    font-size: 0.65rem;
  }

  /* Horizontal scroll for tabs on small screens */
  .category-tabs-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .category-tabs-row::-webkit-scrollbar {
    display: none;
  }

  .subcategory-row {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .subcategory-row::-webkit-scrollbar {
    display: none;
  }

  /* Banner wraps nicely on mobile */
  .library-update-banner {
    font-size: 0.78rem;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .library-update-banner {
    font-size: 0.74rem;
  }
}
