/* Xynox Forge Workshop — static styles */
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700;800&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --background: #05060a;
  --foreground: #f7f7fb;
  --muted: #12141c;
  --muted-foreground: #8b8fa3;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #9c24ff;
  --cyan-glow: #0ff5ff;
  --violet-glow: #9c24ff;
  --magenta-glow: #ff3ed5;
  --gradient-signature: linear-gradient(135deg, #0ff5ff 0%, #9c24ff 55%, #ff3ed5 100%);
  --shadow-glow: 0 0 40px -8px rgba(156, 36, 255, 0.55), 0 0 80px -20px rgba(15, 245, 255, 0.35);
  --font-display: "Sora", system-ui, sans-serif;
  --font-sans: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--background); color: var(--foreground); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
button { font-family: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: rgba(156, 36, 255, 0.45); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(15,245,255,0.3), rgba(255,62,213,0.3)); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(15,245,255,0.5), rgba(255,62,213,0.5)); }

.gradient-text {
  background: var(--gradient-signature);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.gradient-bg { background: var(--gradient-signature); }
.glow { box-shadow: var(--shadow-glow); }
.surface {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
}

.channel-name-bg {
  background-color: var(--muted);
}

/* Ambient */
.ambient { pointer-events: none; position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.ambient .blob { position: absolute; width: 500px; height: 500px; border-radius: 50%; filter: blur(80px); }
.ambient .cyan { top: -160px; left: -160px; background: radial-gradient(circle, rgba(15,245,255,0.15), transparent 60%); }
.ambient .magenta { top: 50%; right: -160px; background: radial-gradient(circle, rgba(255,62,213,0.15), transparent 60%); }

/* Layout */
.shell { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; }
@media (min-width: 900px) { .shell { flex-direction: row; } }

/* Sidebar */
.sidebar {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) {
  .sidebar {
    position: sticky; top: 0;
    height: 100vh; width: 288px; flex-shrink: 0;
    border-right: 1px solid var(--border);
    border-bottom: none;
    overflow-y: auto;
    display: flex; flex-direction: column;
  }
}
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-foreground); font-size: 14px; margin-bottom: 32px; transition: color 0.2s; }
.back-link:hover { color: var(--foreground); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.brand-mark {
  height: 36px;
  width: 36px;
  display: grid;
  place-items: center;
  border-radius: 5px; 
  /* background: var(--gradient-signature); */
  /* font-family: var(--font-display); */
  /* font-weight: 900; */
  /* color: var(--background); */
}
.brand-name { font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); }

.tabs { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 8px; }
@media (min-width: 900px) { .tabs { flex-direction: column; overflow: visible; padding-bottom: 0; } }
.tab-btn {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
  padding: 10px 12px; border-radius: 12px; border: 0;
  background: transparent; color: var(--muted-foreground);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s ease; white-space: nowrap;
}
.tab-btn:hover { background: rgba(255,255,255,0.03); color: var(--foreground); }
.tab-btn.active {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  color: var(--foreground);
  box-shadow: inset 0 0 0 1px rgba(156,36,255,0.4);
}
.tab-btn.active svg { color: var(--cyan-glow); }
.tab-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.side-note {
  margin-top: auto; padding-top: 24px; display: none;
}
@media (min-width: 900px) { .side-note { display: block; } }
.side-note .box {
  padding: 16px; border-radius: 12px; font-size: 12px; color: var(--muted-foreground);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
}

/* Main */
.main { min-width: 0; flex: 1; padding: 24px; }
@media (min-width: 900px) { .main { padding: 40px; } }

.tab-header { margin-bottom: 32px; }
.tab-header h1 { font-size: 32px; font-weight: 700; }
@media (min-width: 768px) { .tab-header h1 { font-size: 36px; } }
.tab-header p { color: var(--muted-foreground); margin-top: 8px; }

.text-input, .select-input, .textarea-input {
  width: 100%; padding: 14px 20px; border-radius: 12px; font-size: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06); color: var(--foreground);
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.text-input:focus, .select-input:focus, .textarea-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(156, 36, 255, 0.25);
}
.text-input::placeholder, .textarea-input::placeholder { color: var(--muted-foreground); }
.mb-8 { margin-bottom: 32px; }

.search-wrap { position: relative; margin-bottom: 32px; }
.search-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); width: 16px; height: 16px; pointer-events: none; }
.search-wrap input { padding-left: 44px; }

