/*
 * packs.css — styles for individual pack pages
 * Shared across all pack pages; loaded after style.css.
 * Relies on --tc, --acc-10, --acc-15, --acc-30, --acc-50
 * (CSS custom props set by style.css and updated at runtime by packs.js).
 *
 * Browser compatibility note:
 *   rgb(from <color> r g b / <alpha>) (relative color syntax) is supported in
 *   Chrome 119+, Safari 16.4+, Firefox 128+.
 *   Each occurrence below is preceded by a rgba() fallback declaration using
 *   the default theme colour (#a855f7 = 168 85 247) so older browsers still
 *   render a reasonable gradient. Browsers that understand the relative-colour
 *   form will ignore the fallback and use the dynamic version.
 */

/* ── HERO IMAGE & THUMBNAIL ──────────────────────────── */

.pack-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  display: block;
}

.pack-hero-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--acc-30);
  flex-shrink: 0;
  background: #0d0d14;
}

/* ── STAT PILLS ──────────────────────────────────────── */

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 8px 12px;
  flex: 1;
  min-width: 0;
}
.stat-pill-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: var(--acc-10);
  color: var(--tc);
  flex-shrink: 0;
}
.stat-pill-label {
  font-size: 0.58rem;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 2px;
}
.stat-pill-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* ── TAG BADGE ───────────────────────────────────────── */

.tag-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--acc-10);
  color: var(--tc);
  border: 1px solid var(--acc-30);
  letter-spacing: 0.03em;
}

/* ── SECTION HEADING ─────────────────────────────────── */

.section-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* ── GALLERY ─────────────────────────────────────────── */

.gallery-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.gallery-scroll::-webkit-scrollbar { display: none; }

.gallery-img {
  width: 180px;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: #0d0d14;
}

/* ── RECOMMENDED PACKS ───────────────────────────────── */

.rec-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.rec-card:hover { background: rgba(255,255,255,0.06); text-decoration: none; }

.rec-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #0d0d14;
  border: 1px solid rgba(255,255,255,0.07);
}

/* ── FADE-UP REVEAL ──────────────────────────────────── */

.fade-up {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ── GATE SECTION (inline download unlock) ───────────── */

.gate-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.gate-section::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acc-30), transparent);
}

/* Progress bar */
.gate-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.gate-bar-label {
  font-size: 0.68rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.gate-bar-count {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--tc);
}
.gate-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}
.gate-bar-fill {
  height: 100%;
  border-radius: 10px;
  /* Fallback for browsers without relative colour syntax */
  background: linear-gradient(90deg, var(--tc), rgba(168,85,247,0.5));
  /* Modern browsers: gradient fades to a translucent version of the theme colour */
  background: linear-gradient(90deg, var(--tc), rgb(from var(--tc) r g b / 0.5));
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* ── TASK CARDS ──────────────────────────────────────── */

.task-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.task-card.tc-done {
  border-color: rgba(34,197,94,0.25);
  background: rgba(34,197,94,0.04);
}
.task-card.tc-active {
  border-color: var(--acc-30);
  box-shadow: 0 0 0 1px var(--acc-10);
}

.task-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.task-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  transition: background 0.3s, border-color 0.3s;
}
.task-card.tc-done .task-icon-wrap {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.25);
  color: #22c55e;
}
.task-card.tc-active .task-icon-wrap {
  background: var(--acc-10);
  border-color: var(--acc-30);
  color: var(--tc);
}

