/* ================================================================
   MBTI Spotify Shelf Generator — Stylesheet
   Mobile-first · Gen Z aesthetic · Spotify + Apple Music inspired
   No frameworks · Pure CSS · Dark theme with gradients & glow
   ================================================================ */

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

:root {
  /* Background palette */
  --bg-deep:    #0a0a1a;
  --bg-navy:    #0f0f2e;
  --bg-purple:  #1a1040;
  --bg-card:    rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(168, 230, 207, 0.25);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary:  rgba(255, 255, 255, 0.45);
  --text-muted:     rgba(255, 255, 255, 0.3);

  /* Accent */
  --green:       #1DB954;
  --green-glow:  rgba(29, 185, 84, 0.4);
  --purple:      #6C5CE7;
  --purple-glow: rgba(108, 92, 231, 0.4);
  --pink:        #FF6B6B;
  --gold:        #FFC048;

  /* Spacing */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;

  /* Typography */
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Animated Background ──────────────────────────────────── */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(108, 92, 231, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(29, 185, 84, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 50% 40%, rgba(15, 15, 46, 1) 0%, var(--bg-deep) 100%);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb--1 {
  width: 500px;
  height: 500px;
  background: rgba(108, 92, 231, 0.4);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.bg-orb--2 {
  width: 400px;
  height: 400px;
  background: rgba(29, 185, 84, 0.3);
  bottom: -10%;
  right: -8%;
  animation-delay: -7s;
}

.bg-orb--3 {
  width: 350px;
  height: 350px;
  background: rgba(255, 107, 107, 0.25);
  top: 50%;
  left: 55%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25%      { transform: translate(60px, -40px) scale(1.08); }
  50%      { transform: translate(-30px, 50px) scale(0.94); }
  75%      { transform: translate(-50px, -30px) scale(1.04); }
}

/* Waveform decoration */
.bg-waveform {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  opacity: 0.06;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C80,20 120,100 200,60 C280,20 320,100 400,60 C480,20 520,100 600,60 C680,20 720,100 800,60 C880,20 920,100 1000,60 C1080,20 1120,100 1200,60 L1200,120 L0,120 Z' fill='%236C5CE7'/%3E%3C/svg%3E") repeat-x bottom;
  background-size: 1200px 120px;
  animation: waveformDrift 12s linear infinite;
}

@keyframes waveformDrift {
  0%   { background-position-x: 0; }
  100% { background-position-x: 1200px; }
}

/* ── Layout ───────────────────────────────────────────────── */
.site-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header / Nav ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  height: 56px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.header-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--purple), var(--green));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: #000;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 24px;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
}

.header-cta:hover {
  transform: scale(1.04);
  box-shadow: 0 0 24px var(--green-glow);
}

/* Mobile nav — simplified: hide long nav, show hamburger */
.header-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
}

@media (max-width: 860px) {
  .header-nav { display: none; }
  .header-cta  { display: none; }
  .header-mobile-toggle { display: block; }
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  position: relative;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(29, 185, 84, 0.1);
  border: 1px solid rgba(29, 185, 84, 0.2);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 40%, #6ee7b7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat .stat-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Generator Layout ─────────────────────────────────────── */
.generator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 10px 0 60px;
  align-items: start;
}

@media (max-width: 860px) {
  .generator {
    grid-template-columns: 1fr;
  }
}

/* ── Card Base ────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/* Step completed indicator */
.card--done {
  border-color: rgba(29, 185, 84, 0.35);
  box-shadow: 0 0 12px rgba(29, 185, 84, 0.08);
}

.card--done .step-badge {
  background: var(--green);
  color: #000;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* ── MBTI Type Grid ───────────────────────────────────────── */
.mbti-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 500px) {
  .mbti-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

.mbti-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mbti-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.mbti-chip:active {
  transform: scale(0.97);
}

.mbti-chip .chip-type {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  line-height: 1.2;
}

.mbti-chip .chip-nick {
  font-size: 0.6rem;
  color: var(--text-tertiary);
  margin-top: 2px;
  line-height: 1.3;
  display: none; /* hidden on mobile, shown on wider */
}

@media (min-width: 500px) {
  .mbti-chip .chip-nick { display: block; }
}

/* Selected state */
.mbti-chip.selected {
  background: rgba(108, 92, 231, 0.18);
  border-color: var(--purple);
  box-shadow: 0 0 16px var(--purple-glow), inset 0 0 16px rgba(108, 92, 231, 0.08);
}

.mbti-chip.selected .chip-type {
  color: #fff;
}

/* ── Mood & Activity Selectors ────────────────────────────── */
.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.option-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.option-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.option-pill:active {
  transform: scale(0.96);
}

.option-pill.selected {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-primary);
  font-weight: 600;
}

