* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
.dark ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}
.light ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

/* Animations */
@keyframes bounce-berry {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left-msg {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(232, 67, 147, 0.4); }
  50% { box-shadow: 0 0 20px rgba(232, 67, 147, 0.7); }
}

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-8px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-bounce-berry {
  animation: bounce-berry 2s ease-in-out infinite;
}

.animate-fade-in-up {
  animation: fade-in-up 0.4s ease-out forwards;
}

.animate-slide-in-left {
  animation: slide-in-left 0.3s ease-out;
}

.animate-msg-right {
  animation: slide-in-right 0.3s ease-out forwards;
}

.animate-msg-left {
  animation: slide-in-left-msg 0.3s ease-out forwards;
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

.dot-bounce-1 { animation: dot-bounce 1.4s ease-in-out infinite; }
.dot-bounce-2 { animation: dot-bounce 1.4s ease-in-out 0.2s infinite; }
.dot-bounce-3 { animation: dot-bounce 1.4s ease-in-out 0.4s infinite; }

/* Glassmorphism */
.glass-dark {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.glass-light {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #e84393, #a855f7, #e84393);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* Markdown styling in bot messages */
.bot-markdown h1, .bot-markdown h2, .bot-markdown h3 {
  font-weight: 700;
  margin: 0.75em 0 0.4em;
}
.bot-markdown h1 { font-size: 1.4em; }
.bot-markdown h2 { font-size: 1.2em; }
.bot-markdown h3 { font-size: 1.05em; }
.bot-markdown p { margin: 0.4em 0; line-height: 1.65; }
.bot-markdown ul, .bot-markdown ol { margin: 0.5em 0; padding-left: 1.5em; }
.bot-markdown li { margin: 0.2em 0; }
.bot-markdown a { color: #a855f7; text-decoration: underline; }
.bot-markdown strong { font-weight: 700; }
.bot-markdown em { font-style: italic; }

.bot-markdown code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.dark .bot-markdown code {
  background: rgba(0,0,0,0.4);
  color: #f472b6;
}
.light .bot-markdown code {
  background: rgba(0,0,0,0.06);
  color: #be185d;
}

.bot-markdown pre {
  margin: 0.75em 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.bot-markdown pre code {
  display: block;
  padding: 1em;
  overflow-x: auto;
  font-size: 0.82em;
  line-height: 1.5;
  background: transparent;
  color: inherit;
}

.dark .bot-markdown pre {
  background: #0d0d1a;
  border: 1px solid rgba(255,255,255,0.06);
}
.dark .bot-markdown pre code {
  color: #e2e8f0;
}

.light .bot-markdown pre {
  background: #f1f5f9;
  border: 1px solid rgba(0,0,0,0.08);
}
.light .bot-markdown pre code {
  color: #334155;
}

.bot-markdown blockquote {
  border-left: 3px solid #a855f7;
  padding-left: 1em;
  margin: 0.5em 0;
  opacity: 0.85;
}

/* Textarea auto-grow */
textarea {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* Custom toggle */
.toggle-track {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}
.toggle-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  transition: left 0.3s, background 0.3s;
}

/* Tooltip */
.tooltip-wrapper {
  position: relative;
}
.tooltip-wrapper .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  z-index: 999;
  margin-bottom: 6px;
}
.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* Mobile overlay */
@media (max-width: 768px) {
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
  }
}

/* Selection */
::selection {
  background: rgba(232, 67, 147, 0.3);
}

/* Copy code button in pre blocks */
.copy-code-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s;
  z-index: 5;
}
.dark .copy-code-btn {
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.1);
}
.dark .copy-code-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #e2e8f0;
}
.light .copy-code-btn {
  background: rgba(0,0,0,0.05);
  color: #64748b;
  border: 1px solid rgba(0,0,0,0.1);
}
.light .copy-code-btn:hover {
  background: rgba(0,0,0,0.1);
  color: #334155;
}