body {
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  transition: background 0.3s ease;
}

.theme-dark {
  background: #fff;
  color: #020f26;

  --answer-bg: #f1f5f9;
  --answer-color: #1e293b;
}

.theme-light {
  background: #0f172a;
  color: #f1f5f9;

  --answer-bg: #1e293b;
  --answer-color: #f1f5f9;
}

a {
  text-decoration: none;
}

.theme-dark a {
  color: #2563eb;
}

.theme-light a {
  color: #60a5fa;
}

#vexoo-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 100px;
  height: 80px;
  background: #031028;
  border-radius: 16px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulse 1.5s ease-in-out 1;
  transition: all 0.3s ease;
}

#vexoo-launcher:hover {
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.8);
}

#vexoo-launcher img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(59, 130, 246, 0.4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(59, 130, 246, 0.4);
  }
}

#chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 30vw;
  height: 60vh;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  background: var(--widget-bg);
  z-index: 1000;
  overflow: hidden;
}

#chat-widget.maximized {
  width: 100vw;
  height: 100vh;
  bottom: 0;
  right: 0;
  border-radius: 0;
}

.theme-dark #chat-widget {
  --widget-bg: #fff;
}

.theme-light #chat-widget {
  --widget-bg: #0f172a;
}

#splash-inside {
  position: absolute;
  inset: 0;
  background-color: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#splash-inside img {
  max-width: 90%;
  max-height: 90%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 20px;
}

#widget-ui {
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 11;
}

#header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 8px;
  background: inherit;
}

#logo {
  height: 56px;
}

#header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#header-actions button {
  background: none;
  border: none;
  font-size: 16px;
  color: inherit;
  cursor: pointer;
}

#chat-box {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
}

#chat-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#loader {
  text-align: center;
  margin: 10px 0;
}

#input-area {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: inherit;
}

#input-area input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: none;
  background: white;
  color: black;
}

#input-area button {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background-color: #3b82f6;
  color: white;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.user-msg {
  align-self: flex-end;
  background: #1d4ed8;
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
}

.ai-msg {
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--answer-bg);
  color: var(--answer-color);
}

.theme-light .ai-msg {
  background: #e2e8f0;
  color: #1e293b;
}

.ai-msg .answer-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.ai-msg .answer-logo img {
  height: 18px;
  width: auto;
}

#footer {
  text-align: center;
  font-size: 11px;
  padding: 6px 12px;
  background: inherit;
  color: inherit;
}

/* Answer theme fix */

/* Forced dark theme for widget content */

/* Hard override of all widget children inside dark theme context */
.theme-dark #chat-widget,
.theme-dark #chat-widget *,
.theme-dark #chat-widget input,
.theme-dark #chat-widget button,
.theme-dark #chat-widget #widget-ui,
.theme-dark #chat-widget #input-area input,
.theme-dark #chat-widget #footer {
  background-color: #020f26 !important;
  color: #fff !important;
  border-color: transparent;
}

.theme-dark #chat-widget #input-area input {
  background-color: #1e293b !important;
  color: #fff !important;
  width: 100%;
}

.theme-dark #chat-widget .ai-msg {
  color: #fff !important;
}

.theme-dark #chat-widget .user-msg {
  background-color: #737578 !important;
  color: #fff !important;
}

/* Light theme full propagation fix */

/* Ensure light mode colors propagate to all relevant widget UI elements */
.theme-light #chat-widget,
.theme-light #chat-widget *,
.theme-light #chat-widget #widget-ui,
.theme-light #chat-widget input,
.theme-light #chat-widget button,
.theme-light #chat-widget #input-area input,
.theme-light #chat-widget #footer {
  background-color: #fff !important;
  color: #0f172a !important;
  border-color: #cbd5e1;
}

.theme-light #chat-widget #input-area input {
  background-color: #f1f5f9 !important;
  color: #0f172a !important;
  width: 100%;
}

.theme-light #chat-widget .ai-msg {
  color: #1e293b !important;
}

.theme-light #chat-widget .user-msg {
  background-color: #737578 !important;
  color: #fff !important;
}

/* Send button hover + styling fix */

/* Fix Send button styling and cursor */

#input-area button:hover {
  background-color: #2563eb;
}

.answer-logo .answer-text {
  font-weight: bold;
  font-size: 13px;
  margin-left: 6px;
}

.theme-dark .answer-logo .answer-text {
  color: #fff;
}

.theme-light .answer-logo .answer-text {
  color: #000;
}

.stream-typing {
  white-space: pre-wrap;
  font-family: monospace;
  font-size: 14px;
}

/* Prevent horizontal scroll entirely */
body,
html {
  overflow-x: hidden;
}

/* Chat content scrollbar fixes */
#chat-box::-webkit-scrollbar {
  width: 6px;
}

.theme-dark #chat-box::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.theme-light #chat-box::-webkit-scrollbar-thumb {
  background-color: rgba(15, 23, 42, 0.15);
  border-radius: 6px;
}

#chat-box::-webkit-scrollbar-track {
  background: transparent;
}
