@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

:root {
  /* WhatsApp Light Theme (Default) */
  --wa-bg: #efeae2;
  --wa-surface: #ffffff;
  --wa-header: #f0f2f5;
  --wa-nav: #f0f2f5;
  --wa-panel: #ffffff;
  --wa-input-bg: #f0f2f5;
  --wa-border: #e9edef;
  --wa-green: #00a884;
  --wa-green-hover: #02906f;
  --wa-green-dark: #008069;
  --wa-accent: #25d366;
  --bubble-sent: #d9fdd3;
  --bubble-received: #ffffff;
  --text-primary: #111b21;
  --text-secondary: #667781;
  --text-muted: #8696a0;
  --blue-ticks: #53bdeb;
}

html.dark, body.dark {
  /* WhatsApp Dark Theme */
  --wa-bg: #0b141a;
  --wa-surface: #111b21;
  --wa-header: #202c33;
  --wa-nav: #202c33;
  --wa-panel: #202c33;
  --wa-input-bg: #2a3942;
  --wa-border: #222e35;
  --wa-green: #00a884;
  --wa-green-hover: #06cf9c;
  --wa-green-dark: #00a884;
  --wa-accent: #25d366;
  --bubble-sent: #005c4b;
  --bubble-received: #202c33;
  --text-primary: #e9edef;
  --text-secondary: #8696a0;
  --text-muted: #8696a0;
  --blue-ticks: #53bdeb;
}

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

body {
  background-color: var(--wa-header);
  color: var(--text-primary);
  font-family: 'Hind Siliguri', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* WhatsApp Wallpaper Pattern: Authentic Light & Dark */
.wa-wallpaper {
  background-color: #efeae2;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.45) 0%, rgba(239, 234, 226, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 15a6 6 0 1 1 12 0 6 6 0 0 1-12 0zm50 20a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm40-10a5 5 0 1 1 10 0 5 5 0 0 1-10 0zM25 70a5 5 0 1 1 10 0 5 5 0 0 1-10 0zm45 15a6 6 0 1 1 12 0 6 6 0 0 1-12 0zm35-25a4 4 0 1 1 8 0 4 4 0 0 1-8 0z' fill='%23000000' fill-opacity='0.035' fill-rule='evenodd'/%3E%3C/svg%3E");
}

.dark .wa-wallpaper, html.dark .wa-wallpaper, body.dark .wa-wallpaper {
  background-color: #0b141a;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(17, 27, 33, 0.4) 0%, rgba(11, 20, 26, 0.95) 100%),
    url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 15a6 6 0 1 1 12 0 6 6 0 0 1-12 0zm50 20a4 4 0 1 1 8 0 4 4 0 0 1-8 0zm40-10a5 5 0 1 1 10 0 5 5 0 0 1-10 0zM25 70a5 5 0 1 1 10 0 5 5 0 0 1-10 0zm45 15a6 6 0 1 1 12 0 6 6 0 0 1-12 0zm35-25a4 4 0 1 1 8 0 4 4 0 0 1-8 0z' fill='%23ffffff' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #ced0d1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aebac1;
}
.dark ::-webkit-scrollbar-thumb {
  background: #374248;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #536067;
}

/* Prose Markdown Styling inside bubbles */
.prose-wa {
  font-size: 0.94rem;
  line-height: 1.55;
  color: #111b21;
  word-break: break-word;
}
.dark .prose-wa {
  color: #e9edef;
}
.prose-wa p {
  margin-bottom: 0.4rem;
}
.prose-wa p:last-child {
  margin-bottom: 0;
}
.prose-wa ul, .prose-wa ol {
  padding-left: 1.25rem;
  margin: 0.3rem 0;
}
.prose-wa li {
  margin-bottom: 0.2rem;
}
.prose-wa strong {
  color: #111b21;
  font-weight: 600;
}
.dark .prose-wa strong {
  color: #ffffff;
}
.prose-wa a {
  color: #027eb5;
  text-decoration: underline;
}
.dark .prose-wa a {
  color: #53bdeb;
}
.prose-wa code {
  background: rgba(0, 0, 0, 0.06);
  color: #111b21;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: monospace;
}
.dark .prose-wa code {
  background: rgba(0, 0, 0, 0.25);
  color: #e9edef;
}
.prose-wa pre {
  background: #f0f2f5;
  border: 1px solid #e9edef;
  color: #111b21;
  padding: 0.6rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.4rem 0;
}
.dark .prose-wa pre {
  background: #0f171d;
  border: 1px solid #2a3942;
  color: #e9edef;
}

/* Voice pulse animation */
@keyframes pulse-ring {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.mic-active {
  animation: pulse-ring 1.4s infinite cubic-bezier(0.25, 0, 0, 1);
}
