/* ── StrainBase App CSS ────────────────────────────────────────────── */
:root {
  --green: #2ecc71;
  --green-dark: #1a8045;
  --green-glow: rgba(46, 204, 113, 0.25);
  --bg-dark: #0f1117;
  --bg-card: #1a1d26;
  --bg-card-hover: #21263a;
  --border-subtle: rgba(255,255,255,0.08);
  --text-muted-custom: #8892a4;
}

body {
  background: var(--bg-dark);
  color: #e2e8f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
#mainNav {
  background: rgba(15, 17, 23, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1030;
}

.logo-leaf { font-size: 1.4rem; }

.nav-link { color: #a0aec0 !important; transition: color .2s; }
.nav-link:hover { color: var(--green) !important; }

/* ── Search ─────────────────────────────────────────────────────── */
.search-container { position: relative; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: #6b7280; z-index: 2; font-size: .85rem;
}
.search-input {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid var(--border-subtle) !important;
  color: white !important;
  padding-left: 30px !important;
  width: 220px;
  transition: width .3s, border-color .2s;
  border-radius: 8px !important;
}
.search-input:focus {
  width: 280px;
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px var(--green-glow) !important;
}
.search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: #1e2232;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 1050;
  max-height: 360px;
  overflow-y: auto;
}
.search-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(46,204,113,0.15);
  border-bottom: 1px solid var(--border-subtle);
  transition: background .15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(46,204,113,0.1); }
.search-result-item img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; }

.compare-badge {
  cursor: pointer;
  background: var(--green) !important;
  transition: transform .2s;
}
.compare-badge:hover { transform: scale(1.05); }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #0a0f1a 0%, #0d1f12 50%, #0a0f1a 100%);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  align-items: center;
}

.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(46,204,113,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(46,204,113,0.06) 0%, transparent 60%);
}

.text-gradient {
  background: linear-gradient(135deg, #2ecc71, #27ae60, #00d4aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-search .form-control:focus {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px var(--green-glow) !important;
}

.quick-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.quick-tag {
  padding: 5px 14px;
  background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.25);
  border-radius: 20px;
  font-size: .8rem;
  cursor: pointer;
  transition: all .2s;
  color: #2ecc71;
}
.quick-tag:hover {
  background: rgba(46,204,113,0.25);
  transform: translateY(-1px);
}

/* ── Stats Bar ──────────────────────────────────────────────────── */
.stats-bar {
  background: rgba(46,204,113,0.06);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--green);
}
.stat-label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted-custom);
}

