/* ==========================================================================
   CustomBadges — Profile Preview page
   A live Discord profile popout, rebuilt in Discord's *native dark theme
   layout* but recolored to true black (#000000 / #050505 / #0b0b0b)
   instead of Discord's usual dark-gray surfaces. Purpose: let people see
   exactly how their badge sits on a real profile card before they ship it.
   ========================================================================== */

.profile-hero{ text-align:center; }
.profile-hero .tag{
  font-family:var(--font-mono); font-weight:500; font-size:12px; letter-spacing:2px;
  color:var(--violet); margin-bottom:14px; display:block; text-transform:uppercase;
}
.profile-hero h1{
  font-family:var(--font-display); font-size:clamp(28px,3.8vw,42px); font-weight:700; letter-spacing:-0.01em;
}
.profile-hero p{ color:var(--text-dim); margin:14px auto 0; max-width:600px; font-size:15.5px; line-height:1.65; }

/* ---------- Lab layout: form + live preview ---------- */
.profile-lab{
  display:grid; grid-template-columns:minmax(0,420px) minmax(0,1fr);
  gap:28px; align-items:start; max-width:1080px; margin:44px auto 0;
}

/* ---------- Form (left) ---------- */
.pf-panel{
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:22px; display:flex; flex-direction:column; gap:18px;
}
.pf-panel-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pf-panel-head h3{ font-family:var(--font-display); font-size:15px; font-weight:600; }
.pf-reset{
  font-family:var(--font-mono); font-size:11px; letter-spacing:0.4px; text-transform:uppercase;
  color:var(--text-dim); background:rgba(255,255,255,0.05); border:1px solid var(--border);
  border-radius:20px; padding:6px 12px; cursor:pointer; transition:color .2s, border-color .2s, background .2s;
}
.pf-reset:hover{ color:var(--violet); border-color:var(--border-hover); background:rgba(143,125,255,0.1); }

.pf-field{ display:flex; flex-direction:column; gap:6px; }
.pf-field label{
  font-family:var(--font-mono); font-size:11px; letter-spacing:0.5px; text-transform:uppercase; color:var(--text-faint);
}
.pf-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }

.pf-field input[type="text"],
.pf-field input[type="url"],
.pf-field input[type="date"],
.pf-field select,
.pf-field textarea{
  width:100%; background:var(--bg-raised); color:var(--text); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:10px 12px; font-family:var(--font-body); font-size:13.5px;
  outline:none; transition:border-color .2s, box-shadow .2s;
}
.pf-field textarea{ resize:vertical; min-height:70px; line-height:1.5; }
.pf-field input:focus, .pf-field select:focus, .pf-field textarea:focus{
  border-color:var(--border-hover); box-shadow:0 0 0 3px rgba(143,125,255,0.14);
}
.pf-hint{ color:var(--text-faint); font-size:11px; }

/* banner swatches */
.pf-swatches{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.pf-swatch{
  width:26px; height:26px; border-radius:50%; border:2px solid transparent; cursor:pointer;
  padding:0; box-shadow:0 0 0 1px var(--border); transition:transform .15s, box-shadow .15s;
}
.pf-swatch:hover{ transform:translateY(-1px); }
.pf-swatch.active{ box-shadow:0 0 0 2px var(--bg-card), 0 0 0 4px var(--violet); }
.pf-swatch-custom{
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-raised); color:var(--text-dim); font-size:14px;
}
.pf-color-input{ width:26px; height:26px; padding:0; border:none; border-radius:50%; overflow:hidden; cursor:pointer; background:none; }
.pf-color-input::-webkit-color-swatch-wrapper{ padding:0; }
.pf-color-input::-webkit-color-swatch{ border:2px solid var(--border); border-radius:50%; }

/* ---------- Badge style controls ---------- */
.pf-subhead{
  font-family:var(--font-mono); font-size:11px; letter-spacing:0.6px; text-transform:uppercase;
  color:var(--violet); margin:6px 0 -6px; display:flex; align-items:center; gap:8px;
}
.pf-subhead::after{ content:""; flex:1; height:1px; background:var(--border); }

