/* Product Image Batch — 2026 sleek UI
   Self-contained (self-hosted Outfit font). Dark-first, glassmorphism,
   gradient accents, soft motion. Light mode via prefers-color-scheme. */

/* Brand font (self-hosted, same as dennisbf.design) */
@font-face {
  font-family: "Outfit Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit.woff2") format("woff2-variations");
}

/* ==========================================================================
   BRANDING — change these values to match your brand, everything follows.
   --accent   : solid accent (focus rings, links, active states)
   --grad     : the 2–3 stop gradient (logo, primary buttons, progress bars)
   --grad-soft: a faint tint of the gradient (pills, drag state)
   Presets (copy one over the block below):
     · dennisbf.design (current): #8b9cf5 | 135deg #9b7ef2, #8b7ff2, #7aa8ff (violet→periwinkle)
     · Indigo/Cyan:               #7c8cff | 135deg #6366f1, #8b5cf6, #22d3ee
     · Emerald:                   #34d399 | 135deg #059669, #10b981, #34d399
     · Sunset:                    #fb7185 | 135deg #f43f5e, #fb7185, #f59e0b
   ========================================================================== */
:root {
  --accent: #8b9cf5;
  --grad: linear-gradient(135deg, #9b7ef2 0%, #8b7ff2 45%, #7aa8ff 100%);
  --grad-soft: linear-gradient(135deg, rgba(139,127,242,.22), rgba(122,168,255,.16));
  --glow-rgb: 139, 127, 242;   /* violet, used for button/focus glow */
}

:root {
  --bg: #0a0c15;
  --bg-2: #0e111c;
  --text: #eef0f6;
  --muted: #8a93a8;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.03);
  --panel-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --field: rgba(255, 255, 255, 0.04);
  /* --accent / --grad / --grad-soft come from the BRANDING block above */
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --ok: #34d399;
  --warn: #fbbf24;
  --error: #fb7185;
  --ring: 0 0 0 3px rgba(139, 127, 242, 0.30);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 8px 30px rgba(139, 127, 242, 0.4);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Outfit Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-body: "Outfit Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f7; --bg-2: #e7ebf3; --text: #0f1320; --muted: #5a6274;
    --panel: rgba(255,255,255,0.72); --panel-2: rgba(255,255,255,0.55);
    --panel-strong: rgba(255,255,255,0.85);
    --border: rgba(15,19,32,0.10); --border-strong: rgba(15,19,32,0.18);
    --field: rgba(255,255,255,0.85);
    --shadow: 0 10px 30px rgba(20,30,60,0.12);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.003em;
}

/* ambient background glow */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(60vw 60vw at 18% -10%, rgba(155,126,242,0.22), transparent 60%),
    radial-gradient(55vw 55vw at 100% 0%, rgba(122,168,255,0.18), transparent 55%),
    radial-gradient(50vw 50vw at 50% 120%, rgba(139,127,242,0.18), transparent 60%);
  filter: saturate(1.1);
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(0,-2%,0) scale(1.05); } }

h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.01em; line-height: 1.05; }
h2 { font-family: var(--font-display); font-size: 1.02rem; margin: 0; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.045em; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .86rem; }
.error { color: var(--error); font-size: .9rem; }
.grow { flex: 1; }

/* glass surfaces */
.glass {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}

/* brand / logo */
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-lg h1 { line-height: 1.1; }
.brand-lg p { margin: .1rem 0 0; }
.brand strong, .topbar strong {
  font-family: var(--font-display); text-transform: uppercase;
  letter-spacing: .11em; font-weight: 650; font-size: .92rem;
}
/* real dB monogram — brand gradient masked by the site's mark-white.png */
.brand-mark {
  display: inline-block; flex: none; width: 34px; height: 34px;
  background:
    linear-gradient(125deg, #9b7ef2 0%, #7aa8ff 34%, #cfe0ff 50%, #7aa8ff 66%, #9b7ef2 100%);
  -webkit-mask: url("brand-mark.png") center / contain no-repeat;
  mask: url("brand-mark.png") center / contain no-repeat;
  filter: drop-shadow(0 0 10px rgba(122, 168, 255, .35));
}
.brand-mark.lg { width: 46px; height: 46px; }
/* the small gradient tile is still used for the ⚡ Auto-Fill icon */
.logo {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--grad); color: #fff; box-shadow: var(--shadow-glow);
}
.logo.sm { width: 30px; height: 30px; border-radius: 9px; }