.option-pill .pill-emoji {
  font-size: 0.9rem;
}

/* ── Generate Button ──────────────────────────────────────── */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--green), #1ed760);
  color: #000;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-sans);
  border: none;
  border-radius: 28px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  letter-spacing: -0.01em;
  margin-top: 4px;
}

.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--green-glow);
}

.btn-generate:active {
  transform: scale(0.97);
}

/* ── Result Card (Instagram-Story ratio ~4:5) ─────────────── */
.result-panel {
  position: sticky;
  top: 76px;
}

@media (max-width: 860px) {
  .result-panel {
    position: static;
    top: auto;
  }
}

.result-card {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 420px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--cardGradient, linear-gradient(135deg, #0a0030 0%, #1b1464 40%, #2d1b69 100%));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transition: all 0.4s var(--ease-out);
}

.result-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.result-card__top {
  position: relative;
  z-index: 1;
}

.result-card__inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px 16px;
  z-index: 1;
}

.result-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.result-mbti {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.2);
}

.result-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 6px;
  letter-spacing: -0.01em;
}

.result-card__mid {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-section-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}

.result-card__bottom {
  position: relative;
  z-index: 1;
}

/* Song list */
.result-songs-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-song {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
}

.result-song__num {
  font-size: 0.58rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
  min-width: 13px;
}

.result-song__title {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-song__artist {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.result-quote {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  margin-bottom: 10px;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.result-site {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

.result-spotify-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--green);
}

/* Empty state */
.result-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-tertiary);
  padding: 28px 24px 20px;
}

.result-empty .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.result-empty p {
  font-size: 0.85rem;
  max-width: 220px;
}

/* ── Share Section ────────────────────────────────────────── */
.share-section {
  margin-top: 20px;
  text-align: center;
}

.share-section h4 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Social share buttons */
.btn-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: 24px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}

.btn-share:hover {
  transform: translateY(-2px);
}

.btn-share:active {
  transform: scale(0.96);
}

/* X (Twitter) */
.btn-share--x {
  background: #0f1419;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-share--x:hover { background: #1a1f26; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

/* Facebook */
.btn-share--fb {
  background: #1877F2;
}
.btn-share--fb:hover { background: #1a86ff; box-shadow: 0 4px 16px rgba(24,119,242,0.4); }

/* Instagram */
.btn-share--ig {
  background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF, #515BD4);
  border: none;
}
.btn-share--ig:hover { box-shadow: 0 4px 16px rgba(221,42,123,0.4); }

/* Copy Link */
.btn-share--copy {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}
.btn-share--copy:hover { background: rgba(255, 255, 255, 0.14); }

/* Download */
.btn-share--download {
  background: var(--green);
  color: #000;
}
.btn-share--download:hover { box-shadow: 0 4px 16px var(--green-glow); }

/* Copied toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(255, 255, 255, 0.95);
  color: #000;
  padding: 10px 24px;
  border-radius: 28px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 999;
  opacity: 0;
  transition: all 0.35s var(--ease-spring);
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Instagram modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: var(--bg-navy);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  animation: scaleUp 0.3s var(--ease-spring);
}

.modal-box h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.modal-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.modal-box .btn-generate {
  margin-top: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 32px 20px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  position: relative;
  z-index: 1;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--green);
}

/* ── Responsive polish ────────────────────────────────────── */
@media (max-width: 500px) {
  .hero {
    padding: 40px 16px 28px;
  }

  .result-card {
    max-width: 100%;
  }

  .result-card__inner,
  .result-empty {
    padding: 18px 16px 14px;
  }

  .result-mbti {
    font-size: 2.2rem;
  }

  .result-title {
    font-size: 1.05rem;
  }

  .card {
    padding: 16px;
  }

  .btn-share {
    padding: 8px 14px;
    font-size: 0.72rem;
  }
}
/* Adsterra 468x60 Banner */

.ad-slot-banner {
    width: 100%;
    min-height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 24px auto;
    overflow: hidden;
}


@media (max-width: 768px) {

    .ad-slot-banner {
        margin: 16px auto;
        min-height: 70px;
    }

}