/* ═══════════════════════════════════════════════
   FILE: styles/theme-picker.css
   RESPONSIBILITY: Theme onboarding overlay,
     theme card grid, profile theme switcher.
   ═══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   ONBOARDING OVERLAY
   ══════════════════════════════════════════════ */
#theme-onboarding {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #F7F3EC;
  overflow-y: auto;
  animation: tob-fade-in .4s ease;
}
#theme-onboarding.open { display: block; }
@keyframes tob-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tob-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 60px;
  text-align: center;
}

/* Decorative top illustration */
.tob-illo {
  width: 140px;
  height: 140px;
  margin: 0 auto 28px;
  display: block;
}

.tob-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #C8A84B;
  margin-bottom: 10px;
}

.tob-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: #1C1C2E;
  line-height: 1.2;
  margin-bottom: 10px;
}

.tob-sub {
  font-size: .95rem;
  color: #6B7280;
  margin-bottom: 36px;
  line-height: 1.6;
}

/* ── Theme cards grid ── */
.tob-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
  text-align: left;
}

.tob-theme-card {
  border: 2.5px solid transparent;
  border-radius: 18px;
  padding: 0;
  cursor: pointer;
  transition: all .22s cubic-bezier(.34,1.56,.64,1);
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  overflow: hidden;
  position: relative;
}
.tob-theme-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,.13);
}
.tob-theme-card.sel {
  border-color: var(--tc-accent, #C8A84B);
  box-shadow: 0 0 0 4px rgba(200,168,75,.2), 0 8px 30px rgba(0,0,0,.12);
  transform: translateY(-4px);
}
.tob-theme-card.sel .tob-check {
  opacity: 1;
  transform: scale(1);
}

/* Colour preview swatch at top */
.tob-swatch {
  height: 80px;
  display: flex;
  align-items: flex-end;
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}
.tob-swatch-illo {
  position: absolute;
  right: 8px;
  bottom: 4px;
  opacity: .85;
  width: 60px;
  height: 60px;
}

/* Check badge */
.tob-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  opacity: 0;
  transform: scale(.6);
  transition: all .2s cubic-bezier(.34,1.56,.64,1);
  z-index: 2;
}

.tob-card-info {
  padding: 12px 14px 14px;
}
.tob-card-name {
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 3px;
  color: #1C1C2E;
}
.tob-card-desc {
  font-size: .72rem;
  color: #6B7280;
  line-height: 1.4;
}

/* Colour dot row */
.tob-dots {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.tob-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid rgba(0,0,0,.08);
}

/* CTA button */
.tob-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  background: #1C1C2E;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 4px 20px rgba(28,28,46,.25);
}
.tob-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(28,28,46,.3);
}
.tob-cta:active { transform: translateY(0); }

.tob-skip {
  display: block;
  margin-top: 14px;
  font-size: .82rem;
  color: #9CA3AF;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tob-skip:hover { color: #6B7280; }

/* ══════════════════════════════════════════════
   PROFILE PAGE THEME SWITCHER
   ══════════════════════════════════════════════ */
.theme-switcher-section {
  background: var(--white);
  border-radius: var(--r);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.theme-switcher-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--ink);
}
.theme-switcher-sub {
  font-size: .8rem;
  color: var(--mid);
  margin-bottom: 18px;
}
.theme-switcher-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ts-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.ts-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.ts-card.sel {
  border-color: var(--theme-accent, var(--gold));
  box-shadow: 0 0 0 3px rgba(200,168,75,.2);
}
.ts-card.sel .ts-check { opacity: 1; transform: scale(1); }
.ts-swatch {
  height: 44px;
  position: relative;
}
.ts-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  opacity: 0;
  transform: scale(.5);
  transition: all .18s cubic-bezier(.34,1.56,.64,1);
}
.ts-name {
  font-size: .72rem;
  font-weight: 600;
  padding: 6px 8px 7px;
  color: var(--ink);
  background: var(--card);
  text-align: center;
}

/* ══════════════════════════════════════════════
   NAV THEME BUTTON (tiny palette icon)
   ══════════════════════════════════════════════ */
#nav-theme-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .9rem;
  transition: all .2s;
  flex-shrink: 0;
  padding: 0;
}
#nav-theme-btn:hover { background: rgba(255,255,255,.12); }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */
@media(max-width:600px) {
  .tob-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .tob-swatch { height: 64px; }
  .tob-wrap { padding: 32px 16px 48px; }
  .tob-illo { width: 100px; height: 100px; margin-bottom: 20px; }
  .tob-cta { padding: 14px 32px; font-size: .95rem; }

  .theme-switcher-grid { grid-template-columns: repeat(2, 1fr); }
  .theme-switcher-section { padding: 18px 16px; }
}
