/* =========================================================================
   BloxFruitScripts — components.css
   Карточки скриптов, бейджи, фильтр, блок кода, кнопки, FAQ.
   ========================================================================= */

/* ---------- Кнопки ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: #000;
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-gold);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn-primary:hover {
  color: #000;
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.32);
}
.btn-primary:active { transform: translateY(0); }

/* ---------- Фильтр-строка ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.75rem;
}
.filter-btn {
  padding: 9px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  color: #000;
  background: var(--gold-gradient);
  border-color: transparent;
}

/* ---------- Сетка карточек ---------- */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.scripts-empty {
  margin-top: 1.5rem;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ---------- Карточка скрипта ---------- */
.script-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.script-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold-gradient);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.script-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.script-card:hover::before { opacity: 1; }

.script-card__media {
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-code);
}
.script-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.script-card:hover .script-card__media img { transform: scale(1.04); }

.script-card__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.script-card__title {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.15;
}
.script-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.script-card__checked { font-size: 0.8rem; color: var(--text-muted); }

.script-card__desc {
  margin: 0 0 14px;
  font-size: 0.97rem;
  line-height: 1.6;
  color: #C4CCD8;
}

.script-card__executors {
  margin: 14px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.script-card__executors-label { color: var(--text-primary); font-weight: 700; }

/* ---------- Статус «работает» ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}
.status__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status--ok { color: var(--ok); }
.status--ok .status__dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.status--unknown { color: var(--text-muted); }
.status--unknown .status__dot {
  background: var(--text-muted);
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.15);
}

/* ---------- Бейджи ---------- */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  line-height: 1.5;
}
.badge--cat {
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
  transition: filter 0.18s ease, border-color 0.18s ease;
}
.badge--cat:hover { filter: brightness(1.25); border-color: var(--accent); }
.badge--key {
  color: #000;
  background: var(--gold-gradient);
  box-shadow: var(--shadow-gold);
}

/* ---------- Список фич ---------- */
.feature-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.feature-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.94rem;
  line-height: 1.45;
  color: #D2D9E4;
}
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.12);
  border-radius: 50%;
}

/* ---------- Блок кода ---------- */
.code-block {
  margin: auto 0 0;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.code-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.code-block__pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #E7C46B;
  white-space: pre;
}
.code-block__pre code { font-family: inherit; color: inherit; background: none; }

/* ---------- Кнопка «Скопировать» ---------- */
.copy-btn {
  flex: 0 0 auto;
  padding: 7px 16px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  color: #000;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.18s ease, background-color 0.18s ease;
  white-space: nowrap;
}
.copy-btn:hover { filter: brightness(1.08); }
.copy-btn.is-copied { background: var(--ok); }

/* ---------- FAQ ---------- */
.faq-section { margin-block: 3rem; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.faq-item[open] { border-color: var(--accent); }
.faq-item__q {
  list-style: none;
  cursor: pointer;
  padding: 16px 48px 16px 18px;
  position: relative;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--text-primary);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.faq-item[open] .faq-item__q::after { content: "–"; }
.faq-item__a {
  padding: 0 18px 16px;
  color: #C4CCD8;
}
.faq-item__a p { margin: 0 0 0.6rem; }
.faq-item__a p:last-child { margin-bottom: 0; }

/* ---------- Кнопка «Скачать скрипт» на карточке (главный CTA — сплошное золото) ---------- */
.script-card__actions { margin-top: 14px; }
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1.05rem;
  color: #000;
  background: var(--gold-gradient);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: var(--shadow-gold);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.btn-download:hover {
  color: #000;
  text-decoration: none;
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 10px 28px rgba(245, 158, 11, 0.34);
}
.btn-download:active { transform: translateY(0); }
.btn-download__icon { font-size: 1.15em; line-height: 1; }
.script-card__more {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}
.script-card__more:hover { color: var(--accent-soft); text-decoration: none; }

/* ---------- Страница /download/ ---------- */
.inline-code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent);
  background: var(--bg-code);
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.dl-script {
  padding: 20px 22px;
  margin-bottom: 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.dl-script__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 8px;
}
.dl-script__title { margin: 0; font-size: 1.25rem; }
.dl-script__desc { margin: 0 0 8px; color: #C4CCD8; }
.dl-script__executors { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

.dl-gate { margin-bottom: 28px; }
.dl-timer {
  text-align: center;
  padding: 30px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.dl-timer__text { margin: 0 0 4px; font-size: 1.1rem; }
.dl-count {
  font-family: var(--font-display);
  font-size: 1.7em;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.dl-bar {
  height: 10px;
  margin: 16px auto 12px;
  max-width: 420px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.dl-bar__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 999px;
}
.dl-timer__hint { margin: 0; font-size: 0.88rem; color: var(--text-muted); }

.dl-ready {
  text-align: center;
  padding: 26px 24px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-gold);
}
.btn-download-final { font-size: 1.15rem; padding: 15px 32px; }
.btn-download-final.is-done { filter: brightness(0.95); }
.dl-ready__hint { margin: 14px auto 6px; max-width: 52ch; font-size: 0.92rem; color: #C4CCD8; }
.dl-noscript { margin-top: 14px; color: var(--accent); font-weight: 700; text-align: center; }

.dl-wait { margin-top: 2.5rem; }
.dl-features { margin-bottom: 1.25rem; }
.dl-back { display: inline-block; margin-top: 1.5rem; }

/* ---------- TL;DR «Коротко» ---------- */
.tldr {
  margin: 0 0 1.75rem;
  padding: 18px 22px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.07), rgba(245, 158, 11, 0.02));
  border: 1px solid var(--accent-dim);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
}
.tldr__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
  color: var(--accent);
}
.tldr__list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.tldr__list li { color: #D2D9E4; font-size: 0.97rem; line-height: 1.55; }
.tldr__list li::marker { color: var(--accent); }

/* ---------- Таблица сравнения executor'ов ---------- */
.compare-wrap { overflow-x: auto; margin: 1.25rem 0; }
.compare-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--bg-card);
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover { background: rgba(245, 158, 11, 0.05); }
.compare-table td:first-child { font-weight: 700; color: var(--text-primary); }
.compare-table td { color: #C4CCD8; }

/* ---------- Обзор хабов ---------- */
.hub-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin: 1rem 0 2.4rem;
}
.hub-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.hub-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.hub-card__name { margin: 0 0 6px; font-size: 1.08rem; }
.hub-card__desc { margin: 0 0 14px; font-size: 0.9rem; line-height: 1.5; color: #C4CCD8; flex: 1; }
.hub-card__links { display: flex; align-items: center; gap: 14px; }
.hub-card__dl {
  display: inline-flex;
  padding: 7px 16px;
  font-weight: 700;
  font-size: 0.86rem;
  color: #000;
  background: var(--gold-gradient);
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: var(--shadow-gold);
}
.hub-card__dl:hover { filter: brightness(1.06); color: #000; text-decoration: none; }
.hub-card__to { font-size: 0.86rem; font-weight: 700; }
.hub-card__to:hover { text-decoration: none; }

/* ---------- Мелкий адаптив компонентов ---------- */
@media (max-width: 460px) {
  .scripts-grid { grid-template-columns: 1fr; }
  .script-card { padding: 18px; }
  .code-block__head { flex-wrap: wrap; }
  .btn-download-final { width: 100%; }
  .hub-overview { grid-template-columns: 1fr; }
}
