@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --wa-header-bg: #075e54;
  --wa-header-dark: #128c7e;
  --wa-bg: #efeae2;
  --wa-bubble-bot: #ffffff;
  --wa-bubble-user: #d9fdd3;
  --wa-accent: #00a884;
}

body {
  font-family: var(--font-main);
  background-color: #d1d5db;
  color: #111827;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}

/* WhatsApp Container Frame */
.whatsapp-app-container {
  max-width: 500px;
  width: 100%;
  height: 100vh;
  max-height: 900px;
  margin: 0 auto;
  display: flex;
  flex-col;
  background-color: var(--wa-bg);
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .whatsapp-app-container {
    height: 92vh;
    border-radius: 1.5rem;
    margin-top: 4vh;
    margin-bottom: 4vh;
    border: 1px solid #cbd5e1;
  }
}

/* WhatsApp Header */
.wa-header {
  background-color: var(--wa-header-bg);
  color: #ffffff;
}

/* Chat Scrollable Area */
.wa-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scroll-behavior: smooth;
}

/* Chat Bubbles */
.chat-bubble {
  max-width: 85%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  animation: bubblePop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bubblePop {
  0% { opacity: 0; transform: scale(0.9) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.chat-bubble-bot {
  align-self: flex-start;
  background-color: var(--wa-bubble-bot);
  color: #111827;
  border-radius: 0 1.25rem 1.25rem 1.25rem;
}

.chat-bubble-user {
  align-self: flex-end;
  background-color: var(--wa-bubble-user);
  color: #111827;
  border-radius: 1.25rem 0 1.25rem 1.25rem;
}

.chat-timestamp {
  font-size: 0.65rem;
  color: #6b7280;
  float: right;
  margin-left: 0.75rem;
  margin-top: 0.35rem;
  display: flex;
  items-center;
  gap: 0.2rem;
}

/* Interactive Chips inside Chat */
.wa-chip-btn {
  background-color: #ffffff;
  border: 1.5px solid #128c7e;
  color: #075e54;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 0.6rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 2px 5px rgba(18, 140, 126, 0.15);
}

.wa-chip-btn:hover, .wa-chip-btn:active {
  background-color: #128c7e;
  color: #ffffff;
  transform: translateY(-1px);
}

.wa-chip-btn.selected {
  background-color: #075e54;
  color: #ffffff;
  border-color: #075e54;
  box-shadow: 0 4px 10px rgba(7, 94, 84, 0.3);
}

/* Typing Bouncing Dots */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.4rem 0.6rem;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: #9ca3af;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* WhatsApp Bottom Dock */
.wa-dock {
  background-color: #f0f2f5;
  border-t: 1px solid #e5e7eb;
  padding: 0.75rem;
}

/* Printable PDF Template */
#pdf-report-template {
  background-color: #ffffff;
  color: #0f172a;
}

@media print {
  body * { visibility: hidden; }
  #pdf-report-template, #pdf-report-template * { visibility: visible; }
  #pdf-report-template { position: absolute; left: 0; top: 0; width: 100%; }
}
