/* =====================================================================
   spacre Glass - gemeinsamer Look von Nova, Dashboard, Mail und Deal Finder.
   Liegt UEBER app.css (und portal.css) und arbeitet nur mit den Theme-Variablen,
   passt also zu jedem Theme. Farben fuer Hell/Dunkel kommen aus theme.js.
   ===================================================================== */
:root {
  --edge: rgba(255, 255, 255, .14);
  --hover: rgba(255, 255, 255, .06);
  --active: rgba(255, 255, 255, .11);
  --blob: 38%;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
}

body { letter-spacing: -0.011em; }

/* ---------- Hintergrund: weiche Farbflecken wie im Deal Finder ---------- */
body::before {
  inset: -10vmax;
  background:
    radial-gradient(38vmax 38vmax at 12% 14%, color-mix(in srgb, var(--accent) var(--blob), transparent), transparent 70%),
    radial-gradient(34vmax 34vmax at 88% 46%, color-mix(in srgb, var(--accent2) var(--blob), transparent), transparent 70%),
    radial-gradient(30vmax 30vmax at 40% 96%, color-mix(in srgb, #ff453a calc(var(--blob) / 2), transparent), transparent 70%);
  filter: blur(40px);
}

/* ---------- Glasflaechen ---------- */
.sidebar, .top, .box, .login-card, .card, .usage {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 0 var(--edge), var(--shadow);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.8);
}
.usage { box-shadow: inset 0 1px 0 0 var(--edge); background: var(--hover); }

/* ---------- Schwebender Aufbau (Computer) ---------- */
@media (min-width: 821px) {
  .app { padding: 12px; gap: 12px; grid-template-columns: 284px minmax(0, 1fr); }
  .sidebar { border-radius: 28px; overflow: hidden; }
  .main { gap: 0; }
  .top { border-radius: 22px; margin: 0 0 4px; padding: 10px 14px; }
}

/* ---------- Knoepfe: Pillen, federnd ---------- */
button, a.btn {
  border-radius: 999px;
  transition: transform .3s var(--spring), background-color .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease), filter .2s, opacity .2s;
}
button:active, a.btn:active { transform: scale(.95); transition-duration: .1s; }
button.icon { border-radius: 12px; }
button.icon:hover { background: var(--hover); }
button.primary, a.btn.primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 8px 22px -8px var(--accent-shadow);
}
button.primary:hover, a.btn.primary:hover { filter: brightness(1.1); }
/* normale Knoepfe: leichtes Glas statt grauer Klotz */
button:not(.primary):not(.icon):not(.danger):not(.ghost):not(.swatch):not(.gal):not(.tcard), a.btn:not(.primary) { background: var(--hover); border-color: var(--line); }
button:not(.primary):not(.icon):not(.danger):hover, a.btn:not(.primary):hover { background: color-mix(in srgb, var(--text) 10%, transparent); filter: none; }
.send { border-radius: 999px; }
.seg { border-radius: 999px; background: var(--hover); border-color: var(--line); }
.seg button { border-radius: 999px; }
.code-h button, .meta button, .code-note .copy-one, .ph-row input { border-radius: 10px; }

/* ---------- Felder ---------- */
input, select, textarea { border-radius: 14px; background: var(--hover); }
input:hover, select:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }
.box textarea { background: transparent; }
.select-wrap select { background: var(--hover); }