/* Copyable */
.copyable {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 12px; border-radius: 12px; cursor: pointer;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06); color: var(--foreground);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  font-family: inherit; font-size: 16px;
}
.copyable:hover { border-color: rgba(156, 36, 255, 0.4); transform: translateY(-2px); box-shadow: 0 8px 24px -12px rgba(156,36,255,0.4); }
.copyable.small { padding: 12px; text-align: center; }
.copyable .badge {
  position: absolute; top: 6px; right: 6px; padding: 4px; border-radius: 6px;
  opacity: 0; transition: opacity 0.2s;
  display: grid; place-items: center;
}
.copyable:hover .badge { opacity: 1; }
.copyable.copied .badge { opacity: 1; background: var(--gradient-signature); color: var(--background); }
.copyable .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.15em; color: var(--muted-foreground); }
.copyable { min-width: 0; }
.copyable .output { margin-top: 6px; font-size: 20px; overflow-wrap: anywhere; word-break: break-word; white-space: normal; }

/* Grids */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-3 { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.grid-emoji { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .grid-emoji { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (min-width: 768px) { .grid-emoji { grid-template-columns: repeat(10, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-emoji { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.grid-brackets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid-brackets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .grid-brackets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-brackets { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid-swatches { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }

.group-section { margin-bottom: 32px; }
.group-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground);
  margin-bottom: 12px;
}

.divider-line { text-align: center; font-family: ui-monospace, monospace; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bracket-cell { text-align: center; font-size: 22px; }
.emoji-cell { font-size: 22px; line-height: 1; }

/* Templates */
.tpl-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
.tpl-card {
  padding: 24px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
}
.tpl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tpl-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.tpl-tagline { color: var(--muted-foreground); font-size: 14px; margin-top: 4px; }
.tpl-cat { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); margin-bottom: 8px; }
.tpl-channels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tpl-channel { padding: 8px 10px; font-size: 12px; }
.copy-all-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 0; color: var(--foreground);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.2s;
}
.copy-all-btn:hover { border-color: rgba(156, 36, 255, 0.4); }
.copy-all-btn.copied { background: var(--gradient-signature); color: var(--background); border-color: transparent; }
.copy-all-btn svg { width: 14px; height: 14px; }

/* Roles */
.role-swatch { padding: 0; overflow: hidden; }
.role-swatch .swatch { aspect-ratio: 1 / 1; width: 100%; }
.role-swatch .hex { padding: 4px; text-align: center; font-family: ui-monospace, monospace; font-size: 10px; color: var(--muted-foreground); }

/* Embed */
.embed-grid { display: grid; gap: 24px; }
@media (min-width: 1024px) { .embed-grid { grid-template-columns: repeat(2, 1fr); } }
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; color: var(--muted-foreground); }
.color-row { display: flex; gap: 12px; }
.color-picker { height: 44px; width: 56px; padding: 4px; border-radius: 8px; cursor: pointer; background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)); border: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.embed-preview-wrap { min-width: 0; }
.embed-preview {
  padding: 16px; border-radius: 12px; background: #2b2d31; margin-bottom: 16px;
}
.embed-inner { display: flex; gap: 12px; padding: 12px; border-radius: 6px; background: #2b2d31; border-left: 4px solid #9c24ff; }
.embed-body { min-width: 0; flex: 1; }
.embed-author { font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.9); margin-bottom: 4px; word-wrap: break-word; }
.embed-title { font-weight: 600; color: #fff; margin-bottom: 4px; word-wrap: break-word; }
.embed-desc { font-size: 14px; color: rgba(255,255,255,0.8); white-space: pre-wrap; word-wrap: break-word; }
.embed-img { margin-top: 8px; width: 100%; max-height: 192px; object-fit: cover; border-radius: 6px; }
.embed-thumb { width: 64px; height: 64px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.embed-footer { margin-top: 8px; font-size: 12px; color: rgba(255,255,255,0.5); word-wrap: break-word; }
.json-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.json-block {
  max-height: 320px; overflow: auto; padding: 16px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted-foreground);
  white-space: pre-wrap; word-break: break-all; margin: 0;
}

/* Channels tab */
.chan-grid { display: grid; gap: 16px; margin-bottom: 32px; }
@media (min-width: 768px) { .chan-grid { grid-template-columns: repeat(3, 1fr); } .chan-grid .full { grid-column: span 3; } .chan-grid .two { grid-column: span 2; } }
.primary-out { padding: 24px !important; }
.primary-out .output { font-size: 26px; font-weight: 600; margin-top: 8px; }

.hide { display: none !important; }