/* buttons */
button {
  font-family: var(--font-display); font-size: .82rem; font-weight: 600; cursor: pointer;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text);
  background: var(--panel-strong); border: 1px solid var(--border);
  border-radius: 11px; padding: .58rem 1rem; transition: all .18s ease;
}
button:hover { border-color: var(--border-strong); transform: translateY(-1px); }
button:active { transform: translateY(0) scale(.985); }
button.sm { padding: .4rem .7rem; font-size: .86rem; border-radius: 9px; }
button.icon { padding: .4rem .55rem; }
button.ghost { background: var(--panel-2); }
button.ghost:hover { background: var(--panel-strong); }
button.primary {
  background: var(--grad); border: none; color: #fff; box-shadow: var(--shadow-glow);
  padding: .62rem 1.3rem;
}
button.primary:hover { filter: brightness(1.06); box-shadow: 0 12px 40px rgba(99,102,241,.5); }
button:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
button.copied {
  border-color: var(--ok); color: var(--ok);
  box-shadow: 0 0 0 3px rgba(52,211,153,.18);
  animation: copied-pop .45s cubic-bezier(.2,.8,.2,1);
}
@keyframes copied-pop { 0% { transform: scale(1); } 45% { transform: scale(1.07); } 100% { transform: scale(1); } }

/* fields */
input, textarea, select {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .55rem .7rem; width: 100%; transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .7; }
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88rem; line-height: 1.5; }
select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center; padding-right: 1.8rem;
}
label { display: grid; gap: .3rem; font-size: .82rem; color: var(--muted); font-weight: 500; }
.link { color: var(--accent); cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; }
.link:hover { border-bottom-color: var(--accent); }

/* login */
.login { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; padding: 1.2rem; }
.card { padding: 2rem; width: min(400px, 92vw); display: grid; gap: 1.05rem; animation: pop .5s cubic-bezier(.2,.8,.2,1); }
.login-foot { font-size: .82rem; }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* topbar */
.topbar {
  position: sticky; top: .6rem; z-index: 20; margin: .6rem; padding: .6rem .9rem;
  display: flex; align-items: center; gap: .8rem; border-radius: 14px;
}
.badge {
  font-size: .82rem; font-weight: 600; padding: .35rem .8rem; border-radius: 999px;
  color: var(--text); background: var(--grad-soft); border: 1px solid var(--border-strong);
}

/* layout */
main { max-width: 1040px; margin: 0 auto; padding: .4rem 1rem 3rem; display: grid; gap: 1rem; }
.panel { padding: 1.15rem 1.2rem; }
.panel-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .01em; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--border); padding: .18rem .55rem; border-radius: 999px;
}
.row { display: flex; gap: .5rem; margin-top: .6rem; flex-wrap: wrap; }
.actions { display: flex; align-items: center; gap: .9rem; }

/* entrance animation with stagger */
.reveal { animation: reveal .55s both cubic-bezier(.2,.8,.2,1); }
.reveal:nth-child(1){animation-delay:.02s}.reveal:nth-child(2){animation-delay:.08s}
.reveal:nth-child(3){animation-delay:.14s}.reveal:nth-child(4){animation-delay:.2s}
.reveal:nth-child(5){animation-delay:.26s}
@keyframes reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .reveal, .card { animation: none; } .bg-glow { animation: none; }
}

/* dropzone */
.dropzone {
  display: grid; justify-items: center; gap: .5rem; text-align: center; color: var(--muted);
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 1.6rem 1rem; transition: all .2s ease; background: var(--panel-2);
}
.dropzone .dz-icon { color: var(--muted); transition: transform .2s, color .2s; }
.dropzone.drag { border-color: var(--accent); background: var(--grad-soft); color: var(--text); }
.dropzone.drag .dz-icon { color: var(--accent); transform: translateY(-3px) scale(1.06); }
.thumbs { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .7rem; }
.thumb { position: relative; width: 92px; }
.thumb img { width: 92px; height: 92px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.thumb button {
  position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; padding: 0; line-height: 1;
  border-radius: 50%; font-size: 11px; background: rgba(10,11,15,.85); border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.thumb .name { font-size: .68rem; color: var(--muted); text-align: center; word-break: break-all; margin-top: .2rem; }

/* agents */
.agent {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem;
  margin-bottom: .7rem; background: var(--panel-2); transition: border-color .18s, transform .18s;
}
.agent:hover { border-color: var(--border-strong); }
.agent-head { display: grid; grid-template-columns: auto 1fr 1.4fr auto auto; gap: .6rem; align-items: end; }
.agent-head > .agent-label { align-self: center; font-weight: 640; }
.agent .prompt { margin: .65rem 0; }
.agent-params { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: .6rem; align-items: center; }
.agent-status {
  justify-self: end; font-size: .78rem; font-weight: 600; color: var(--muted);
  padding: .22rem .6rem; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
  white-space: nowrap; transition: color .2s, border-color .2s, background .2s;
}
.agent-status[data-state="run"]  { color: #c7d2fe; border-color: rgba(124,140,255,.5); background: rgba(124,140,255,.12); }
.agent-status[data-state="ok"]   { color: var(--ok);   border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.12); }
.agent-status[data-state="err"]  { color: var(--error); border-color: rgba(251,113,133,.5); background: rgba(251,113,133,.12); }
.agent-status[data-state="warn"] { color: var(--warn); border-color: rgba(251,191,36,.5); background: rgba(251,191,36,.12); }

/* per-agent progress bar */
.agent-progress {
  height: 4px; margin-top: .7rem; border-radius: 999px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--border);
}
.agent-progress > span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: var(--grad); transition: width .35s cubic-bezier(.2,.8,.2,1);
}

