/* =====================================================
   OpenAgents.pro — style.css
   Shared dark theme for all pages
   ===================================================== */

/* ─── Reset & base ─────────────────────────────────── */

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

:root {
  --bg:          #050505;
  --bg-card:     #0f0f0f;
  --bg-card-hover: #141414;
  --border:      rgba(255,255,255,0.07);
  --border-hover:rgba(124,58,237,0.4);
  --brand:       #7c3aed;
  --brand-light: #a78bfa;
  --text:        #f1f1f1;
  --text-muted:  #6b7280;
  --text-sub:    #9ca3af;
  --green:       #22c55e;
  --yellow:      #eab308;
  --red:         #ef4444;
  --radius:      14px;
  --radius-sm:   8px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-hover:0 8px 40px rgba(124,58,237,0.18);
  font-size: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Nav ───────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  height: 64px;
  background: rgba(5,5,5,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  flex-shrink: 0;
}

.nav-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.nav-logo .accent { color: var(--brand-light); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-links a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255,255,255,0.06);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.btn-primary {
  padding: 8px 18px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.88; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 2px;
  transition: all 0.2s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: rgba(5,5,5,0.98);
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; width: 100%; }
  .nav-cta .btn-primary { padding: 7px 14px; font-size: 0.8rem; }
}

/* ─── Page wrapper ──────────────────────────────────── */

.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem);
}

/* ─── Page header ───────────────────────────────────── */

.page-header {
  text-align: center;
  padding: 3rem 0 2.5rem;
}

.page-header .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--brand-light);
  font-weight: 500;
  margin-bottom: 1rem;
}

