/* Nova v3 - Cosmic gradient UI (fits provided NOVA logo) */
:root {
  --bg: #06080d;
  --panel: rgba(255,255,255,0.06);
  --panel-2: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.09);
  --text: #eef3ff;
  --muted: #a8b4c7;
  --magenta: #ff2d92;
  --violet: #8a63ff;
  --blue: #00a7ff;
  --danger: #ff6161;
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 900px at 25% -10%, rgba(255,45,146,0.14), transparent 60%),
    radial-gradient(900px 700px at 120% 15%, rgba(138,99,255,0.12), transparent 50%),
    radial-gradient(1200px 900px at -10% 120%, rgba(0,167,255,0.10), transparent 50%),
    #05060a;
  overflow: hidden;
}

/* animated starfield shimmer */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image: radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,.15), transparent),
                    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,.12), transparent),
                    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,.10), transparent);
  opacity: .6;
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes twinkle { from { opacity:.35 } to { opacity:.7 } }

/* rotating nebula halo */
body::after {
  content: "";
  position: fixed; right: -20vmax; top: -20vmax; width: 60vmax; height: 60vmax;
  background: conic-gradient(from 180deg at 50% 50%, rgba(255,45,146,.18), rgba(138,99,255,.16), rgba(0,167,255,.14), transparent 40%);
  filter: blur(80px);
  animation: swirl 24s linear infinite;
  opacity: .6;
  pointer-events: none;
}
@keyframes swirl { to { transform: rotate(360deg); } }

.app { display: grid; grid-template-columns: 320px 1fr; height: 100%; }
.sidebar {
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  backdrop-filter: blur(8px);
}

.brand { display:flex; align-items:center; gap:12px; font-weight: 900; letter-spacing: .4px; }
.brand img { width:28px; height:28px; border-radius: 8px; box-shadow: 0 0 0 2px rgba(255,255,255,.06) inset; }
.brand .pulse { width:10px; height:10px; border-radius: 999px;
  background: linear-gradient(135deg, var(--magenta), var(--violet), var(--blue));
  animation: breathe 2.4s ease-in-out infinite; box-shadow: 0 0 18px rgba(138,99,255,.4);
}
@keyframes breathe { 0%,100%{transform:scale(1); opacity:.6} 50%{transform:scale(1.45); opacity:1} }

.tabs { display:flex; gap:8px; }
.tab { flex:1; text-align:center; padding:10px 12px; border-radius:12px; cursor:pointer;
  border:1px solid var(--border); background: var(--panel);
  transition: transform .12s ease, background .12s ease;
}
.tab.active { outline:2px solid rgba(138,99,255,.35); transform: translateY(-1px); }

.button {
  background: linear-gradient(135deg, var(--magenta), var(--violet), var(--blue));
  border:none; color:#0b0f14; font-weight:800; padding:10px 12px; border-radius:12px; cursor:pointer;
  transition: filter .12s ease, transform .06s ease; box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.button:hover { filter: brightness(1.08); }
.button:active { transform: translateY(1px); }
.button-ghost { background: transparent; border:1px solid var(--border); color:var(--text); padding:10px 12px; border-radius:12px; cursor:pointer; }
.button-danger { background: var(--danger); color: white; border:none; }

.select, .input {
  width: 100%; padding: 10px 12px; color: var(--text);
  background: var(--panel); border: 1px solid var(--border); border-radius:12px; outline:none;
}

.list { overflow: auto; display:flex; flex-direction: column; gap:8px; }
.item { padding: 10px 12px; border:1px solid var(--border); background: var(--panel); border-radius:12px; cursor:pointer; transition: background .12s ease, transform .06s ease; }
.item:hover { background: var(--panel-2); }
.item.active { outline:2px solid rgba(138,99,255,.35); }

.main { display:flex; flex-direction:column; height:100%; }
.header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding: 12px 16px; border-bottom:1px solid var(--border); background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent); }
.badge { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; border-radius:999px; border:1px solid var(--border); background: var(--panel); color: var(--muted); font-size: 12px; }

.messages { flex:1; overflow:auto; padding: 22px; display:flex; flex-direction:column; gap:14px; }
.msg { max-width: 72ch; padding: 12px 14px; border-radius: 14px; line-height: 1.45; white-space: pre-wrap; animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(4px); opacity: 0;} to { transform:none; opacity:1;} }
.msg.user { align-self: flex-end; background: rgba(138,99,255,.18); border:1px solid rgba(138,99,255,.25); box-shadow: 0 8px 24px rgba(138,99,255,.12); }
.msg.assistant { align-self:flex-start; background: rgba(255,255,255,.05); border:1px solid var(--border); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.msg.system { align-self:center; background: rgba(255,255,255,.03); border:1px dashed var(--border); color: var(--muted); }
.citations { color: var(--muted); font-size: 12px; margin-top: 6px; }
.citations a { color: var(--muted); text-decoration: underline dotted; }

.composer { border-top:1px solid var(--border); padding: 12px; display:grid; grid-template-columns: 1fr auto auto auto; gap: 8px; background: linear-gradient(180deg, transparent, rgba(255,255,255,0.03)); }
textarea.input { min-height: 56px; max-height: 240px; resize: vertical; }

.kbd { font-size: 11px; padding:2px 6px; border-radius:6px; border:1px solid var(--border); background: rgba(255,255,255,.06); color: var(--muted); }
.error { color: #ff9a9a; font-size: 13px; }

/* subtle ripple */
.button.ripple { position: relative; overflow: hidden; }
.button.ripple:focus::after, .button.ripple:active::after {
  content:""; position:absolute; inset:0; background: radial-gradient(circle, rgba(255,255,255,.35) 0%, transparent 40%); opacity:.0; animation: ripple .3s ease;
}
@keyframes ripple { from{opacity:.35} to{opacity:0} }
