/* ---------------------------------------------------------------------------
 * 1) Section start
 * --------------------------------------------------------------------------- */
/* Global layout */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", sans-serif;
  background: radial-gradient(1200px 600px at 10% -10%, #1a1a22 10%, #0f1115 60%);
  color: #eee;
}

#app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
}

:root{
  --panel: #1a1f2a;   /* matches your header/input colors */
  --warn:  #fde047;   /* used as initial dot color in HTML */
}

/* Make the state pill dot visible */
.state-pill .dot{
  display:inline-block;
  width:10px;
  height:10px;
  border-radius:50%;
  background: currentColor;   /* JS sets span.style.color = … */
}


/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1a1f2a;
  padding: 1em;
  border-bottom: 1px solid #263040;
}
header h1 { margin: 0; font-weight: 700; letter-spacing: .2px; }

#toggle-thinking {
  background: #2b3344;
  color: #e6efff;
  border: 1px solid #36415a;
  padding: .55em .9em;
  border-radius: 10px;
  cursor: pointer;
}

/* Main layout container */
.container {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  gap: 0;
}

/* Panels */
.panel {
  padding: 1em;
  overflow-y: auto;
  min-width: 0;
}

/* Chat panel */
#chat-history {
  flex: 3;
  border-right: 1px solid #80838691;
  overflow-wrap: break-word;
  padding-inline: 18px;
}

/* Message row + bubbles */
.msg {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0;
}

.msg .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #13E9FE, #485153);
  border: 1px solid #2a3547;
  box-shadow: 0 6px 10px rgba(0,0,0,.35);
}

.msg.user { justify-content: flex-end; }
.msg.user .avatar { background: linear-gradient(135deg, #16a34a, #485153); }
.msg.user .bubble {
  background: rgba(48, 133, 255, .12);
  border: 1px solid #35537a;
  color: #e9f1ff;
  border-top-right-radius: 6px;
  border-top-left-radius: 16px;
}
.msg.assistant .bubble {
  background: rgba(41, 255, 41, 0.041);
  border: 1px solid #316139;
  color: #e6e6e6;
  border-top-left-radius: 6px;
  border-top-right-radius: 16px;
}

.bubble {
  max-width: min(72ch, 70%);
  padding: 10px 12px;
  border-radius: 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 12px rgba(117, 112, 112, 0.473);
}

.bubble .meta {
  font-size: .78rem;
  color: #9aa3ad;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.bubble pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 1.06rem; /* a little bigger */
  line-height: 1.5;
}

.state-pill{
  margin-left:12px; padding:8px 12px; 
  border-radius:999px; 
  font-size:12px; 
  letter-spacing:.3px; 
  display:flex; 
  align-items:center; 
  gap:8px; 
  background:var(--panel); 
  box-shadow: inset 0 0 0 1px #ffffff12; 
  flex:0 0 auto;}

.timing-small { font-size: 0.8em; opacity: 0.7; margin-top: 4px; }

/* Thinking panel */
#thinking-panel {
  flex: 1;
  background: rgba(17,19,26,.7);
  border-left: 1px solid #3c5379;
  display: grid;
  grid-template-rows: 1fr 1fr; /* top half = avatar, bottom half = thinking */
  overflow: auto; /* bottom section owns the scroll */
  padding: 0;
}

/* Thinking TOP (avatar placeholder) */
.thinking-top {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 16px;
  border-bottom: 1px solid #263040;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0));
}
.vx-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 22px;
  background: radial-gradient(120px 120px at 30% 30%, #20293a 0%, #131722 70%);
  border: 1px solid #2a3547;
/* ---------------------------------------------------------------------------
 * 2) Section 2
 * --------------------------------------------------------------------------- */
  box-shadow: inset 0 0 12px rgba(0,0,0,.3), 0 10px 30px rgba(0,0,0,.35);
  display: grid;
  place-items: center;
}
.vx-ring {
  position: absolute;
  inset: -6px;
  border-radius: 26px;
  border: 1px dashed rgba(110,168,254,.35);
  filter: drop-shadow(0 0 10px rgba(110,168,254,.25));
}
.vx-face {
  font-weight: 800;
  letter-spacing: .08em;
  color: #cfe2ff;
  opacity: .9;
}
.vx-name { font-weight: 700; color:#e6e6e6; }
.vx-note { color:#9aa3ad; font-size:.85rem; }

/* Thinking BOTTOM (title + dots + history) */
.thinking-bottom {
  padding: 14px;
  overflow-y: auto;
}
.vx-think-title { margin: 6px 0 10px; color:#6a7d9b; font-weight:700; }

/* Thinking dots animation */
#thinking-dots {
  font-style: italic;
  color: rgb(41, 190, 94);
  margin-bottom: .8em;
  display: none;
}
.dot {
  opacity: 0;
  animation: blink 5.4s infinite;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
  will-change: opacity;
}
.dot.one   { animation-delay: 0s; }
.dot.two   { animation-delay: 0.3s; }
.dot.three { animation-delay: 0.6s; }
.dot.four  { animation-delay: 0.9s; }
.dot.five  { animation-delay: 1.2s; }
.dot.six   { animation-delay: 1.5s; }
.dot.seven { animation-delay: 1.8s; }
.dot.eight { animation-delay: 2.1s; }
.dot.nine  { animation-delay: 2.4s; }
.dot.ten   { animation-delay: 2.7s; }
.dot.eleven{ animation-delay: 3.0s; }
.dot.twelve{ animation-delay: 3.3s; }
.dot.thirteen{animation-delay: 3.6s; }
.dot.fourteen{animation-delay: 3.9s; }
.dot.fifteen{ animation-delay: 4.2s; }
.dot.sixteen{ animation-delay: 4.5s; }
.dot.seventeen{animation-delay: 4.8s; }
.dot.eighteen{ animation-delay: 5.1s; }

/* nth-child fallback map */
#thinking-dots .dot:nth-child(2)  { animation-delay: 0.3s; }
#thinking-dots .dot:nth-child(3)  { animation-delay: 0.6s; }
#thinking-dots .dot:nth-child(4)  { animation-delay: 0.9s; }
#thinking-dots .dot:nth-child(5)  { animation-delay: 1.2s; }
#thinking-dots .dot:nth-child(6)  { animation-delay: 1.5s; }
#thinking-dots .dot:nth-child(7)  { animation-delay: 1.8s; }
#thinking-dots .dot:nth-child(8)  { animation-delay: 2.1s; }
#thinking-dots .dot:nth-child(9)  { animation-delay: 2.4s; }
#thinking-dots .dot:nth-child(10) { animation-delay: 2.7s; }
#thinking-dots .dot:nth-child(11) { animation-delay: 3.0s; }
#thinking-dots .dot:nth-child(12) { animation-delay: 3.3s; }
#thinking-dots .dot:nth-child(13) { animation-delay: 3.6s; }
#thinking-dots .dot:nth-child(14) { animation-delay: 3.9s; }
#thinking-dots .dot:nth-child(15) { animation-delay: 4.2s; }
#thinking-dots .dot:nth-child(16) { animation-delay: 4.5s; }
#thinking-dots .dot:nth-child(17) { animation-delay: 4.8s; }
#thinking-dots .dot:nth-child(18) { animation-delay: 5.1s; }

@keyframes blink {
  0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: 0; }
}

/* Thinking history: newest at the top */
.thinking-history,
#thinking-history {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
}
.thinking-row {
  background: rgba(255,255,255,.03);
  border: 1px solid #2a3547;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 4px 6px rgba(134, 111, 127, 0.432);
}
.thinking-row p {
  margin: 0;
  color: #6882aad2;
  font-size: .95rem;
  line-height: 1.45;
}

/* Input bar */
.input-container {
  align-items: center;
  display: flex;
  padding: 1em;
  border-top: 1px solid #263040;
  background: #1a1f2a;
  flex-shrink: 0;
  gap: 10px;
}

#user-input {
  flex: 1;
  padding: .7em .8em;
  font-size: 1rem;
  background: #0e1218;
  color: #e6e6e6;
  border: 1px solid #2a3547;
  border-radius: 10px;
}