.pf-choice-row{ display:flex; gap:8px; flex-wrap:wrap; }
.pf-choice{
  font-family:var(--font-mono); font-size:11.5px; letter-spacing:0.3px;
  padding:8px 14px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--bg-raised); color:var(--text-dim); cursor:pointer;
  transition:border-color .2s, background .2s, color .2s;
}
.pf-choice:hover{ border-color:var(--border-hover); color:var(--text); }
.pf-choice.active{ border-color:var(--violet); background:rgba(143,125,255,0.12); color:var(--violet); }

.pf-field input[type="range"]{
  width:100%; accent-color:var(--violet); cursor:pointer; height:4px;
}
.pf-field label span{ color:var(--text-faint); font-weight:400; text-transform:none; letter-spacing:0; font-family:var(--font-mono); font-size:11px; }

.pf-color-field{ display:flex; align-items:center; gap:10px; }
.pf-color-field input[type="color"]{ width:30px; height:30px; padding:0; border:none; border-radius:8px; overflow:hidden; cursor:pointer; background:none; flex-shrink:0; }
.pf-color-field input[type="color"]::-webkit-color-swatch-wrapper{ padding:0; }
.pf-color-field input[type="color"]::-webkit-color-swatch{ border:2px solid var(--border); border-radius:8px; }
.pf-color-field span{ font-family:var(--font-mono); font-size:12px; color:var(--text-faint); letter-spacing:0.3px; }


/* the featured badge's own look, driven live by the Badge style panel */
.dc-badges-row{ position:relative; }
#badge-custom.dc-badge-featured{
  width:var(--badge-size, 24px); height:var(--badge-size, 24px);
  border-radius:var(--badge-radius, 50%);
  transition:transform .18s ease, box-shadow .18s ease, border-radius .18s ease, width .18s ease, height .18s ease;
}
#badge-custom.dc-badge-featured.hover-scale:hover{ transform:translateY(-3px) scale(1.14); }
#badge-custom.dc-badge-featured.hover-glow:hover{
  box-shadow:0 0 0 3px var(--badge-glow, rgba(143,125,255,0.55)), 0 0 18px var(--badge-glow, rgba(143,125,255,0.6));
}

/* the badge's popup card, shown on hover of #badge-custom */
.badge-style-popup{
  position:absolute; bottom:calc(100% + 10px); left:0;
  display:flex; align-items:center; gap:10px;
  min-width:150px; padding:9px 13px; border-radius:10px; border:1px solid var(--dc-border);
  box-shadow:0 14px 30px rgba(0,0,0,0.55); pointer-events:none; opacity:0; z-index:20; white-space:nowrap;
}
.badge-style-popup .bsp-icon{ width:20px; height:20px; border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--dc-bg-3); }
.badge-style-popup .bsp-text{ display:flex; flex-direction:column; gap:1px; }
.badge-style-popup .bsp-name{ font-family:var(--font-body); font-size:12.5px; font-weight:600; line-height:1.2; }
.badge-style-popup .bsp-sub{ font-family:var(--font-mono); font-size:10px; color:var(--dc-text-faint); letter-spacing:0.3px; }

.badge-style-popup[data-anim="fade"]{ transition:opacity .18s ease; }
.badge-style-popup[data-anim="scale"]{ transition:opacity .16s ease, transform .18s cubic-bezier(.2,.9,.3,1.4); transform:scale(.82); transform-origin:left bottom; }
.badge-style-popup[data-anim="scale"].show{ transform:scale(1); }
.badge-style-popup[data-anim="slide"]{ transition:opacity .16s ease, transform .18s ease; transform:translateY(8px); }
.badge-style-popup[data-anim="slide"].show{ transform:translateY(0); }
.badge-style-popup.show{ opacity:1; }

