/*
 * Vitmeet's original visual shell (f9a3040), adapted as a presentation-only
 * layer. Authentication and chat IDs deliberately stay untouched, so the
 * current phone OTP, Google sign-in, account recovery and guest quota flows
 * keep their newer behaviour.
 */

:root {
  --primary: #9333ea;
  --primary-hover: #7e22ce;
  --accent: #c084fc;
  --bg-body: #08080b;
  --bg-chat: #0d0d12;
  --bg-chat-area: #111117;
  --bg-input-area: #15151c;
  --bg-input: #15151c;
  --bg-sidebar: #0b0b10;
  --surface-elevated: rgba(24, 24, 32, .88);
  --surface-glass: rgba(18, 18, 25, .78);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .14);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .22);
  --shadow-elevated: 0 20px 50px rgba(0, 0, 0, .30);
  --bot-bg: #16161c;
  --bot-text: #f4f4f5;
  --user-bg: #2e2e36;
  --user-text: #fafafa;
  --chat-column: 720px;
}

[data-theme="light"] {
  --primary: #9333ea;
  --primary-hover: #7e22ce;
  --accent: #7c3aed;
  --bg-body: #f4f4f5;
  --bg-chat: #fff;
  --bg-chat-area: #fafafa;
  --bg-input-area: #fff;
  --bg-input: #fff;
  --bg-sidebar: #fafafa;
  --surface-elevated: rgba(255, 255, 255, .90);
  --surface-glass: rgba(255, 255, 255, .78);
  --text-main: #18181b;
  --text-muted: #71717a;
  --border: rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .13);
  --shadow-soft: 0 12px 34px rgba(24, 24, 27, .08);
  --shadow-elevated: 0 20px 50px rgba(24, 24, 27, .12);
  --bot-bg: #f4f4f5;
  --bot-text: #18181b;
  --user-bg: #e8e8ec;
  --user-text: #18181b;
}

body {
  background:
    radial-gradient(circle at 50% 0, rgba(147, 51, 234, .055), transparent 38%),
    var(--bg-body);
}

/* Restore the original centred application card instead of a flat full-page shell. */
#layoutWrapper > div:last-child {
  padding: 1.5rem;
  background: transparent;
}

#chatContainer {
  max-width: 1000px;
  max-height: 880px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow-elevated);
}

#chatContainer > header {
  padding: .875rem 1.5rem;
  background: var(--surface-glass);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.wordmark-vitmeet,
.dark .wordmark-vitmeet {
  background: linear-gradient(135deg, #d8b4fe 0%, #a855f7 45%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, .55));
  font-family: Vazirmatn, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* The current DOM gained a rail for reliable scrolling. Visually it becomes
   the old single-column conversation area. */
.chat-stage {
  display: flex;
  min-height: 0;
  grid-template-columns: none;
}

.chat-rail {
  display: flex;
  flex: 1;
  width: 100%;
  min-height: 0;
}

#chat {
  padding: 1.5rem 1.25rem;
  scrollbar-gutter: auto;
}

#chatInner {
  max-width: 720px;
  margin-inline: auto;
}

#chatContainer:not(.is-chat-active) #chat {
  flex-grow: 1;
  justify-content: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

#chatContainer:not(.is-chat-active) .composer-region {
  flex-grow: 0;
  justify-content: flex-start;
  min-height: 0;
}

.composer-region {
  padding: 1rem 1.25rem 1.5rem;
  background: transparent;
}

.composer-stack {
  max-width: 672px;
  margin-inline: auto;
}

#chatGreeting {
  padding-inline: 1rem;
  padding-bottom: 1rem;
}

.assistant-mark {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  border-radius: 1rem;
  color: #c084fc;
  background: rgba(147, 51, 234, .10);
  border-color: rgba(192, 132, 252, .28);
  box-shadow: 0 10px 28px rgba(124, 58, 237, .16);
}

#chatGreeting h1 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 700;
}

#chatGreeting p {
  max-width: 32rem;
  font-size: .875rem;
}

.suggestion-chips {
  margin-block: .5rem 1rem;
}

.suggestion-chip {
  min-height: 38px;
  padding: .45rem .9rem;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.suggestion-chip:hover {
  background: rgba(147, 51, 234, .12);
  border-color: rgba(192, 132, 252, .4);
  color: var(--text-main);
}

.model-control {
  justify-content: center;
  max-width: 672px;
  margin-bottom: .75rem;
}

.model-control select,
.model-control-static {
  flex: 0 1 300px;
  border-radius: .75rem;
}

.composer-dock {
  background: linear-gradient(to top, var(--bg-chat) 70%, transparent);
  padding-bottom: 0;
}

.composer-shell {
  display: flex;
  align-items: flex-end;
  gap: .375rem;
  padding: .45rem;
  border-radius: 24px;
  background: var(--bg-input-area);
  box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, var(--shadow-soft);
}

.composer-input {
  order: 2;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: .65rem .5rem;
  font-size: .9375rem;
}

#attachBtn { order: 1; }
#micBtn { order: 3; }
#send, #stopBtn { order: 4; }

.composer-tool {
  flex: 0 0 40px;
  min-height: 40px;
  border-radius: 999px;
}

.composer-hints { justify-content: center; }

#chatContainer.is-chat-active .composer-region {
  position: static;
}

/* Preserve legacy card proportions without causing a narrow-screen overflow. */
@media (max-width: 767px) {
  #layoutWrapper > div:last-child { padding: 0; }
  #chatContainer { border: 0; border-radius: 0; box-shadow: none; }
  #chatContainer > header { padding: .75rem 1rem; }
  #chat { padding-inline: 1rem; }
  .composer-region { padding: .75rem 1rem max(.9rem, env(safe-area-inset-bottom)); }
  .model-control { justify-content: flex-start; }
  .model-control select, .model-control-static { flex: 1; }
  .composer-shell { border-radius: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .wordmark-vitmeet { filter: none; }
}
