/* =============================================================
   BizCity LLM Router — Public Models Pages
   Design: OpenRouter-inspired dark-accent theme
   ============================================================= */

/* ── Base ── */
.blr-public-wrap {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 20px 4rem;
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  color: #1a1a2e;
}

/* Flatsome #content.content-area wrapper — reset any theme padding */
#content.content-area:has(.blr-public-wrap) {
  padding: 0;
  max-width: none;
  width: 100%;
}

/* ── Hero ── */
.blr-hero {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  margin: 0 0 1.25rem;
  padding: 1.5rem 0;
  text-align: left;
  color: #111;
}
.blr-hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 .25rem;
  color: #111 !important;
}
.blr-hero-sub {
  color: #6b7280;
  margin: 0 0 .75rem;
  font-size: .95rem;
}
.blr-hero-stats {
  display: flex;
  gap: 1.5rem;
  font-size: .875rem;
  color: #6b7280;
}
.blr-hero-stats strong { color: #111 !important; }

/* ── Toolbar ── */
.blr-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}
.blr-search-wrap {
  flex: 1 1 250px;
  position: relative;
  min-width: 200px;
}
.blr-search-wrap svg {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}
.blr-search-wrap input {
  width: 100%;
  padding: .55rem 1rem .55rem 2.25rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  background: #f8fafc;
  box-sizing: border-box;
  transition: border-color .15s;
}
.blr-search-wrap input:focus { border-color: #6366f1; background: #fff; }

.blr-filter-group {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: #64748b;
}
.blr-filter-group select {
  padding: .5rem .75rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: .9rem;
  background: #f8fafc;
  cursor: pointer;
  outline: none;
}

.blr-view-toggle { display: flex; gap: .25rem; }
.blr-view-btn {
  background: #f1f5f9;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  padding: .45rem .65rem;
  cursor: pointer;
  color: #64748b;
  transition: all .15s;
}
.blr-view-btn.active,
.blr-view-btn:hover { background: #6366f1; color: #fff; border-color: #6366f1; }

/* ── Model Grid ── */
.blr-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ── Model Card ── */
.blr-model-card {
  background: #fff;
  border: 1.5px solid #e8ecf2;
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: .65rem;
  transition: box-shadow .15s, border-color .15s, transform .1s;
}
.blr-model-card:hover {
  box-shadow: 0 4px 20px rgba(99,102,241,.12);
  border-color: #a5b4fc;
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.blr-mc-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  position: relative;
}
.blr-mc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.blr-mc-avatar-lg { width: 52px; height: 52px; border-radius: 12px; font-size: 1rem; }
.blr-mc-name { font-weight: 600; font-size: .95rem; color: #1e293b; }
.blr-mc-author {
  font-size: .8rem;
  color: #6366f1;
  text-decoration: none;
}
.blr-mc-author:hover { text-decoration: underline; }
.blr-mc-ctx { font-size: .78rem; color: #94a3b8; }
.blr-mc-badge { margin-left: auto; }
.blr-mc-desc {
  font-size: .84rem;
  color: #64748b;
  line-height: 1.5;
  flex: 1;
  margin: 0;
}
.blr-mc-footer {
  display: flex;
  gap: .75rem;
  font-size: .8rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

/* ── List View — OpenRouter style ── */
.blr-models-list {
  display: flex;
  flex-direction: column;
}
.blr-model-row {
  padding: 1.25rem 0;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  justify-content: space-between;
}
.blr-models-list .blr-model-row:first-child { border-top: 1px solid #f1f5f9; }
.blr-mr-top { flex: 1; min-width: 0; }
.blr-mr-title-row { display: flex; align-items: center; gap: .45rem; margin-bottom: .35rem; }
.blr-mr-name { font-weight: 500; color: #1e293b; text-decoration: none; font-size: 1rem; }
.blr-mr-name:hover { color: #6366f1; text-decoration: none; }
.blr-copy-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: .2rem .35rem;
  cursor: pointer;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: background .12s, color .12s;
}
.blr-copy-btn:hover { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.blr-mr-desc {
  font-size: .9rem;
  color: #64748b;
  line-height: 1.55;
  margin: 0 0 .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blr-mr-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
  font-size: .8rem;
  color: #94a3b8;
}
.blr-mr-provider { color: #94a3b8; text-decoration: underline; text-underline-offset: 2px; }
.blr-mr-provider:hover { color: #475569; }
.blr-sep { color: #d1d5db; user-select: none; }
.blr-mr-ctx-badge {
  white-space: nowrap;
  font-size: .82rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: .25rem;
  padding-top: .4rem;
  flex-shrink: 0;
}

/* ── Chips / badges ── */
.blr-chip {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  padding: .2rem .55rem;
  border-radius: 5px;
  font-size: .78rem;
  font-weight: 500;
}
.blr-chip.free { background: #dcfce7; color: #16a34a; }
.blr-tag-list { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .4rem; }

/* ── Pagination ── */
.blr-pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-top: 1.5rem;
}
.blr-page-btn {
  min-width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
  transition: all .15s;
}
.blr-page-btn.active, .blr-page-btn:hover { background: #6366f1; color: #fff; border-color: #6366f1; }

/* ── Spinner / loading ── */
.blr-loading {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 2.5rem;
  color: #94a3b8;
  grid-column: 1/-1;
  justify-content: center;
}
.blr-loading-full {
  flex-direction: column;
  padding: 5rem;
  font-size: 1rem;
}
.blr-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: blr-spin .7s linear infinite;
  display: inline-block;
}
.blr-spinner-lg { width: 40px; height: 40px; border-width: 4px; }
@keyframes blr-spin { to { transform: rotate(360deg); } }
.blr-empty { padding: 3rem; text-align: center; color: #94a3b8; grid-column: 1/-1; }

/* ── Detail page ── */
.blr-breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .88rem;
  color: #94a3b8;
  margin: 1.25rem 0;
}
.blr-breadcrumb a { color: #6366f1; text-decoration: none; }
.blr-breadcrumb a:hover { text-decoration: underline; }

.blr-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1.5rem 0 1rem;
  flex-wrap: wrap;
}
.blr-dh-left { display: flex; gap: 1.25rem; align-items: flex-start; }
.blr-dh-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.blr-dh-left h1 { font-size: 1.6rem; margin: 0 0 .35rem; }
.blr-dh-meta { display: flex; align-items: center; gap: .5rem; }
.blr-dh-meta code { font-size: .83rem; background: #f1f5f9; padding: .2rem .5rem; border-radius: 5px; color: #475569; }
.blr-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: .2rem;
  transition: color .15s;
}
.blr-copy-btn:hover { color: #6366f1; }

.blr-btn-primary {
  background: #6366f1;
  color: #fff;
  padding: .65rem 1.5rem;
  border-radius: 9px;
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
  transition: background .15s;
  display: inline-block;
}
.blr-btn-primary:hover { background: #4f46e5; color: #fff; }
.blr-btn-secondary {
  background: #fff;
  color: #6366f1;
  border: 1.5px solid #6366f1;
  padding: .6rem 1.5rem;
  border-radius: 9px;
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
  transition: all .15s;
  display: inline-block;
}
.blr-btn-secondary:hover { background: #6366f1; color: #fff; }
.blr-dh-right { display: flex; gap: .75rem; align-items: flex-start; flex-wrap: wrap; }

/* ── CTA cards ── */
.blr-cta-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.blr-cta-card { text-align: center; }
.blr-cta-card h3 { font-size: 1.1rem; }
.blr-cta-card p { color: #64748b; margin: 0 0 1rem; font-size: .93rem; }
@media (max-width: 680px) { .blr-cta-row { grid-template-columns: 1fr; } }

/* ── Tabs ── */
.blr-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8ecf2;
  margin: 1.5rem 0 1.25rem;
}
.blr-tab {
  background: none;
  border: none;
  padding: .6rem 1.25rem;
  font-size: .93rem;
  cursor: pointer;
  color: #64748b;
  font-weight: 500;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
}
.blr-tab.active { color: #6366f1; border-bottom-color: #6366f1; }
.blr-tab-panel { padding-bottom: 1rem; }

/* ── KPI Row ── */
.blr-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.blr-kpi-card {
  background: #fff;
  border: 1.5px solid #e8ecf2;
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.blr-kpi-val { font-size: 1.2rem; font-weight: 700; color: #1e293b; }
.blr-kpi-lbl { font-size: .8rem; color: #94a3b8; margin-top: .2rem; }

/* ── Cards ── */
.blr-card {
  background: #fff;
  border: 1.5px solid #e8ecf2;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.blr-card h3 { margin: 0 0 .75rem; font-size: 1rem; font-weight: 600; color: #1e293b; }

.blr-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 680px) { .blr-two-col { grid-template-columns: 1fr; } }

/* ── Code block ── */
.blr-code-block { background: #0f172a; border-color: #1e293b; }
.blr-code-block h3, .blr-code-header span { color: #94a3b8; }
.blr-code-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: .75rem;
  align-items: center;
}
.blr-code-block pre {
  overflow-x: auto;
  margin: 0;
  font-size: .85rem;
  color: #7dd3fc;
  line-height: 1.6;
  background: #0f172a !important;
  border: none !important;
  padding: 1rem !important;
  border-radius: 8px;
}

/* ── Table ── */
.blr-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.blr-table th { background: #f8fafc; text-align: left; padding: .6rem .85rem; color: #64748b; font-weight: 600; border-bottom: 1.5px solid #e2e8f0; }
.blr-table td { padding: .6rem .85rem; border-bottom: 1px solid #f1f5f9; }
.blr-table tr:last-child td { border-bottom: none; }

/* ── Params grid ── */
.blr-params-grid { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ── Provider header ── */
.blr-provider-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 1rem;
}
.blr-prov-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.blr-provider-header h1 { font-size: 1.8rem; margin: 0 0 .25rem; }

/* ── Bar chart ── */
.blr-bar-chart { display: flex; flex-direction: column; gap: .5rem; }
.blr-bar-row { display: flex; align-items: center; gap: .75rem; }
.blr-bar-label { width: 160px; font-size: .85rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blr-bar-track { flex: 1; background: #f1f5f9; border-radius: 4px; height: 10px; }
.blr-bar-fill { background: linear-gradient(90deg, #6366f1, #818cf8); border-radius: 4px; height: 10px; transition: width .4s ease; }
.blr-bar-val { width: 70px; font-size: .82rem; color: #94a3b8; text-align: right; }

/* ── Provider card ── */
.blr-prov-card { min-height: unset; }
.blr-provider-link { color: #6366f1; text-decoration: none; font-weight: 600; }
.blr-provider-link:hover { text-decoration: underline; }
.blr-prov-row { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid #f1f5f9; }
.blr-prov-row:last-child { border-bottom: none; }
.blr-prov-name { font-size: .9rem; color: #1e293b; }

/* ── WP paginate_links ── */
.blr-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}
.blr-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .65rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s;
}
.blr-pagination a.page-numbers:hover {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
}
.blr-pagination .page-numbers.current {
  background: #6366f1;
  color: #fff;
  border-color: #6366f1;
  pointer-events: none;
}
.blr-pagination .page-numbers.dots {
  border: none;
  background: none;
  color: #94a3b8;
  min-width: auto;
  padding: 0 .25rem;
}
.blr-pagination .page-numbers.prev,
.blr-pagination .page-numbers.next {
  font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .blr-hero { padding: 2rem 1rem; }
  .blr-hero-stats { gap: 1rem; flex-wrap: wrap; }
  .blr-models-grid { grid-template-columns: 1fr; }
  .blr-toolbar { flex-direction: column; align-items: stretch; }
  .blr-view-toggle { justify-content: flex-end; }
  .blr-detail-header { flex-direction: column; }
  .blr-kpi-row { grid-template-columns: 1fr 1fr; }
  .blr-bar-label { width: 90px; }
}