.task-meta { flex: 1; min-width: 0; }
.task-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ccc;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.task-card.tc-active .task-title,
.task-card.tc-done .task-title { color: #fff; }

.task-sub { font-size: 0.66rem; color: #555; margin-top: 2px; }

.task-status-badge {
  flex-shrink: 0;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.tsb-pending { background: rgba(255,255,255,0.04); color: #444; border: 1px solid rgba(255,255,255,0.07); }
.tsb-waiting { background: var(--acc-10); color: var(--tc); border: 1px solid var(--acc-30); }
.tsb-done    { background: rgba(34,197,94,0.12); color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }

.task-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.task-btn {
  flex: 1;
  min-width: 110px;
  padding: 10px 12px;
  border-radius: 11px;
  border: none;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.22s;
  color: #fff;
}
.tbtn-open {
  background: var(--acc-10);
  border: 1px solid var(--acc-30);
  color: var(--tc);
}
.tbtn-open:hover {
  background: var(--acc-15);
  box-shadow: 0 4px 16px var(--acc-15);
  transform: translateY(-1px);
}
.tbtn-done {
  /* Fallback for browsers without relative colour syntax */
  background: linear-gradient(135deg, var(--tc), rgba(168,85,247,0.7));
  /* Modern: fades to a translucent version of the chosen theme colour */
  background: linear-gradient(135deg, var(--tc), rgb(from var(--tc) r g b / 0.7));
  box-shadow: 0 4px 16px var(--acc-30);
}
.tbtn-done:hover:not(:disabled) {
  box-shadow: 0 6px 24px var(--acc-50);
  transform: translateY(-1px);
}
.tbtn-done:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.tbtn-confirmed {
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  color: #22c55e;
  cursor: default;
  width: 100%;
}

/* ── TIMER STRIP ─────────────────────────────────────── */

.timer-strip {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--acc-10);
  border: 1px solid var(--acc-30);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  color: #888;
}
.timer-strip i { color: var(--tc); font-size: 0.75rem; flex-shrink: 0; }
.timer-sec { color: var(--tc); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── UNLOCK BUTTON ───────────────────────────────────── */

.unlock-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: none;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  /* Fallback for browsers without relative colour syntax */
  background: linear-gradient(135deg, var(--tc), rgba(168,85,247,0.7));
  /* Modern: fades to a translucent version of the chosen theme colour */
  background: linear-gradient(135deg, var(--tc), rgb(from var(--tc) r g b / 0.7));
  box-shadow: 0 4px 24px var(--acc-30);
  transition: all 0.25s;
  letter-spacing: 0.02em;
  margin-top: 16px;
}
.unlock-btn:hover:not(:disabled) {
  box-shadow: 0 8px 36px var(--acc-50);
  transform: translateY(-2px);
  filter: brightness(1.1);
}
.unlock-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

/* ── SUCCESS SECTION (shown after all tasks complete) ─── */

.success-section {
  text-align: center;
  padding: 8px 0 4px;
  animation: successPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
  /* successPop keyframe is defined in style.css */
}
.success-ring {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #22c55e;
  background: rgba(34,197,94,0.1);
  border: 2px solid rgba(34,197,94,0.3);
  box-shadow: 0 0 30px rgba(34,197,94,0.2);
}
.dl-final-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 24px rgba(34,197,94,0.35);
  transition: all 0.25s;
  margin-top: 14px;
}
.dl-final-btn:hover {
  box-shadow: 0 8px 36px rgba(34,197,94,0.5);
  transform: translateY(-2px);
  color: #fff;
  text-decoration: none;
}

/* ── ALWAYS-VISIBLE DOWNLOAD BUTTON ──────────────────── */

.dl-main-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 20px;
  border-radius: 16px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.dl-main-btn.locked {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #555;
  cursor: not-allowed;
  box-shadow: none;
}
.dl-main-btn.unlocked {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 8px 24px rgba(34,197,94,0.35);
  cursor: pointer;
}
.dl-main-btn.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(34,197,94,0.5);
}
.dl-main-btn.unlocked:active { transform: translateY(0); }

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.dl-main-btn.shake { animation: shake 0.4s ease; }

/* ── TOAST NOTIFICATION ──────────────────────────────── */

.dl-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,30,0.95);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}
.dl-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.dl-toast i { color: #f97316; margin-right: 6px; }

/* ── INFO STRIP ──────────────────────────────────────── */

.info-strip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(255,170,0,0.06);
  border: 1px solid rgba(255,170,0,0.12);
  border-radius: 12px;
  padding: 12px;
  margin-top: 14px;
}
.info-strip i { color: #ffaa00; font-size: 0.8rem; flex-shrink: 0; margin-top: 1px; }
.info-strip p { color: #888; font-size: 0.65rem; line-height: 1.55; margin: 0; }

/* ── RESPONSIVE ──────────────────────────────────────── */

@media (max-width: 460px) {
  .task-actions { flex-direction: column; }
  .task-btn { min-width: unset; }
}
