/* new file: WhatsApp-like theme and layout */
/* Color system (max 5):
   --wa-green: header primary
   --wa-bg: chat background
   --wa-incoming: incoming bubble
   --wa-outgoing: outgoing bubble
   --wa-text: text color
*/
:root {
  --wa-green: #075e54;
  --wa-bg: #ece5dd;
  --wa-incoming: #ffffff;
  --wa-outgoing: #dcf8c6;
  --wa-text: #111111;

  --wa-muted: #667085;
  --wa-border: #e5e7eb;
  --radius: 12px;
  --max-bubble: 72ch;
  --space: 12px;
  --space-sm: 8px;
  --space-lg: 16px;
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}

.wa-body {
  margin: 0;
  font-family: var(--font);
  color: var(--wa-text);
  background: var(--wa-bg);
}

.wa-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--wa-green);
  color: #ffffff;
  padding: 12px 16px;
  box-shadow: var(--shadow-2);
}
.wa-header-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.wa-header-subtitle {
  opacity: 0.9;
  font-size: 12px;
  margin-top: 2px;
}

.wa-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.wa-card {
  background: #fff;
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  padding: 16px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow);
}
.wa-card-title {
  margin: 0 0 12px 0;
  font-size: 18px;
}
.wa-form .wa-field {
  margin-bottom: 12px;
}
.wa-label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
}
.wa-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--wa-border);
  border-radius: 10px;
  background: #fff;
}
.wa-help {
  margin: 6px 0 0;
  color: var(--wa-muted);
  font-size: 12px;
}
.wa-actions {
  margin-top: 12px;
}
.wa-button {
  background: var(--wa-green);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.wa-button:hover {
  opacity: 0.95;
}
.wa-footer {
  text-align: center;
  color: var(--wa-muted);
  font-size: 12px;
  padding: 16px;
}

.wa-chat-wrapper {
  height: calc(100vh - 64px);
  overflow: hidden;
}
.wa-chat {
  height: 100%;
  overflow-y: auto;
  padding: 16px 12px 24px;
  background: radial-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px) 0 0 / 24px 24px, var(--wa-bg);
}

.wa-system {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.wa-system-badge {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
}

.wa-row {
  display: flex;
  margin: 4px 0;
}
.wa-left {
  justify-content: flex-start;
}
.wa-right {
  justify-content: flex-end;
}

.wa-bubble {
  max-width: min(92%, var(--max-bubble));
  padding: 8px 10px 6px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  position: relative;
}
.wa-bubble-in {
  background: var(--wa-incoming);
  border-top-left-radius: 4px;
}
.wa-bubble-out {
  background: var(--wa-outgoing);
  border-top-right-radius: 4px;
}
.wa-sender {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #146c94;
}
.wa-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.5;
}
.wa-meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  opacity: 0.7;
  font-size: 11px;
}

.wa-image img {
  display: block;
  max-width: min(320px, 80vw);
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--wa-border);
  box-shadow: var(--shadow);
}
.wa-sticker img {
  display: block;
  width: 160px;
  height: auto;
  image-rendering: -webkit-optimize-contrast;
}
.wa-voice audio {
  width: min(280px, 70vw);
}

@media (min-width: 768px) {
  .wa-card {
    padding: 20px;
  }
  .wa-chat {
    padding: 20px 16px 28px;
  }
}
