/* ===============================
   HYPER-Y  —  Node theme (clean)
   =============================== */

/* ---- base / tokens ---- */
* { box-sizing: border-box; }
:root {
  --nm-page:   #f5f7fb;   /* page bg */
  --nm-card:   #ffffff;   /* card bg */
  --nm-muted:  #6b7280;   /* subtle text */
  --nm-text:   #1f2937;   /* primary text */
  --nm-strong: #0f172a;   /* titles */
  --nm-border: #e5e7eb;   /* hairlines */
  --nm-soft:   #f3f4f6;   /* light bubbles/inputs */

  /* palette close to screenshot */
  --accent:    #ff5a5f;   /* header/call-to-action */
  --accent-2:  #ff6f73;   /* hover */
  --accent-3:  #e94a4f;   /* press */

  /* animated background hues (mint -> sand) */
  --grad-a: #dff2ec;
  --grad-b: #eaf5e2;
  --grad-c: #faeac7;

  /* blues you already used for info chips, etc. */
  --info: #3b82f6;
}

/* ---- page ---- */
html, body { height: 100%; }
body.theme-node {
  margin: 0;
  font-family: ui-sans-serif, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--nm-text);
  background: var(--nm-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* soft animated gradient layer (like the screenshot background) */
body.theme-node::before {
  content: "";
  position: fixed; inset: 0;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b), var(--grad-c));
  background-size: 200% 200%;
  animation: bgShift 18s ease-in-out infinite;
  opacity: .9;
  z-index: -2;
}
/* tiny grain so the gradient doesn’t look flat */
body.theme-node::after{
  content:"";
  position: fixed; inset:0;
  background-image:
    radial-gradient(rgba(0,0,0,.05) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity:.15;
  z-index:-1;
}
@keyframes bgShift {
  0%   { background-position: 0% 50%;   }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%;   }
}

/* ---- app container (glass card on top of gradient) ---- */
.chat-container {
  width: 100%;
  max-width: 980px;
  height: 90vh;
  background: var(--nm-card);
  border-radius: 14px;
  border: 1px solid var(--nm-border);
  box-shadow: 0 18px 45px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- header bar (solid coral like your screenshot) ---- */
header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color:#fff;
}
header h1{
  margin:0;
  font-weight:800;
  letter-spacing:.3px;
  font-size: 18px;
}
header p{
  margin:0;
  font-size:12px;
  opacity:.9;
}

/* optional icons area if you have it */
.header-actions{ display:flex; gap:10px; align-items:center; }
.header-actions .btn{
  width:30px; height:30px; display:grid; place-items:center;
  background: rgba(255,255,255,.18);
  border-radius:9px;
  transition: transform .12s ease, background .2s ease;
}
.header-actions .btn:hover{ background:rgba(255,255,255,.28); transform:translateY(-1px) }
.header-actions .btn:active{ transform:translateY(0) }

/* ---- messages area ---- */
.chat-window {
  flex: 1 1 auto;
  padding: 16px;
  overflow-y: auto;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b), var(--grad-c));
  background-size: 180% 180%;
  animation: bgShift 22s ease-in-out infinite;
}
.chat-window::-webkit-scrollbar { width: 10px; }
.chat-window::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.15);
  border-radius: 8px;
}
.chat-window::-webkit-scrollbar-track { background: transparent; }

/* message bubbles */
.message {
  max-width: 82%;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 12px;
  line-height: 1.55;
  word-wrap: break-word;
  color: var(--nm-text);
  backdrop-filter: blur(2px);
  transform: translateY(6px) scale(.98);
  opacity: 0;
  animation: bubbleIn .28s ease forwards;
}
.message.assistant{
  align-self:flex-start;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: 0 10px 24px rgba(0,0,0,.06);
  border-bottom-left-radius: 6px;
}
.message.user{
  align-self:flex-end;
  background: var(--accent);
  color:#fff;
  box-shadow: 0 12px 26px rgba(255,90,95,.25);
  border-bottom-right-radius: 6px;
}
@keyframes bubbleIn{
  to{ transform: translateY(0) scale(1); opacity:1; }
}