/* badge picker */
.pf-badges{ display:flex; flex-direction:column; gap:8px; }
.pf-badge-opt{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--bg-raised); cursor:pointer; transition:border-color .2s, background .2s;
}
.pf-badge-opt:hover{ border-color:var(--border-hover); }
.pf-badge-opt input{ accent-color:var(--violet); width:15px; height:15px; flex-shrink:0; }
.pf-badge-opt .pf-badge-icon{
  width:22px; height:22px; border-radius:50%; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.pf-badge-opt .pf-badge-icon img{ width:100%; height:100%; object-fit:cover; }
.pf-badge-opt .pf-badge-icon svg{ width:13px; height:13px; }
.pf-badge-opt span.pf-badge-label{ font-size:13px; color:var(--text); flex:1; }
.pf-badge-opt.feature{ border-color:rgba(143,125,255,0.35); background:rgba(143,125,255,0.06); }
.pf-badge-opt.feature .pf-badge-icon{ box-shadow:0 0 0 2px rgba(143,125,255,0.4), 0 0 12px rgba(143,125,255,0.35); }

/* ---------- Discord card (right) — true black native dark theme ---------- */
.dc-shell{
  --dc-bg-0:#000000;         /* app background — pure black, not Discord's usual #313338 */
  --dc-bg-1:#050505;         /* floating popout surface */
  --dc-bg-2:#0b0b0b;         /* raised sections inside the popout */
  --dc-bg-3:#111111;         /* inputs / pills */
  --dc-border:rgba(255,255,255,0.07);
  --dc-divider:rgba(255,255,255,0.09);
  --dc-text:#f2f3f5;
  --dc-text-muted:#9a9fa6;
  --dc-text-faint:#6b6f76;
  --dc-blurple:#5865f2;
  --dc-green:#23a55a;
  --dc-yellow:#f0b232;
  --dc-red:#f23f42;
  --dc-gray-status:#80848e;

  position:sticky; top:96px;
  background:var(--dc-bg-0);
  border:1px solid var(--dc-border);
  border-radius:16px;
  padding:26px;
  box-shadow:0 30px 70px rgba(0,0,0,0.55);
  color:var(--dc-text);
  font-family:var(--font-body);
}
.dc-shell-label{
  display:flex; align-items:center; gap:8px; margin-bottom:18px;
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:1.5px; text-transform:uppercase; color:var(--dc-text-faint);
}
.dc-shell-label .dot{ width:6px; height:6px; border-radius:50%; background:var(--dc-green); box-shadow:0 0 6px var(--dc-green); }

.dc-card{
  width:100%; max-width:340px; margin:0 auto;
  background:var(--dc-bg-1); border:1px solid var(--dc-border); border-radius:12px;
  overflow:hidden; box-shadow:0 20px 50px rgba(0,0,0,0.6);
}

.dc-banner{
  height:90px; position:relative;
  background-image:linear-gradient(135deg, var(--violet), var(--foil));
}

.dc-avatar-row{ position:relative; padding:0 16px; margin-top:-38px; }
.dc-avatar-wrap{ position:relative; width:76px; height:76px; }
.dc-avatar{
  width:76px; height:76px; border-radius:50%; object-fit:cover; display:block;
  border:6px solid var(--dc-bg-1); background:var(--dc-bg-2);
}
.dc-status{
  position:absolute; right:2px; bottom:2px; width:20px; height:20px; border-radius:50%;
  background:var(--dc-green); border:5px solid var(--dc-bg-1);
}
.dc-status[data-status="idle"]{ background:var(--dc-yellow); }
.dc-status[data-status="dnd"]{ background:var(--dc-red); }
.dc-status[data-status="offline"]{ background:var(--dc-gray-status); }
.dc-status[data-status="dnd"]::after{
  content:""; position:absolute; inset:5px; border-radius:2px; background:var(--dc-bg-1);
}

.dc-tabs{
  display:flex; gap:4px; padding:14px 16px 0; border-bottom:1px solid var(--dc-divider); margin-top:10px;
}
.dc-tab{
  all:unset; cursor:pointer; box-sizing:border-box;
  padding:8px 4px; margin-right:14px; font-size:12.5px; font-weight:600; color:var(--dc-text-muted);
  border-bottom:2px solid transparent; transition:color .2s, border-color .2s;
}
.dc-tab:hover{ color:var(--dc-text); }
.dc-tab.active{ color:var(--dc-text); border-color:var(--dc-blurple); }

.dc-panel{ padding:16px; display:flex; flex-direction:column; gap:14px; }
.dc-panel[hidden]{ display:none; }

.dc-namecard{ display:flex; flex-direction:column; gap:2px; }
.dc-display-name{ font-family:var(--font-display); font-size:17px; font-weight:700; line-height:1.25; word-break:break-word; }
.dc-username-row{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.dc-username{ font-size:12.5px; color:var(--dc-text-muted); }
.dc-pronouns{
  font-size:11px; color:var(--dc-text-faint); background:var(--dc-bg-3); border-radius:4px; padding:1px 6px;
}

.dc-badges-row{ display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.dc-badge{
  width:24px; height:24px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--dc-bg-3); border:1px solid var(--dc-border); overflow:hidden; position:relative;
  transition:transform .15s ease;
}
.dc-badge:hover{ transform:translateY(-2px); }
.dc-badge img{ width:100%; height:100%; object-fit:cover; }
.dc-badge svg{ width:14px; height:14px; }
.dc-badge.dc-badge-featured{ box-shadow:0 0 0 2px rgba(143,125,255,0.45), 0 0 14px rgba(143,125,255,0.4); }

.dc-divider{ height:1px; background:var(--dc-divider); border:none; margin:0; }

.dc-section-title{
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:0.8px; text-transform:uppercase;
  color:var(--dc-text-faint); margin-bottom:6px;
}
.dc-about{ font-size:13px; line-height:1.55; color:var(--dc-text); white-space:pre-line; word-break:break-word; }
.dc-about:empty::before{ content:"No about me yet."; color:var(--dc-text-faint); font-style:italic; }

.dc-member-since{ display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--dc-text); }
.dc-member-since svg{ width:14px; height:14px; color:var(--dc-text-faint); flex-shrink:0; }

.dc-roles{ display:flex; flex-wrap:wrap; gap:6px; }
.dc-role-pill{
  display:inline-flex; align-items:center; gap:6px;
  background:var(--dc-bg-3); border:1px solid var(--dc-border); border-radius:20px;
  padding:4px 10px 4px 6px; font-size:12px; color:var(--dc-text);
}
.dc-role-pill::before{
  content:""; width:8px; height:8px; border-radius:50%; background:var(--role-color, var(--dc-blurple));
}
.dc-roles:empty::before{ content:"No roles yet."; color:var(--dc-text-faint); font-style:italic; font-size:12px; }

.dc-note{
  background:var(--dc-bg-2); border:1px solid var(--dc-border); border-radius:8px; padding:10px 12px;
}
.dc-note textarea{
  width:100%; background:transparent; border:none; outline:none; resize:none;
  color:var(--dc-text); font-family:var(--font-body); font-size:12.5px; min-height:36px; line-height:1.5;
}
.dc-note textarea::placeholder{ color:var(--dc-text-faint); }

.dc-empty-state{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px;
  padding:30px 10px; text-align:center; color:var(--dc-text-faint); font-size:12.5px;
}
.dc-empty-state svg{ width:34px; height:34px; opacity:0.5; }

/* ---------- Connect card ---------- */
.connect-lab-section{ max-width:760px; margin:0 auto; padding:32px 24px 0; }
.connect-card{
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:22px; display:flex; flex-direction:column; gap:14px;
}
.connect-actions{ display:flex; flex-direction:column; gap:12px; }
.connect-actions-row{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.connect-hint{ color:var(--text-faint); font-size:12.5px; line-height:1.5; }
.connect-token-row{ display:flex; gap:10px; flex-wrap:wrap; }
.connect-token-row input{
  flex:1; min-width:220px; background:var(--bg-raised); color:var(--text); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:10px 12px; font-family:var(--font-mono); font-size:12.5px; outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.connect-token-row input:focus{ border-color:var(--border-hover); box-shadow:0 0 0 3px rgba(143,125,255,0.14); }

.connect-connected{ display:flex; align-items:center; gap:14px; }
.connect-avatar-thumb{ width:44px; height:44px; border-radius:50%; object-fit:cover; border:2px solid var(--border-hover); flex-shrink:0; background:var(--bg-raised); }
.connect-connected-text{ display:flex; flex-direction:column; gap:2px; flex:1; min-width:0; }
.connect-connected-name{ font-family:var(--font-display); font-weight:600; font-size:15px; }
.connect-connected-sub{ font-family:var(--font-mono); font-size:11px; color:var(--green); letter-spacing:0.3px; }

.connect-status{ font-size:13px; line-height:1.5; padding:10px 14px; border-radius:var(--radius-sm); }
.connect-status.error{ background:rgba(242,63,66,0.1); color:#ff8a8c; border:1px solid rgba(242,63,66,0.3); }
.connect-status.pending{ background:rgba(143,125,255,0.08); color:var(--violet); border:1px solid var(--border-hover); }
.connect-status.success{ background:rgba(99,224,160,0.1); color:var(--green); border:1px solid rgba(99,224,160,0.3); }

/* ---------- Owned badges list ---------- */
.owned-badges-list{ display:flex; flex-direction:column; gap:8px; }
.owned-badges-list:empty::after{
  content:"You don't have any badges yet — add one below."; color:var(--text-faint); font-size:12.5px; font-style:italic;
}
.owned-badge-row{
  display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius-sm);
  border:1px solid var(--border); background:var(--bg-raised);
}
.owned-badge-row img{ width:28px; height:28px; border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--bg-card); }
.owned-badge-row .obr-name{ flex:1; min-width:0; font-size:13px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.owned-badge-row .obr-btn{
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:0.3px; text-transform:uppercase;
  padding:5px 10px; border-radius:16px; border:1px solid var(--border); background:transparent; color:var(--text-dim); cursor:pointer;
  transition:color .2s, border-color .2s, background .2s;
}
.owned-badge-row .obr-btn:hover{ color:var(--violet); border-color:var(--border-hover); background:rgba(143,125,255,0.1); }
.owned-badge-row .obr-btn.active{ color:var(--green); border-color:rgba(99,224,160,0.4); background:rgba(99,224,160,0.1); cursor:default; }
.owned-badge-row .obr-remove{ color:var(--text-faint); }
.owned-badge-row .obr-remove:hover{ color:#ff8a8c; border-color:rgba(242,63,66,0.4); background:rgba(242,63,66,0.1); }
.owned-badge-row .obr-edit:hover{ color:var(--foil); border-color:rgba(99,232,212,0.4); background:rgba(99,232,212,0.1); }

.owned-badge-row.editing{ flex-wrap:wrap; align-items:stretch; gap:8px 10px; }
.owned-badge-row.editing img{ align-self:center; }
.obr-edit-fields{
  flex:1 1 100%; display:flex; flex-direction:column; gap:6px; order:2;
}
.obr-edit-fields input{
  width:100%; background:var(--bg-card); color:var(--text); border:1px solid var(--border);
  border-radius:var(--radius-sm); padding:7px 9px; font-size:12.5px; font-family:inherit;
}
.obr-edit-fields input:focus{ outline:none; border-color:var(--violet); }
.obr-edit-actions{ flex:1 1 100%; order:3; display:flex; gap:8px; justify-content:flex-end; }
.obr-btn.obr-save{ color:var(--green); border-color:rgba(99,224,160,0.4); }
.obr-btn.obr-save:hover{ background:rgba(99,224,160,0.12); }
.obr-style-note{ margin:2px 0 0; font-size:11.5px; color:var(--text-faint); font-style:italic; }

@media (max-width:900px){
  .profile-lab{ grid-template-columns:1fr; max-width:460px; }
  .dc-shell{ position:static; }
}
@media (max-width:600px){
  .pf-row{ grid-template-columns:1fr; }
  .connect-token-row input{ min-width:0; }
}
