/* ============================================================
   XYSHIMA — Theme Studio + topbar alignment
   ============================================================ */

/* ---------- Topbar: keep the Pro / AI badge inside the 64px bar ---------- */
.topbar { align-items: center; }
.topbar-right {
  align-self: stretch;
  display: flex;
  align-items: center;
  min-width: 0;
}
.btn-pro {
  align-self: center;
  justify-content: center;
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  padding: 0 16px;
  line-height: 1;
  flex: 0 0 auto;
}
.btn-pro svg { flex: 0 0 auto; }
#proLabel {
  display: block;
  white-space: nowrap;
  line-height: 1.15;
  text-align: center;
}

/* ============================================================
   THEME 7 — NEON TECH
   ============================================================ */
[data-theme="neon"] {
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-accent: 'Outfit', system-ui, sans-serif;

  --bg: #050b14;
  --canvas: #07111f;
  --surface: #0c1727;
  --surface-2: #111f33;
  --surface-3: #172a43;
  --border: #1b3552;
  --border-strong: #285276;

  --text: #eefcff;
  --text-dim: #93adbd;
  --text-faint: #647f91;

  --accent: #14e7ff;
  --accent-2: #6d5dfc;
  --accent-3: #19f5b8;
  --on-accent: #041018;
  --accent-soft: #0b3341;
  --accent-grad: linear-gradient(90deg, #14e7ff, #6d5dfc);

  --sidebar-bg: #07111f;
  --sidebar-active: linear-gradient(90deg, rgba(20,231,255,.18), rgba(109,93,252,.08));
  --topbar-bg: #07111f;

  --ok: #19f5b8;
  --warn: #ffd166;
  --bad: #ff6b91;
  --info: #75a7ff;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-sm: 9px;
  --shadow: 0 0 0 1px rgba(20,231,255,.03), 0 12px 34px rgba(0,0,0,.26);
  --shadow-lg: 0 18px 54px rgba(20,231,255,.11);
  --ring-track: #173048;
  --deco-opacity: 0;
  --letter: .005em;
}
[data-theme="neon"] body {
  background-color: #050b14;
  background-image:
    radial-gradient(circle at 82% 8%, rgba(20,231,255,.12), transparent 27rem),
    radial-gradient(circle at 12% 82%, rgba(109,93,252,.12), transparent 29rem),
    linear-gradient(135deg, rgba(255,255,255,.012), transparent 45%);
}
[data-theme="neon"] .card {
  background: linear-gradient(145deg, rgba(12,23,39,.98), rgba(8,18,31,.98));
  border-color: rgba(68,164,213,.18);
}
[data-theme="neon"] .sidebar { background: linear-gradient(180deg,#06101d,#081523); }
[data-theme="neon"] .brand-sub { color:#63ddec; }
[data-theme="neon"] .brand-name {
  background: linear-gradient(90deg,#14e7ff,#6d5dfc,#19f5b8);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}

/* ============================================================
   THEME 8 — FOREST CALM
   ============================================================ */
[data-theme="forest"] {
  --font-display: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, serif;

  --bg: #f5f8f3;
  --canvas: #f7faf6;
  --surface: #ffffff;
  --surface-2: #f0f6f1;
  --surface-3: #e3efe6;
  --border: #d9e7dc;
  --border-strong: #bfd5c5;

  --text: #183329;
  --text-dim: #688074;
  --text-faint: #91a89b;

  --accent: #2f6f57;
  --accent-2: #8bbf9f;
  --accent-3: #1f5842;
  --on-accent: #ffffff;
  --accent-soft: #dfece4;
  --accent-grad: linear-gradient(90deg,#2f6f57,#74aa8b);

  --sidebar-bg: #edf5ef;
  --sidebar-active: #dcece1;
  --topbar-bg: #fbfdfb;

  --ok: #2f855a;
  --warn: #b7791f;
  --bad: #c0564a;
  --info: #477a91;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24,51,41,.04),0 10px 28px rgba(46,94,71,.055);
  --shadow-lg: 0 18px 45px rgba(46,94,71,.10);
  --ring-track: #e0ece3;
  --deco-opacity: 0;
  --letter: 0;
}
[data-theme="forest"] body {
  background-color:#f5f8f3;
  background-image:
    radial-gradient(circle at 7% 5%, rgba(139,191,159,.18), transparent 27rem),
    radial-gradient(circle at 94% 86%, rgba(47,111,87,.07), transparent 30rem);
}
[data-theme="forest"] .sidebar { background:linear-gradient(180deg,#edf5ef,#e8f1ea); }
[data-theme="forest"] .card { border-color:rgba(47,111,87,.12); }
[data-theme="forest"] .brand-name {
  background:linear-gradient(90deg,#27644e,#5e9b78);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
[data-theme="forest"] .brand-sub { color:#4d7f66; }

/* ============================================================
   THEME 9 — MIDNIGHT GLASS
   ============================================================ */
[data-theme="midnight"] {
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-accent: 'Outfit', system-ui, sans-serif;

  --bg: #070a15;
  --canvas: #090d1b;
  --surface: rgba(22,28,51,.82);
  --surface-2: rgba(30,38,68,.78);
  --surface-3: rgba(42,52,88,.76);
  --border: rgba(139,156,255,.18);
  --border-strong: rgba(139,156,255,.32);

  --text: #f2f4ff;
  --text-dim: #a4acd0;
  --text-faint: #707a9d;

  --accent: #8b9cff;
  --accent-2: #55d6ff;
  --accent-3: #be8cff;
  --on-accent: #081020;
  --accent-soft: #20294d;
  --accent-grad: linear-gradient(90deg,#8b9cff,#55d6ff);

  --sidebar-bg: rgba(9,13,27,.92);
  --sidebar-active: linear-gradient(90deg,rgba(139,156,255,.22),rgba(85,214,255,.06));
  --topbar-bg: rgba(9,13,27,.90);

  --ok: #65e3b2;
  --warn: #f6c96a;
  --bad: #ff7e9f;
  --info: #6ebdff;
  --radius: 15px;
  --radius-lg: 20px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03),0 18px 45px rgba(0,0,0,.30);
  --shadow-lg: 0 24px 65px rgba(0,0,0,.40);
  --ring-track: #273252;
  --deco-opacity: 0;
  --letter: 0;
}
[data-theme="midnight"] body {
  background-color:#070a15;
  background-image:
    radial-gradient(circle at 78% -4%, rgba(85,214,255,.12), transparent 30rem),
    radial-gradient(circle at 18% 78%, rgba(139,156,255,.14), transparent 31rem),
    radial-gradient(circle at 94% 75%, rgba(190,140,255,.08), transparent 26rem);
}
[data-theme="midnight"] .topbar,
[data-theme="midnight"] .sidebar {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
[data-theme="midnight"] .card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background:linear-gradient(145deg,rgba(25,32,58,.86),rgba(14,19,37,.82));
}
[data-theme="midnight"] .brand-name {
  background:linear-gradient(90deg,#b8c3ff,#55d6ff);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
[data-theme="midnight"] .brand-sub { color:#92c9dd; }

/* ============================================================
   THEME 10 — WARM STUDY CAFÉ
   ============================================================ */
[data-theme="cafe"] {
  --font-display: 'DM Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-accent: 'Cormorant Garamond', Georgia, serif;

  --bg: #fbf5eb;
  --canvas: #fffaf2;
  --surface: #fffdf9;
  --surface-2: #f8efe3;
  --surface-3: #f1e3cf;
  --border: #eadac4;
  --border-strong: #d9c1a1;

  --text: #3f2a1e;
  --text-dim: #826955;
  --text-faint: #aa907b;

  --accent: #9a5f37;
  --accent-2: #d49a5b;
  --accent-3: #6f4228;
  --on-accent: #fffaf2;
  --accent-soft: #f3e2d2;
  --accent-grad: linear-gradient(90deg,#9a5f37,#d49a5b);

  --sidebar-bg: #f6ecdf;
  --sidebar-active: #ead9c6;
  --topbar-bg: #fffaf2;

  --ok: #64815d;
  --warn: #bd7b2e;
  --bad: #b85847;
  --info: #667e92;
  --radius: 13px;
  --radius-lg: 18px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(63,42,30,.04),0 10px 28px rgba(114,73,42,.06);
  --shadow-lg: 0 18px 45px rgba(114,73,42,.11);
  --ring-track: #eee0cf;
  --deco-opacity: 0;
  --letter: 0;
}
[data-theme="cafe"] body {
  background-color:#fbf5eb;
  background-image:
    radial-gradient(circle at 9% 8%, rgba(212,154,91,.13), transparent 25rem),
    radial-gradient(circle at 91% 84%, rgba(154,95,55,.08), transparent 28rem),
    repeating-linear-gradient(90deg,rgba(91,62,42,.012) 0 1px,transparent 1px 7px);
}
[data-theme="cafe"] .sidebar { background:linear-gradient(180deg,#f6ecdf,#f3e8d8); }
[data-theme="cafe"] .card { border-color:rgba(154,95,55,.13); }
[data-theme="cafe"] .brand-name {
  background:linear-gradient(90deg,#8b5534,#c9854f);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
}
[data-theme="cafe"] .brand-sub { color:#9a6f4c; }

/* ============================================================
   Theme Studio gallery
   ============================================================ */
.theme-studio-card { padding: 24px; }
.theme-studio-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:20px;
}
.theme-studio-head .card-title { margin:5px 0 7px; font-size:20px; }
.theme-studio-head .subtle { max-width:760px; line-height:1.55; }
.theme-count {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface-2);
  color:var(--text-dim);
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
}
.theme-studio-grid {
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}
.theme-studio-opt {
  position:relative;
  border:1px solid var(--border);
  border-radius:16px;
  overflow:hidden;
  background:var(--surface);
  box-shadow:0 1px 2px rgba(0,0,0,.02);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.theme-studio-opt:hover {
  transform:translateY(-4px);
  border-color:color-mix(in srgb,var(--accent) 46%,var(--border));
  box-shadow:var(--shadow-lg);
}
.theme-studio-opt.sel {
  border-color:var(--accent);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 14%,transparent),var(--shadow);
}
.theme-preview {
  position:relative;
  height:142px;
  overflow:hidden;
  display:grid;
  grid-template-columns:34px 1fr;
  background:
    radial-gradient(circle at 82% 18%,color-mix(in srgb,var(--tp-a) 44%,transparent),transparent 37%),
    linear-gradient(145deg,var(--tp-d),color-mix(in srgb,var(--tp-c) 75%,var(--tp-d)));
  isolation:isolate;
}
.theme-preview::after {
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(120deg,rgba(255,255,255,.08),transparent 28%,transparent 68%,rgba(255,255,255,.035));
  z-index:6;
}
.tp-noise {
  position:absolute;
  inset:0;
  z-index:0;
  opacity:.18;
  background-image:radial-gradient(circle at center,rgba(255,255,255,.25) 0 .65px,transparent .8px);
  background-size:9px 9px;
  mix-blend-mode:soft-light;
}
.tp-sidebar {
  position:relative;
  z-index:2;
  background:color-mix(in srgb,var(--tp-c) 72%,var(--tp-d));
  border-right:1px solid color-mix(in srgb,var(--tp-a) 22%,transparent);
  padding:14px 8px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.tp-sidebar i {
  display:block;
  height:5px;
  border-radius:999px;
  background:color-mix(in srgb,var(--tp-a) 54%,transparent);
  opacity:.75;
}
.tp-sidebar i:first-child { height:16px; width:16px; border-radius:5px; margin-bottom:6px; background:var(--tp-a); }
.tp-sidebar i:nth-child(3) { width:70%; }
.tp-stage { position:relative; z-index:2; padding:12px 12px 10px; min-width:0; }
.tp-top { display:flex; gap:5px; justify-content:flex-end; margin-bottom:9px; }
.tp-top span { width:19px; height:5px; border-radius:999px; background:color-mix(in srgb,var(--tp-a) 45%,transparent); }
.tp-title { width:48%; height:8px; border-radius:999px; background:color-mix(in srgb,var(--tp-a) 86%,var(--tp-b)); }
.tp-subtitle { width:68%; height:4px; border-radius:999px; margin-top:6px; background:color-mix(in srgb,var(--tp-b) 42%,transparent); }
.tp-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:13px; }
.tp-cards i {
  height:34px;
  border:1px solid color-mix(in srgb,var(--tp-a) 20%,transparent);
  border-radius:7px;
  background:color-mix(in srgb,var(--tp-d) 68%,transparent);
  box-shadow:0 4px 10px rgba(0,0,0,.06);
}
.tp-chart {
  position:absolute;
  left:12px;
  right:64px;
  bottom:12px;
  display:flex;
  align-items:flex-end;
  gap:4px;
  height:29px;
}
.tp-chart b { flex:1; border-radius:3px 3px 1px 1px; background:linear-gradient(180deg,var(--tp-a),var(--tp-b)); opacity:.8; }
.tp-chart b:nth-child(1){height:35%}.tp-chart b:nth-child(2){height:60%}.tp-chart b:nth-child(3){height:45%}.tp-chart b:nth-child(4){height:82%}.tp-chart b:nth-child(5){height:68%}
.tp-owl {
  position:absolute;
  z-index:4;
  right:7px;
  bottom:-8px;
  width:58px;
  height:82px;
  object-fit:contain;
  filter:drop-shadow(0 8px 12px rgba(0,0,0,.22));
}
.tp-glow {
  position:absolute;
  z-index:1;
  right:-26px;
  bottom:-34px;
  width:110px;
  height:110px;
  border-radius:50%;
  background:var(--tp-a);
  opacity:.18;
  filter:blur(18px);
}
.preview-dark .tp-stage { color:#fff; }
.preview-light .tp-sidebar { background:color-mix(in srgb,var(--tp-c) 82%,var(--tp-d)); }
.preview-light .tp-cards i { background:rgba(255,255,255,.62); }
.preview-light .tp-noise { opacity:.08; }
.theme-card-copy { padding:13px 14px 14px; }
.theme-card-title-row { display:flex; align-items:center; gap:8px; }
.theme-studio-opt .theme-name { padding:0; font-size:14px; line-height:1.25; }
.theme-badge {
  margin-left:auto;
  max-width:48%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:9.5px;
  font-weight:800;
  letter-spacing:.03em;
  text-transform:uppercase;
  color:var(--text-faint);
}
.theme-studio-opt .theme-desc { padding:5px 0 0; line-height:1.4; min-height:39px; }
.theme-status {
  display:inline-flex;
  margin-top:9px;
  min-height:24px;
  align-items:center;
  padding:0 8px;
  border-radius:999px;
  font-size:10.5px;
  font-weight:700;
  background:var(--surface-2);
  color:var(--text-dim);
  border:1px solid var(--border);
}
.theme-studio-opt.sel .theme-status {
  color:var(--accent);
  background:var(--accent-soft);
  border-color:transparent;
}

/* Slightly different preview atmospheres without downloading extra imagery. */
.theme-preview-genz,.theme-preview-neon { background-image:radial-gradient(circle at 78% 12%,rgba(34,211,238,.30),transparent 34%),radial-gradient(circle at 18% 82%,rgba(236,72,153,.22),transparent 40%),linear-gradient(145deg,var(--tp-d),var(--tp-c)); }
.theme-preview-halloween { background-image:radial-gradient(circle at 80% 8%,rgba(249,115,22,.38),transparent 34%),linear-gradient(145deg,var(--tp-d),#160c25); }
.theme-preview-girlish { background-image:radial-gradient(circle at 78% 10%,rgba(255,158,199,.55),transparent 36%),radial-gradient(circle at 20% 88%,rgba(192,132,252,.20),transparent 42%),linear-gradient(145deg,var(--tp-d),var(--tp-c)); }
.theme-preview-punk { background-image:linear-gradient(115deg,transparent 0 64%,rgba(255,30,109,.24) 64% 67%,transparent 67%),radial-gradient(circle at 84% 15%,rgba(182,255,46,.13),transparent 32%),linear-gradient(145deg,#050505,var(--tp-c)); }
.theme-preview-boho,.theme-preview-cafe { background-image:radial-gradient(circle at 82% 10%,color-mix(in srgb,var(--tp-a) 24%,transparent),transparent 38%),repeating-linear-gradient(0deg,rgba(84,66,45,.025) 0 1px,transparent 1px 6px),linear-gradient(145deg,var(--tp-d),var(--tp-c)); }
.theme-preview-forest { background-image:radial-gradient(circle at 80% 10%,rgba(139,191,159,.42),transparent 38%),radial-gradient(circle at 12% 90%,rgba(47,111,87,.12),transparent 42%),linear-gradient(145deg,var(--tp-d),var(--tp-c)); }
.theme-preview-midnight { background-image:radial-gradient(circle at 82% 8%,rgba(85,214,255,.28),transparent 37%),radial-gradient(circle at 10% 92%,rgba(139,156,255,.23),transparent 43%),linear-gradient(145deg,var(--tp-d),var(--tp-c)); }

@media (max-width:900px) {
  .topbar { padding-left:16px; padding-right:16px; }
  .topbar-right { gap:8px; }
  .btn-pro { padding:0 12px; }
  .theme-studio-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:620px) {
  .theme-studio-head { flex-direction:column; }
  .theme-studio-grid { grid-template-columns:1fr; }
  .theme-preview { height:150px; }
}