/* prose (markdown) */
.prose { font-size: 15px; line-height: 1.6; }
.prose h1,.prose h2,.prose h3{ margin:.35em 0 .2em; line-height:1.25; color:var(--nm-strong) }
.prose h1{ font-size:20px }
.prose h2{ font-size:18px }
.prose h3{ font-size:16px }
.prose p{ margin:.45em 0 }
.prose strong{ color:var(--nm-strong) }
.prose em{ color:#374151 }
.prose ul,.prose ol{ margin:.4em 0 .6em 1.25em; padding-left:1.1em }
.prose li{ margin:.25em 0 }
.prose code{
  background: var(--nm-soft);
  color: var(--nm-strong);
  padding:.15em .35em; border-radius:6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size:.95em;
}
.prose pre code{
  display:block; padding:12px; overflow-x:auto; border-radius:8px;
  background:#f8fafc; border:1px solid var(--nm-border);
}

/* typing indicator */
.typing-bubble{ padding: 8px 12px; }
.typing{ display:inline-flex; align-items:center; gap:6px; }
.typing > span{
  width:7px; height:7px; background:#9ca3af; border-radius:50%;
  opacity:.4; animation: dot 1.4s infinite;
}
.typing > span:nth-child(2){ animation-delay:.2s }
.typing > span:nth-child(3){ animation-delay:.4s }
.typing em{ font-style:normal; color:var(--nm-muted); font-size:12px; margin-left:6px; }
@keyframes dot{
  0%,60%,100%{ transform:translateY(0); opacity:.4 }
  30%{ transform:translateY(-4px); opacity:1 }
}

/* composer */
#chat-form{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding: 12px 14px;
  background: var(--nm-card);
  border-top:1px solid var(--nm-border);
}
#user-input{
  flex:1 1 auto; min-height:44px;
  padding: 12px 12px;
  border-radius: 10px; border:1px solid var(--nm-border);
  background: #ffffff; color: var(--nm-text); outline: none;
  transition: box-shadow .2s ease, border-color .2s ease;
}
#user-input::placeholder{ color:#9ca3af }
#user-input:focus{
  border-color: color-mix(in oklab, var(--accent) 40%, #ffffff);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 18%, transparent);
}

#send-btn{
  padding: 0 16px; min-width:48px; height:44px;
  background: var(--accent);
  border: none; border-radius: 12px; color: #fff; font-size: 16px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(255,90,95,.28), inset 0 -6px 12px rgba(0,0,0,.06);
  transition: transform .08s ease, box-shadow .2s ease, background .2s ease, filter .2s ease;
}
#send-btn:hover{ background: var(--accent-2); transform: translateY(-1px); filter: saturate(1.02); }
#send-btn:active{ background: var(--accent-3); transform: translateY(0); box-shadow: 0 6px 14px rgba(255,90,95,.26); }

/* file upload chip */
.file-upload{
  padding:10px 12px; background:#fff; color:#374151;
  border:1px solid var(--nm-border); border-radius:10px; cursor:pointer;
  user-select:none; white-space:nowrap;
  transition: background .2s ease, border-color .2s ease, transform .08s ease;
}
.file-upload:hover{ background:#f9fafb; border-color:#d7dce3 }
.file-upload:active{ transform: translateY(1px); }
.file-upload input[type="file"]{ display:none; }
.file-preview{ flex-basis:100%; margin-top:6px; font-size:13px; color:#4b5563; text-align:left; }
.file-message{
  background: var(--info); color:#fff; padding:6px 10px; border-radius:8px; display:inline-block; font-size:13px;
  box-shadow: 0 8px 18px rgba(59,130,246,.22); margin-top:4px;
}

/* responsiveness */
@media (max-width: 560px){
  .chat-container{ height: 94vh; border-radius: 12px; }
  header{ padding: 12px; }
  .message{ max-width: 92%; }
}