/* ── Cards ──────────────────────────────────────────────────────── */
.strain-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
  cursor: pointer;
  height: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(46,204,113,0.15);
}
.strain-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(46,204,113,.3);
  border-color: rgba(46,204,113,.3);
}
.strain-card-img {
  width: 100%; height: 200px; object-fit: cover; object-position: center top;
  background: linear-gradient(135deg, #111418, #1a2a14);
  transition: transform 0.3s ease;
}
.strain-card:hover .strain-card-img {
  transform: scale(1.04);
}
/* Uniform vignette overlay — scoped to image wrapper only */
.strain-card-img-wrap {
  position: relative;
  overflow: hidden;
}
.strain-card-img-wrap::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, rgba(15,17,23,0.65));
  pointer-events: none;
}
.strain-card-body { padding: 14px 16px; }
.strain-card-title { font-weight: 700; font-size: 1rem; margin-bottom: 4px; }
.strain-type-badge {
  font-size: .7rem; padding: 2px 10px;
  border-radius: 12px; font-weight: 600;
}
.badge-sativa { background: rgba(255, 193, 7, 0.2); color: #ffc107; }
.badge-indica { background: rgba(111, 66, 193, 0.2); color: #a78bfa; }
.badge-hybrid { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.badge-auto   { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-cbd    { background: rgba(16, 185, 129, 0.2); color: #34d399; }

.thc-bar {
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, #2ecc71, #f1c40f, #e74c3c);
}

.effect-tag {
  font-size: .65rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border-subtle);
  color: #9ca3af;
}

.rating-stars { color: #fbbf24; font-size: .8rem; }

.compare-toggle-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
  font-size: .75rem;
  flex-shrink: 0;
}
.compare-toggle-btn:hover, .compare-toggle-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* ── Strain List View ──────────────────────────────────────────── */
.strain-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 14px 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(46,204,113,0.15);
  transition: background .2s, border-color .2s;
  display: flex; align-items: center; gap: 14px;
}
.strain-list-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(46,204,113,.2);
}
.strain-list-img {
  width: 60px; height: 60px;
  border-radius: 10px; object-fit: cover; flex-shrink: 0;
}

/* ── Filter Sidebar ─────────────────────────────────────────────── */
.filter-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 16px;
  position: sticky;
  top: 70px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: rgba(46,204,113,0.1);
  border: 1px solid rgba(46,204,113,0.3);
  border-radius: 12px;
  font-size: .75rem;
  color: var(--green);
  cursor: pointer;
}
.filter-chip:hover { background: rgba(46,204,113,0.2); }

/* ── Similar strain links ───────────────────────────────────────── */
.similar-strain-link:hover {
  background: rgba(46,204,113,0.08) !important;
  border-color: rgba(46,204,113,0.3) !important;
}

/* ── Strain Detail ──────────────────────────────────────────────── */
.detail-hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26,45,20,0.5) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.detail-hero-img {
  width: 100%; height: 400px; object-fit: contain; object-position: center; background: #0f1117;
}
.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 1.5rem;
}
.terpene-tag {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  font-size: .8rem;
  color: #a78bfa;
}
.flavor-dot {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  font-size: .8rem;
  color: #f59e0b;
}
.potency-bar-wrap {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.potency-bar {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #2ecc71, #f1c40f);
  transition: width .6s cubic-bezier(.25,.8,.25,1);
}
.cbd-bar { background: linear-gradient(90deg, #3b82f6, #60a5fa) !important; }

/* ── Supplier Cards ─────────────────────────────────────────────── */
.supplier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 20px;
  transition: transform .2s, box-shadow .2s;
  height: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(46,204,113,0.15);
}
.supplier-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,.4);
}
.supplier-logo {
  width: 120px; height: 50px; object-fit: contain;
  border-radius: 8px;
}
.discount-badge {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white; font-size: .7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}
.supplier-tag {
  font-size: .7rem; padding: 2px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-subtle);
  color: #9ca3af;
}
.affiliate-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  border: none; color: white; font-weight: 600;
  transition: transform .15s, box-shadow .15s;
}
.affiliate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(46,204,113,.35);
  color: white;
}
.code-box {
  background: rgba(46,204,113,0.1);
  border: 1px dashed rgba(46,204,113,0.4);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-size: .85rem;
  color: var(--green);
  cursor: pointer;
  transition: background .2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.code-box:hover { background: rgba(46,204,113,0.2); }

/* ── Compare Table ──────────────────────────────────────────────── */
.compare-slot {
  background: var(--bg-card);
  border: 2px dashed var(--border-subtle);
  border-radius: 14px;
  min-height: 120px;
  cursor: pointer;
  transition: border-color .2s;
  display: flex; align-items: center; justify-content: center;
}
.compare-slot.filled {
  border-style: solid;
  border-color: rgba(46,204,113,.3);
}
.compare-slot:hover { border-color: var(--green); }

.compare-table-wrap { overflow-x: auto; }
.compare-table { min-width: 600px; }
.compare-table td, .compare-table th { vertical-align: middle; }
.compare-table .metric-label {
  color: var(--text-muted-custom);
  font-size: .8rem;
  white-space: nowrap;
  padding-right: 20px;
}
.compare-bar-wrap { background: rgba(255,255,255,0.05); border-radius: 4px; height: 6px; }
.compare-bar { height: 100%; border-radius: 4px; background: var(--green); }

/* ── Compare CTA ────────────────────────────────────────────────── */
.compare-cta-card {
  background: linear-gradient(135deg, rgba(26,45,20,0.6), rgba(15,17,23,0.8));
  border: 1px solid rgba(46,204,113,0.2);
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ── Utilities ──────────────────────────────────────────────────── */
.btn-success { background: var(--green-dark); border-color: var(--green-dark); }
.btn-success:hover { background: #145a32; border-color: #145a32; }
.btn-outline-success { color: var(--green); border-color: var(--green); }
.btn-outline-success:hover { background: var(--green); border-color: var(--green); color: white; }
.text-success { color: var(--green) !important; }
.bg-success { background: var(--green) !important; }

.page { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.badge-count-pulse {
  animation: pulse 0.4s ease;
}
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  .hero-section { min-height: 320px; }
  .display-3 { font-size: 2rem; }
  .search-input { width: 100% !important; }
  .filter-sidebar { position: static; margin-bottom: 1rem; }
}

/* ── Ad containers ───────────────────────────────────────────────── */
.ad-leaderboard {
  background: transparent;
  min-height: 0;
  transition: min-height .3s;
}
.ad-leaderboard:has([data-ad-slot] > *) {
  min-height: 90px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid var(--border-subtle);
}
[data-ad-slot]:empty { display: none; }

/* ── Strain image carousel ───────────────────────────────────────── */
.strain-thumbs {
  background: rgba(0,0,0,0.25);
  border-top: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.strain-thumbs::-webkit-scrollbar { display: none; }

.strain-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: border-color .2s, opacity .2s;
  opacity: 0.6;
}
.strain-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0f1117;
  display: block;
}
.strain-thumb.active,
.strain-thumb:hover {
  border-color: var(--green);
  opacity: 1;
}

/* keep carousel controls visible on dark bg */
#strainCarousel .carousel-control-prev,
#strainCarousel .carousel-control-next {
  width: 10%;
  opacity: 0;
  transition: opacity .2s;
}
#strainCarousel:hover .carousel-control-prev,
#strainCarousel:hover .carousel-control-next {
  opacity: 0.7;
}

/* ─── User Star Rating Widget ─────────────────────────────────────────────── */
.star-picker .star-btn {
  display: inline-block;
  user-select: none;
  line-height: 1;
}
.user-rating-done {
  opacity: .85;
}
