/* ═══════════════════════════════════════════════════════════
   WhatsApp Chat UI Styles
   ═══════════════════════════════════════════════════════════ */

:root {
  --wa-primary: #008069;
  --wa-primary-dark: #005c4b;
  --wa-bg-color: #efeae2;
  --wa-msg-in: #ffffff;
  --wa-msg-out: #d9fdd3;
  --wa-text: #111b21;
  --wa-text-light: #667781;
  --wa-bubble-radius: 8px;
}

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

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--wa-bg-color);
  color: var(--wa-text);
  height: 100vh;
  height: 100dvh; /* Fixes mobile address bar issue */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ─── Header ─── */
.wa-header {
  background-color: var(--wa-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  height: 60px;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wa-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-back-btn {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.wa-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #dfe5e7;
  overflow: hidden;
}

.wa-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wa-contact-info {
  display: flex;
  flex-direction: column;
}

.wa-contact-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.wa-contact-status {
  font-size: 13px;
  opacity: 0.9;
}

.wa-header-right {
  display: flex;
  align-items: center;
  cursor: pointer;
}

/* ─── Chat Area ─── */
.wa-chat-area {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 20px 5%;
  overflow-y: auto;
}

/* WhatsApp Doodle Background */
.wa-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
  background-repeat: repeat;
  opacity: 0.06;
  z-index: -1;
  pointer-events: none;
}

.wa-message {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.wa-msg-bot {
  align-self: flex-start;
}

.wa-msg-user {
  align-self: flex-end;
}

.wa-bubble {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--wa-bubble-radius);
  font-size: 15px;
  line-height: 1.6;
  box-shadow: 0 1px 0.5px rgba(11,20,26,0.13);
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.wa-msg-bot .wa-bubble {
  background-color: var(--wa-msg-in);
  border-top-right-radius: 0;
}

.wa-msg-user .wa-bubble {
  background-color: var(--wa-msg-out);
  border-top-left-radius: 0;
}

.wa-bubble-text {
  margin-bottom: 4px;
}

.wa-bubble-text b {
  color: var(--wa-primary-dark);
}

.wa-bubble-text ul {
  padding-right: 20px;
  margin-top: 5px;
}

.wa-time {
  font-size: 11px;
  color: var(--wa-text-light);
  align-self: flex-end;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── Input Area ─── */
.wa-footer {
  background-color: #f0f2f5;
  padding: 10px 16px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  z-index: 10;
}

.wa-icon-btn {
  background: none;
  border: none;
  color: #54656f;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wa-input-container {
  flex: 1;
  background-color: #ffffff;
  border-radius: 20px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
}

.wa-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  resize: none;
  max-height: 100px;
  min-height: 24px;
  line-height: 24px;
}

.wa-send-btn {
  background-color: var(--wa-primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.wa-send-btn:hover {
  background-color: var(--wa-primary-dark);
}

.wa-send-btn svg {
  transform: translateX(-1px);
}

/* Typing Indicator */
.typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px !important;
}

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

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Desktop layout removed to make it fullscreen */
@media (min-width: 768px) {
  .wa-message {
    max-width: 70%;
  }
}
