/* ================================================================
   URBot Explore — Bot Discovery Page
   GPT-Store style browse experience
   ================================================================ */

:root {
  --bg:          #0f1117;
  --bg2:         #161b27;
  --bg3:         #1e2436;
  --border:      rgba(124,58,237,0.18);
  --accent:      #7c3aed;
  --accent-soft: rgba(124,58,237,0.12);
  --accent-glow: rgba(124,58,237,0.35);
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --text-dim:    #64748b;
  --yellow:      #fbbf24;
  --green:       #10b981;
  --red:         #ef4444;
  --radius:      12px;
  --radius-sm:   8px;
  --transition:  0.18s ease;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Nav ─────────────────────────────────────────────────────── */
.exp-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15,17,23,0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.exp-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.exp-nav-logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: #a78bfa;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.exp-nav-links {
  display: flex;
  gap: 1.5rem;
  font-size: 0.88rem;
}

.exp-nav-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}

.exp-nav-links a:hover,
.exp-nav-links a.active { color: var(--text); }

.exp-nav-right {
  margin-left: auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.exp-nav-search {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0.4rem 1rem 0.4rem 2.2rem;
  color: var(--text);
  font-size: 0.88rem;
  width: 220px;
  outline: none;
  transition: border-color var(--transition), width var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zm-5.242 1.406a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.7rem center;
}

.exp-nav-search:focus {
  border-color: var(--accent);
  width: 280px;
}

.exp-btn-signin {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: #a78bfa;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  transition: background var(--transition);
}
.exp-btn-signin:hover { background: rgba(124,58,237,0.22); }

/* ── Hero ─────────────────────────────────────────────────────── */
.exp-hero {
  background: linear-gradient(180deg, #13101e 0%, var(--bg) 100%);
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.exp-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #e2e8f0 0%, #a78bfa 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.6rem;
}

.exp-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 520px;
  margin: 0 auto 1.5rem;
}

.exp-hero-search-wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

.exp-hero-search-wrap input {
  width: 100%;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 30px;
  padding: 0.85rem 1.25rem 0.85rem 3rem;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.exp-hero-search-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.exp-hero-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1rem;
  pointer-events: none;
}

.exp-hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.exp-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.exp-stat strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.exp-tabs-wrap {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 56px;
  z-index: 90;
}

.exp-tabs {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.exp-tabs::-webkit-scrollbar { display: none; }

.exp-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 1rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.exp-tab:hover { color: var(--text); }

.exp-tab.active {
  color: #a78bfa;
  border-bottom-color: #7c3aed;
}

/* ── Layout ──────────────────────────────────────────────────── */
.exp-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.exp-sidebar {
  position: sticky;
  top: 112px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.exp-sidebar-section h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.exp-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.exp-cat-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.42rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--transition), color var(--transition);
  width: 100%;
}

.exp-cat-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.exp-cat-btn.active {
  background: rgba(124,58,237,0.18);
  color: #a78bfa;
  font-weight: 600;
}

.exp-cat-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-dim);
  background: var(--bg3);
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
}

/* ── Main content ────────────────────────────────────────────── */
.exp-main {}

/* Section headers */
.exp-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.exp-section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.exp-section-header a {
  font-size: 0.82rem;
  color: #a78bfa;
  transition: color var(--transition);
}
.exp-section-header a:hover { color: #c4b5fd; }

/* ── Bot Grid ────────────────────────────────────────────────── */
.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ── Bot Card ────────────────────────────────────────────────── */
.exp-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.exp-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 0%, var(--accent-soft), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}

.exp-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px var(--accent-glow);
  border-color: rgba(124,58,237,0.4);
}

.exp-card:hover::before { opacity: 1; }

.exp-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

.exp-card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg3);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
}

.exp-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.exp-card-meta {
  flex: 1;
  min-width: 0;
}

.exp-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exp-card-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.2rem;
  background: var(--cat-bg, rgba(99,102,241,0.15));
  color: var(--cat-color, #818cf8);
}

.exp-card-badges {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  gap: 0.25rem;
  flex-direction: column;
  align-items: flex-end;
}

