/* ============================================================
   SCRIPT HUB PRO — Main Stylesheet
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --clr-bg:         #080808;
  --clr-surface:    #111111;
  --clr-surface-2:  #1a1a1a;
  --clr-border:     rgba(255, 255, 255, 0.07);
  --clr-border-hover: rgba(192, 192, 192, 0.35);
  --clr-silver-1:   #c0c0c0;
  --clr-silver-2:   #e8e8e8;
  --clr-text:       #f0f0f0;
  --clr-muted:      #777;
  --clr-green:      #4ade80;
  --radius-card:    14px;
  --radius-btn:     10px;
  --shadow-card:    0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-hover:   0 16px 40px rgba(0, 0, 0, 0.65);
  --transition:     0.2s ease;
  --font:           -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Reset / Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font);
  min-height: 100vh;
  line-height: 1.5;
}

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

/* ── Utilities ──────────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--clr-silver-1), var(--clr-silver-2), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
  padding: 1.25rem 1rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header h1 {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.site-header p {
  font-size: 0.8rem;
  color: var(--clr-muted);
  margin-top: 0.25rem;
}

/* ── Search ──────────────────────────────────────────────────── */
.search-section { padding: 1.5rem 1rem; }

.search-wrapper {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  max-width: 760px;
  margin: 0 auto;
  transition: border-color var(--transition);
}

.search-wrapper:focus-within {
  border-color: var(--clr-silver-1);
  box-shadow: 0 0 0 3px rgba(192, 192, 192, 0.1);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-input-row i { color: var(--clr-muted); flex-shrink: 0; }

.search-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--clr-text);
  font-size: 0.9rem;
  font-family: var(--font);
}

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

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tag {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  color: #aaa;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.tag:hover,
.tag.active {
  background: rgba(192, 192, 192, 0.12);
  border-color: var(--clr-silver-1);
  color: #fff;
}

/* ── Main / Cards ─────────────────────────────────────────────── */
.main-content { padding: 0 1rem 4rem; }

.section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 800;
}

.section-header p {
  font-size: 0.82rem;
  color: var(--clr-muted);
  margin-top: 0.3rem;
}

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

/* ── Card ────────────────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-6px);
  border-color: var(--clr-border-hover);
  box-shadow: var(--shadow-hover);
}

.card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #606060, var(--clr-silver-1));
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 2;
  letter-spacing: 0.03em;
}

.card__img {
  width: 100%;
  height: 165px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card__img { transform: scale(1.04); }

.card__body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #fff;
}

.card__desc {
  font-size: 0.78rem;
  color: #999;
  flex: 1;
  line-height: 1.45;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Button ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.6rem 1.2rem;
  transition: all var(--transition);
  width: 100%;
}

.btn--primary {
  background: linear-gradient(135deg, var(--clr-silver-1), var(--clr-silver-2));
  color: #111;
}

.btn--primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(192, 192, 192, 0.25);
}

.btn--ghost {
  background: var(--clr-surface-2);
  color: #aaa;
  border: 1px solid var(--clr-border);
}

.btn--ghost:hover { color: #fff; border-color: var(--clr-border-hover); }

.btn--copy { background: linear-gradient(135deg, var(--clr-silver-1), var(--clr-silver-2)); color: #111; }
.btn--copy.copied { background: linear-gradient(135deg, #22c55e, #4ade80); color: #111; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(10px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.is-open { display: flex; }

.modal {
  background: var(--clr-surface);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
  animation: modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* modal preview strip */
.modal__preview {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}

.modal__preview-img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--clr-border);
}

.modal__preview-title { font-weight: 700; font-size: 0.95rem; }
.modal__preview-desc  { font-size: 0.75rem; color: var(--clr-muted); margin-top: 2px; }

.modal__heading {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.modal__sub {
  font-size: 0.8rem;
  color: var(--clr-muted);
  text-align: center;
  margin-bottom: 1.25rem;
}

/* offer items */
.offer-item {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

.offer-item:hover {
  border-color: var(--clr-silver-1);
  background: rgba(192, 192, 192, 0.06);
  transform: translateX(3px);
}

.offer-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.offer-item__title { font-size: 0.88rem; font-weight: 600; }

.offer-item__badge {
  font-size: 0.72rem;
  color: var(--clr-green);
  background: rgba(74, 222, 128, 0.1);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.modal__hint {
  font-size: 0.72rem;
  color: var(--clr-muted);
  text-align: center;
  margin-top: 1rem;
}

/* ── Script Reveal ───────────────────────────────────────────── */
.script-reveal {
  display: none;
  margin-top: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 12px;
  padding: 1.1rem;
}

.script-reveal.is-visible { display: block; }

.script-reveal__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--clr-green);
  font-size: 0.85rem;
  font-weight: 600;
}

.script-box {
  background: #050505;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.85rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  color: #a8ff78;
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.script-reveal__actions {
  display: flex;
  gap: 0.6rem;
}

.script-reveal__actions .btn { flex: 1; }

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

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .modal { padding: 1.25rem; }
}
