/* ============================================
   PLYNTHR.COM — Snippet Library Styles
   Matches existing Plynthr design system
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
  --ink: #0F0F1A;
  --ink-light: #1a1a2e;
  --ink-muted: #6B7094;
  --surface: #FAFAFE;
  --white: #FFFFFF;
  --indigo: #6366F1;
  --indigo-light: #818CF8;
  --violet: #8B5CF6;
  --violet-light: #A78BFA;
  --lavender: #C4B5FD;
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #F43F5E;
  --font: 'DM Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--white);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--indigo-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--lavender); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ---- NAV (matches existing plynthr.com) ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(20px);
  background: rgba(15,15,26,0.8);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* ---- HERO ---- */
.hero {
  position: relative;
  padding: 10rem 2rem 5rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(99,102,241,0.15) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(139,92,246,0.1) 0%, transparent 60%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image:
    linear-gradient(rgba(255,255,255,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.5) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-label {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-light);
  background: rgba(99,102,241,0.1);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 6px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  color: var(--white);
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--indigo-light), var(--violet-light), var(--lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--ink-muted);
  max-width: 540px;
  margin-bottom: 2.5rem;
}

.stats-row {
  display: flex;
  gap: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 2px;
}

/* ---- FILTERS ---- */
.filters-section { padding: 0 0 2.5rem; }

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 240px;
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--white);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: rgba(99,102,241,0.4); }
.search-input::placeholder { color: var(--ink-muted); }

.filter-pills { display: flex; gap: 4px; flex-wrap: wrap; }

.pill {
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: var(--ink-muted);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.pill:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--white);
}

.pill.active-cat {
  border-color: rgba(99,102,241,0.4);
  background: rgba(99,102,241,0.1);
  color: var(--indigo-light);
}

.pill.active-price {
  border-color: rgba(139,92,246,0.4);
  background: rgba(139,92,246,0.1);
  color: var(--violet-light);
}

.results-count {
  width: 100%;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-top: 0.5rem;
}

/* ---- SNIPPET GRID ---- */
.snippet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  padding-bottom: 6rem;
}

.snippet-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: block;
  color: inherit;
}

.snippet-card:hover {
  background: rgba(99,102,241,0.06);
  border-color: rgba(99,102,241,0.2);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(99,102,241,0.1);
  color: inherit;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.card-tags { display: flex; gap: 0.4rem; align-items: center; }

.tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.tag-free {
  background: rgba(16,185,129,0.12);
  color: var(--emerald);
  border: 1px solid rgba(16,185,129,0.2);
}

.tag-paid {
  background: rgba(139,92,246,0.12);
  color: var(--violet-light);
  border: 1px solid rgba(139,92,246,0.2);
}

.tag-beginner {
  background: rgba(16,185,129,0.08);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.15);
}

.tag-intermediate {
  background: rgba(245,158,11,0.08);
  color: #fcd34d;
  border: 1px solid rgba(245,158,11,0.15);
}

.tag-advanced {
  background: rgba(244,63,94,0.08);
  color: #fda4af;
  border: 1px solid rgba(244,63,94,0.15);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-category {
  font-size: 0.75rem;
  color: var(--ink-muted);
  background: rgba(255,255,255,0.04);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}

.card-cta {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--indigo-light);
  transition: color 0.2s;
}

.snippet-card:hover .card-cta { color: var(--lavender); }

/* ---- SNIPPET DETAIL PAGE ---- */
.snippet-detail { padding: 7rem 0 6rem; }

.snippet-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.snippet-back:hover { color: var(--indigo-light); }

.snippet-tags-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.snippet-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.snippet-desc {
  font-size: 1.05rem;
  color: var(--ink-muted);
  line-height: 1.7;
  max-width: 640px;
}

.snippet-meta {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.25);
  margin-top: 1.25rem;
  display: flex;
  gap: 2rem;
}

/* Code Block */
.code-section { margin-top: 2.5rem; }

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.code-filename {
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--indigo-light);
}

.copy-btn {
  padding: 0.45rem 1.2rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--violet);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.copy-btn.copied { background: var(--emerald); }

.code-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--lavender);
  white-space: pre;
  font-family: var(--mono);
}

/* Install & Info Sections */
.info-section {
  margin-top: 2rem;
  padding: 1.75rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}

.info-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.info-section ol,
.info-section ul {
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
}

.info-section ol li,
.info-section ul li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.info-section code {
  background: rgba(99,102,241,0.1);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--mono);
  color: var(--indigo-light);
}

.info-section strong { color: var(--white); }

/* Paid CTA */
.paid-cta {
  margin-top: 2.5rem;
  background: rgba(99,102,241,0.06);
  border: 1px solid rgba(99,102,241,0.15);
  border-radius: 16px;
  padding: 3.5rem 2rem;
  text-align: center;
}

.paid-cta .price-label {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-bottom: 0.5rem;
}

.paid-cta .price {
  font-size: 3rem;
  font-weight: 700;
  color: var(--white);
}

.paid-cta .price-sub {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0.5rem 0 2rem;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  background: var(--indigo);
  color: var(--white);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}

.buy-btn:hover {
  background: var(--violet);
  box-shadow: 0 0 30px rgba(99,102,241,0.2), 0 8px 30px rgba(99,102,241,0.4);
  transform: translateY(-2px);
  color: var(--white);
}

.paid-includes {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.paid-includes span {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Video Section */
.video-section { margin-top: 2.5rem; }

.video-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
}

.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-placeholder {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-muted);
  gap: 0.5rem;
}

.video-placeholder .play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--indigo-light);
}

/* FAQ */
.faq-section { margin-top: 2.5rem; }

.faq-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

.faq-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.faq-q {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.4rem;
}

.faq-a {
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.65;
}

/* Related Snippets */
.related-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.related-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 1rem;
}

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

/* ---- FOOTER (matches existing plynthr.com) ---- */
.footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2.5rem 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
}

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

.footer-links a {
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--white); }

.footer-abn {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.2);
}

/* ---- NO RESULTS ---- */
.no-results {
  text-align: center;
  padding: 5rem 0;
}

.no-results h3 {
  font-size: 1.25rem;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.no-results p { color: var(--ink-muted); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .stats-row { gap: 1.5rem; flex-wrap: wrap; }
  .snippet-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .hero { padding: 8rem 1.5rem 3rem; }
  .paid-includes { grid-template-columns: 1fr; }
  .snippet-meta { flex-direction: column; gap: 0.5rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
}