.exp-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.exp-badge-featured { background: rgba(251,191,36,0.2); color: #fbbf24; }
.exp-badge-new      { background: rgba(16,185,129,0.2); color: #10b981; }
.exp-badge-trending { background: rgba(239,68,68,0.2);  color: #ef4444; }
.exp-badge-pick     { background: rgba(124,58,237,0.25); color: #a78bfa; }

.exp-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.exp-card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

.exp-card-rating {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--yellow);
}

.exp-card-chats {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.exp-card-price {
  margin-left: auto;
  font-weight: 700;
  color: var(--green);
  font-size: 0.82rem;
}

.exp-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
}

.exp-btn {
  flex: 1;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border: none;
  transition: background var(--transition), transform var(--transition);
}

.exp-btn:hover { transform: scale(1.03); }

.exp-btn-chat {
  background: var(--accent);
  color: #fff;
}
.exp-btn-chat:hover { background: #6d28d9; }

.exp-btn-cart {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
}
.exp-btn-cart:hover { background: var(--accent-soft); color: #a78bfa; border-color: rgba(124,58,237,0.35); }

/* ── Featured Collections ────────────────────────────────────── */
.exp-collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.exp-collection-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.exp-collection-card:hover {
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.exp-collection-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.exp-collection-info h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.exp-collection-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.exp-collection-avatars {
  display: flex;
}

.exp-collection-avatar {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--bg2);
  overflow: hidden;
  background: var(--bg3);
  margin-left: -4px;
}
.exp-collection-avatar:first-child { margin-left: 0; }
.exp-collection-avatar img { width: 100%; height: 100%; object-fit: cover; }

.exp-collection-synergy {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: var(--green);
  font-weight: 700;
  align-self: center;
}

/* ── Trending List ───────────────────────────────────────────── */
.exp-trending-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.exp-trending-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.exp-trending-item:hover {
  background: var(--bg3);
  border-color: rgba(124,58,237,0.3);
}

.exp-trending-rank {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-dim);
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.exp-trending-rank.top3 { color: #fbbf24; }

.exp-trending-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg3);
  overflow: hidden;
  flex-shrink: 0;
}
.exp-trending-avatar img { width: 100%; height: 100%; object-fit: cover; }

.exp-trending-info {
  flex: 1;
  min-width: 0;
}

.exp-trending-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.exp-trending-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  margin-top: 0.1rem;
}

.exp-trending-growth {
  color: var(--green);
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.exp-trending-actions {
  display: flex;
  gap: 0.5rem;
}

/* ── Search panel ────────────────────────────────────────────── */
.exp-search-panel {
  display: none;
}
.exp-search-panel.active {
  display: block;
}

.exp-search-query-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.exp-search-query-label strong { color: var(--text); }

/* ── Load More ───────────────────────────────────────────────── */
.exp-load-more {
  text-align: center;
  margin: 1rem 0 2rem;
}

.exp-load-more-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.65rem 2rem;
  border-radius: 24px;
  font-size: 0.88rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.exp-load-more-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
  border-color: rgba(124,58,237,0.35);
}

.exp-load-more-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Empty / Loading states ──────────────────────────────────── */
.exp-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.exp-empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.exp-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.exp-skeleton {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  animation: exp-pulse 1.5s ease-in-out infinite;
}

.exp-skeleton-line {
  height: 12px;
  background: var(--bg3);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

@keyframes exp-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ── Footer ──────────────────────────────────────────────────── */
.exp-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.exp-footer a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.exp-footer a:hover { color: var(--text); }

/* ── Toast ───────────────────────────────────────────────────── */
.exp-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--bg2);
  border: 1px solid rgba(124,58,237,0.4);
  color: var(--text);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  z-index: 999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.exp-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .exp-layout {
    grid-template-columns: 1fr;
  }

  .exp-sidebar {
    position: static;
    display: none; /* hidden on mobile, use tabs instead */
  }

  .exp-nav-search { display: none; }
}

@media (max-width: 600px) {
  .exp-hero { padding: 2rem 1rem 1.5rem; }
  .exp-hero h1 { font-size: 1.6rem; }
  .exp-hero-stats { gap: 1rem; }
  .exp-grid { grid-template-columns: 1fr 1fr; }
  .exp-collections { grid-template-columns: 1fr; }
  .exp-tabs-wrap { top: 56px; }
  .exp-layout { padding: 1rem; }
}

@media (max-width: 400px) {
  .exp-grid { grid-template-columns: 1fr; }
}