/* toasts */
.toasts {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  display: flex; flex-direction: column; gap: .55rem; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer; max-width: min(360px, 88vw);
  padding: .7rem 1rem; border-radius: 12px; font-size: .88rem; font-weight: 500;
  color: var(--text); background: var(--panel-strong); border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px) scale(.98); transition: all .28s cubic-bezier(.2,.8,.2,1);
  border-left: 3px solid var(--accent);
}
.toast.show { opacity: 1; transform: none; }
.toast.success { border-left-color: var(--ok); }
.toast.error   { border-left-color: var(--error); }
.toast.warn    { border-left-color: var(--warn); }

/* modal (Auto-Fill) */
.modal {
  position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; padding: 4vmin;
  background: rgba(4,5,8,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .2s ease;
}
.modal.show { opacity: 1; }
.modal-card { width: min(720px, 94vw); max-height: 90vh; overflow: auto; padding: 1.3rem 1.4rem; animation: pop .28s cubic-bezier(.2,.8,.2,1); }
.modal-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem; }
.modal-head h2 { margin: 0; }
.modal-head .icon { margin-left: auto; }
.modal code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; padding: .05rem .35rem; font-size: .82em; }
.settings-h { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em;
  font-size: .82rem; font-weight: 650; color: var(--muted); margin: 1.1rem 0 .3rem; }
.status-list { display: grid; gap: .35rem; margin-top: .3rem; }
.status-row { display: flex; align-items: center; gap: .6rem; font-size: .9rem;
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 10px; background: var(--panel-2); }
.status-row .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-row .dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.6); }
.status-row .dot.off { background: var(--border-strong); }
.status-name { flex: 1; }
.status-tag { font-size: .74rem; font-weight: 600; color: var(--muted);
  padding: .12rem .5rem; border-radius: 999px; border: 1px solid var(--border); }
.status-tag.on { color: var(--ok); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.auto-controls { align-items: end; }
.auto-controls label { min-width: 150px; }
#auto-input { width: 100%; margin-top: .7rem; }
.modal-foot { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; }

/* lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 3vmin;
  background: rgba(4,5,8,.82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .2s ease;
}
.lightbox.show { opacity: 1; }
.lightbox img {
  max-width: 92vw; max-height: 88vh; border-radius: 14px; border: 1px solid var(--border-strong);
  box-shadow: 0 30px 90px rgba(0,0,0,.6); animation: pop .28s cubic-bezier(.2,.8,.2,1);
}
.lightbox-close {
  position: absolute; top: 1.1rem; right: 1.2rem; width: 42px; height: 42px; padding: 0;
  border-radius: 50%; font-size: 1.1rem; background: var(--panel-strong); border: 1px solid var(--border-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-top: .4rem; }
.gallery a { display: block; border-radius: var(--radius-sm); overflow: hidden; }
.gallery img {
  width: 100%; aspect-ratio: 1; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: var(--radius-sm); transition: transform .22s ease, box-shadow .22s, border-color .22s;
  animation: pop .4s both;
}
.gallery a:hover img { transform: scale(1.04); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.gallery .empty { grid-column: 1/-1; padding: 1.4rem 0; text-align: center; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.16) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); background-clip: padding-box; }

details > summary { cursor: pointer; padding: .2rem 0; font-size: .85rem; }
details[open] > summary { margin-bottom: .4rem; }

@media (max-width: 680px) {
  .agent-head { grid-template-columns: 1fr 1fr; }
  .agent-params { grid-template-columns: 1fr 1fr; }
  .topbar { top: 0; margin: 0; border-radius: 0; }
}