#send-button {
  /* stop uses identical styling */
}

#stop-button { margin-left: 8px; }

/* Tagline footer */
#volyrix-tagline {
  text-align: center;
  font-style: italic;
  font-size: 0.9rem;
  color: #13E9FE;
  background: #0f1115;
  padding: .6rem 1rem;
  border-top: 1px solid #263040;
  opacity: .8;
}

#mode-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  background: rgba(34,34,34,.8);
  padding: .4em .6em;
  border: 1px solid #333;
  border-radius: 8px;
}
/* ---------------------------------------------------------------------------
 * 3) Section 3
 * --------------------------------------------------------------------------- */

#mode-controls label { font-size: .95em; color: #13E9FE; }
#compare-rq {
  background: #555;
  color: #13E9FE;
  border: none;
  padding: .35em .6em;
  border-radius: 6px;
  cursor: pointer;
}
/* Volyrix Header Styling */
#volyrix-header {
  text-align: center;
  margin-bottom: 1rem;
}

#volyrix-header img {
  max-height: 120px;
}

#volyrix-subtitle {
  font-family: 'Arial Black', 'Helvetica Neue', Helvetica, sans-serif; /* matches VOLYRIX branding */
  font-weight: bold;
  font-size: 1.2rem;
  color: #13E9FE; /* Neon cyan */
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 2px;
}
/* Icon-only buttons */
.icon-btn {
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 42px;            /* compact square buttons */
  height: 42px;
  padding: 0;
  border: 1px solid rgba(19, 233, 254, 0.5);
  border-radius: 10px;
  background: rgba(19, 233, 254, 0.06);
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, background 0.2s ease;
  color: #13E9FE;         /* drives SVG currentColor */
}
.icon-btn:hover {
  background: rgba(19, 233, 254, 0.12);
  box-shadow: 0 0 12px rgba(19, 233, 254, 0.25);
}
.icon-btn:active {
  transform: translateY(1px);
}

/* Ensure SVGs inherit the theme color and look crisp */
.icon-btn svg,
.icon-inline svg {
  display: block;
  stroke: currentColor;
}

/* Inline icon before TTS select */
#tts-icon.icon-inline {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 8px;   /* sits right before the select (we insert it via JS) */
  margin-right: 4px;
  color: #13E9FE;
}

/* Screen-reader only (already present, included for completeness) */
.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

#stop-button { margin-left: 8px; }