.page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.page-header h1 .gradient-text {
  background: linear-gradient(135deg, #a78bfa, #7c3aed, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  font-size: 1.05rem;
  color: var(--text-sub);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Search bar ─────────────────────────────────────── */

.search-wrapper {
  max-width: 620px;
  margin: 0 auto 2rem;
  position: relative;
}

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

.search-input {
  width: 100%;
  padding: 14px 120px 14px 44px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-input:focus {
  border-color: rgba(124,58,237,0.5);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  padding: 0 18px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: opacity 0.15s;
}
.search-btn:hover { opacity: 0.88; }

/* ─── Filter pills ──────────────────────────────────── */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2rem;
  align-items: center;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.filter-pill {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  border-color: rgba(124,58,237,0.4);
  color: var(--text);
  background: rgba(124,58,237,0.08);
}

.filter-pill.active {
  background: rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.5);
  color: var(--brand-light);
}

/* ─── Results count ─────────────────────────────────── */

.results-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* ─── Cards grid ────────────────────────────────────── */

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

/* ─── Card base ─────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
  background: var(--bg-card-hover);
}

/* Card header row */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.card-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.skill-icon  { background: rgba(124,58,237,0.25); color: var(--brand-light); }
.auto-icon   { background: rgba(249,115,22,0.2);  color: #fb923c; }
.prompt-icon { background: rgba(168,85,247,0.2);  color: #c084fc; }

.card-title-group { flex: 1; min-width: 0; }

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 2px;
  /* prevent overflow */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card:hover .card-title { color: var(--brand-light); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cat-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 3px;
  flex-shrink: 0;
}

/* Card body */
.card-description {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.6;
  flex: 1;
}

/* Use cases */
.card-usecases {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.usecase {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Prompt preview box */
.prompt-preview {
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
}

.prompt-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.prompt-text {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Steps list */
.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-sub);
  line-height: 1.45;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(124,58,237,0.2);
  color: var(--brand-light);
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Tips list */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tips-list li {
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-left: 14px;
  position: relative;
  line-height: 1.45;
}
.tips-list li::before { content: '→'; position: absolute; left: 0; color: var(--brand); }

/* Tools row */
.tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Card footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

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

/* ─── Badges ────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-green  { background: rgba(34,197,94,0.12);  color: #4ade80; border: 1px solid rgba(34,197,94,0.2); }
.badge-purple { background: rgba(124,58,237,0.15); color: var(--brand-light); border: 1px solid rgba(124,58,237,0.25); }
.badge-gray   { background: rgba(255,255,255,0.06); color: var(--text-sub);  border: 1px solid var(--border); }
.badge-yellow { background: rgba(234,179,8,0.12);  color: #facc15; border: 1px solid rgba(234,179,8,0.2); }
.badge-red    { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

.tag {
  padding: 2px 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ─── Buttons ───────────────────────────────────────── */

.btn-use {
  font-size: 0.78rem;
  color: var(--brand-light);
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s;
}
.btn-use:hover { color: #c4b5fd; }

.btn-copy {
  width: 100%;
  padding: 9px 14px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  border-radius: 8px;
  color: var(--brand-light);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.btn-copy:hover {
  background: rgba(124,58,237,0.25);
  border-color: rgba(124,58,237,0.5);
  transform: translateY(-2px);
}
.btn-copy:active {
  transform: translateY(0);
}
.btn-copy.copied {
  background: rgba(34,197,94,0.25) !important;
  border-color: rgba(34,197,94,0.5) !important;
  color: #4ade80 !important;
}

.load-more-btn {
  padding: 14px 32px !important;
  background: linear-gradient(135deg, #7c3aed, #4f46e5) !important;
  color: white !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.load-more-btn:hover {
  opacity: 0.88 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.3) !important;
}

.load-more-btn:active {
  transform: translateY(0) !important;
}

/* ─── Rating ─────────────────────────────────────────── */

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stars { color: #facc15; font-size: 0.82rem; font-weight: 600; }
.review-count { font-size: 0.72rem; color: var(--text-muted); }

.setup-time { font-size: 0.75rem; color: var(--text-muted); }

/* ─── Loading skeletons ─────────────────────────────── */

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

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.skeleton-card {
  height: 280px;
  border-radius: var(--radius);
  background: linear-gradient(90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.06) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--border);
}

/* ─── Error / empty states ──────────────────────────── */

.error-msg {
  grid-column: 1 / -1;
  padding: 2rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius);
  color: #f87171;
  font-size: 0.9rem;
  line-height: 1.6;
}
.error-msg code {
  background: rgba(0,0,0,0.3);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.85em;
}

.empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 3rem;
  font-size: 0.9rem;
}

/* ─── Hero section (index only) ─────────────────────── */

.hero {
  text-align: center;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(2rem, 4vw, 3.5rem);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--brand-light);
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge .pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand-light);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.85); }
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.12;
  margin-bottom: 1rem;
}

.gradient-text {
  background: linear-gradient(135deg, #a78bfa 0%, #7c3aed 50%, #4f46e5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--text-sub);
  max-width: 640px;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

/* Stats row */
.stats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2.5rem;
  color: var(--text-sub);
  font-size: 0.85rem;
}

.stat { display: flex; align-items: center; gap: 6px; }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.stat-divider { width: 1px; height: 28px; background: var(--border); }

/* ─── Section title row ─────────────────────────────── */

.section {
  margin-bottom: 4rem;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.section-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.section-link {
  font-size: 0.82rem;
  color: var(--brand-light);
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s;
}
.section-link:hover { color: #c4b5fd; }

/* ─── Categories grid ───────────────────────────────── */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 3.5rem;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.cat-card:hover {
  background: rgba(124,58,237,0.08);
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-1px);
}

.cat-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: transform 0.15s;
}
.cat-card:hover .cat-icon { transform: scale(1.1); }

.cat-name {
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-sub);
  text-align: center;
  line-height: 1.3;
}

.cat-card:hover .cat-name { color: var(--text); }

/* ─── Submit / CTA section ──────────────────────────── */

.cta-section {
  text-align: center;
  padding: 4rem 1.5rem;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 20px;
  margin: 2rem 0;
}

.cta-section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.cta-section p {
  font-size: 0.95rem;
  color: var(--text-sub);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.cta-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 10px 22px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.08); }

/* ─── Footer ────────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 3rem clamp(1rem, 4vw, 2rem) 2rem;
  margin-top: 4rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: 1.5fr repeat(2, 1fr) !important;
  gap: 2.5rem;
}

.footer-brand { max-width: 240px; }
.footer-brand .logo { margin-bottom: 0.75rem; }

.footer-brand p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-col a {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text-sub); }

.footer-bottom {
  max-width: 1280px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.77rem;
  color: var(--text-muted);
}

.footer-bottom-links {
  display: flex;
  gap: 1.5rem;
}

.footer-bottom-links a { color: var(--text-muted); transition: color 0.15s; }
.footer-bottom-links a:hover { color: var(--text-sub); }

@media (max-width: 900px) {
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand { grid-column: 1 / -1; max-width: none; }
}

@media (max-width: 500px) {
  .footer-inner { grid-template-columns: 1fr; }
  .stats-row .stat-divider { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
}