/* ---------- Logo und Avatare: lila Verlauf wie in Mail / Deal Finder ---------- */
.logo, .avatar, .me-av, .svc-av {
  background: linear-gradient(135deg, #8b7dff, #5b4bdb);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 6px 18px -6px rgba(124, 108, 255, .8);
}
.logo { border-radius: 28%; }
.logo.lg { border-radius: 18px; }
/* Produkt-Icons aus dem Spacre Brand-Pack (PNG mit eigenen runden Ecken) */
img.logo.brand-img, img.logo.lg.brand-img {
  display: block; background: none; border-radius: 23%; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 16px -8px rgba(0, 0, 0, .55);
}
.login-card img.logo.brand-img, .empty img.logo.brand-img { margin-left: auto; margin-right: auto; }

/* ---------- Seitenleiste: Chats / Navigation ---------- */
.conv, .folder-h, .nav-i { border-radius: 14px; transition: background-color .25s var(--ease), color .25s var(--ease); }
.conv:hover, .folder-h:hover, .nav-i:hover { background: var(--hover); }
.conv.active, .nav-i.active {
  background: var(--active); color: var(--text);
  box-shadow: inset 0 1px 0 var(--edge);
}
.nav-i.active svg { color: var(--accent); }
.group-h, .nav-h { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.trash-row { border-radius: 14px; }
/* Untere Leiste: ruhige Zeilen statt umrandeter Knoepfe (wie Deal Finder) */
.side-foot { border-top: 0; gap: 4px; }
.side-foot button.ghost, .foot-row .ghost { border-color: transparent; border-radius: 14px; justify-content: flex-start; padding: 10px 12px; color: var(--muted); }
.side-foot button.ghost:hover, .foot-row .ghost:hover { background: var(--hover); color: var(--text); }
.side-foot .usage { margin-bottom: 6px; }
.trash-row:hover { background: var(--hover); }
.cnt { background: var(--hover); }

/* ---------- Chat ---------- */
.box { border-radius: 26px; border-color: var(--line); }
.box:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: inset 0 1px 0 var(--edge), var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.user .bubble { border-radius: 22px 22px 8px 22px; box-shadow: inset 0 1px 0 var(--edge); }
html[data-abox="1"] .assistant .bubble { border-radius: 8px 22px 22px 22px; box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
.code { border-radius: 16px; }
.suggest button { border-radius: 20px; background: var(--panel); box-shadow: inset 0 1px 0 var(--edge); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }
.suggest button:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
.msg { animation: rise .45s var(--ease) both; }
.empty { animation: rise .55s var(--ease) both; }
.file { border-radius: 14px; }

/* ---------- Dialoge, Menues, Hinweise ---------- */
.dlg { border-radius: 26px; border-color: var(--line); box-shadow: inset 0 1px 0 var(--edge), 0 30px 70px -20px rgba(0, 0, 0, .55); }
.dlg[open] { animation: dlgIn .4s var(--ease) both; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.dlg::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); }
.dlg section, .ed, details.adv, .mem-item, .trash-item, .urow { border-radius: 18px; box-shadow: inset 0 1px 0 var(--edge); }
.menu { border-radius: 16px; box-shadow: inset 0 1px 0 var(--edge), 0 18px 40px -12px rgba(0, 0, 0, .5); animation: rise .2s var(--ease) both; }
.menu-i { border-radius: 10px; }
.menu-i:hover, .menu-i:focus-visible { background: var(--hover); }
.toast { border-radius: 16px; box-shadow: inset 0 1px 0 var(--edge), var(--shadow); animation: rise .35s var(--ease) both; }
.switch span { background: var(--hover); }

/* ---------- Dashboard (Portal) ---------- */
.card { border-radius: 22px; padding: 20px; }
a.svc-card { transition: transform .4s var(--ease), border-color .25s, box-shadow .25s; }
a.svc-card:hover { transform: translateY(-3px); border-color: var(--line2); box-shadow: inset 0 1px 0 var(--edge), var(--shadow); }
.chipb { border-radius: 999px; }
.tbl.click tbody tr:hover { background: var(--hover); }
.tbl th { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.pill { border-radius: 999px; }
.linkbox, .del-box, .box-form { border-radius: 16px; }
.page-in { animation: rise .45s var(--ease) both; }
.hello h1 em { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent); }
.me-av { border-radius: 12px; }

/* ---------- Anmeldung ---------- */
.login-card { border-radius: 28px; }

/* ---------- Handy ---------- */
@media (max-width: 820px) {
  .sidebar { border-radius: 0 24px 24px 0; border-left: 0; background: var(--card); }
  .top { margin: 8px 8px 0; border-radius: 20px; }
  .app.nav-open .scrim { background: rgba(0, 0, 0, .5); backdrop-filter: blur(4px); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
