/* ── WhatsApp Mocker ────────────────────────────────────────────────────────── */

/* Sidebar */
.wa-left {
  width: 290px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
}
.wa-left-hdr {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-lt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.wa-left-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: 0.2px;
}
.wa-new-btn {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
  font-family: inherit;
}
.wa-new-btn:hover { background: #1ebe5d; }

.wa-thread-list { flex: 1; overflow-y: auto; }

/* Thread item */
.wa-thread-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  border-left: 3px solid transparent;
  transition: background 0.12s;
}
.wa-thread-item:hover { background: #f6fbf7; }
.wa-thread-item.active {
  background: #e8fae9;
  border-left-color: #25d366;
}
.wa-thread-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.wa-thread-info { flex: 1; min-width: 0; }
.wa-thread-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.wa-thread-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-thread-time { font-size: 10px; color: #aaa; flex-shrink: 0; }
.wa-thread-preview {
  font-size: 11px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.wa-thread-preview .wa-check { color: #25d366; font-weight: 700; margin-right: 3px; }

/* Empty list */
.wa-thread-empty {
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #ccc;
  font-size: 12px;
  text-align: center;
}
.wa-thread-empty svg { opacity: 0.4; margin-bottom: 4px; }

/* Channel section (bottom of sidebar) */
.wa-channel-section {
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
  padding: 12px 14px 10px;
}
.wa-channel-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 10px;
}
.wa-channel-banner.pending {
  background: #fff8e7;
  border: 1px solid #ffe0a3;
  color: #8a5a00;
}
.wa-channel-banner.ready {
  background: #ecfdf3;
  border: 1px solid #a3e7c0;
  color: #166534;
}
.wa-channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  margin-top: 4px;
}
.wa-channel-banner.ready .wa-channel-dot { background: #25d366; }
.wa-channel-title { font-weight: 600; font-size: 12px; line-height: 1.3; }
.wa-channel-sub { font-size: 11px; opacity: 0.85; margin-top: 1px; }

.wa-channel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.wa-setup-btn {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, opacity 0.12s;
}
.wa-setup-btn:hover:not(:disabled) { background: #1ebe5d; }
.wa-setup-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.wa-setup-status { font-size: 11px; color: #555; }

.wa-gateway-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: #aaa;
  word-break: break-all;
  line-height: 1.4;
}

/* Main pane */
.wa-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ece5dd;
}
.wa-pane {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

/* Empty state in main */
.wa-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
  background: #f4f6f5;
}
.wa-empty-icon { width: 64px; height: 64px; opacity: 0.55; }
.wa-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: #555;
  margin: 0;
}
.wa-empty-sub {
  font-size: 12px;
  color: #888;
  line-height: 1.6;
  max-width: 260px;
  margin: -4px 0 0;
}
.wa-cta-btn {
  background: #25d366;
  color: #fff;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 4px;
  font-family: inherit;
  transition: background 0.12s;
}
.wa-cta-btn:hover { background: #1ebe5d; }

/* Chat header */
.wa-chat-header {
  padding: 10px 16px;
  background: #075e54;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wa-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #128c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.wa-avatar-lg { width: 38px; height: 38px; font-size: 16px; }
.wa-chat-info { flex: 1; min-width: 0; }
.wa-chat-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wa-chat-phone {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.wa-icon-btn {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: none;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.wa-icon-btn:hover { background: rgba(255,255,255,0.22); }

.wa-new-fields {
  flex: 1;
  display: flex;
  gap: 8px;
}
.wa-compose-input {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  outline: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.15s;
}
.wa-compose-input::placeholder { color: rgba(255,255,255,0.55); }
.wa-compose-input:focus { background: rgba(255,255,255,0.22); }

/* Chat body */
.wa-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ece5dd;
}
.wa-chat-empty-hint {
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 13px;
  text-align: center;
}

/* Message rows */
.wa-msg-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 4px;
}
.wa-msg-row.in  { align-items: flex-start; }
.wa-msg-row.out { align-items: flex-end; }

.wa-bubble {
  max-width: 70%;
  padding: 7px 11px 6px;
  font-size: 13px;
  line-height: 1.45;
  color: #111;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  position: relative;
}
.wa-msg-row.in  .wa-bubble {
  background: #fff;
  border-radius: 8px 8px 8px 2px;
}
.wa-msg-row.out .wa-bubble {
  background: #dcf8c6;
  border-radius: 8px 8px 2px 8px;
}
.wa-bubble-meta {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
  padding: 0 4px;
}

/* Input bar */
.wa-input-bar {
  padding: 10px 14px;
  background: #f0f0f0;
  border-top: 1px solid #ddd;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.wa-textarea {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: #fff;
  min-height: 40px;
  max-height: 100px;
  line-height: 1.4;
}

/* Send button + spinner */
@keyframes wa-spin { to { transform: rotate(360deg); } }
.wa-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, opacity 0.12s;
}
.wa-send-btn:hover:not(:disabled) { background: #1ebe5d; }
.wa-send-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.wa-send-btn .wa-btn-icon { line-height: 1; }
.wa-send-btn .wa-btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wa-spin 0.7s linear infinite;
}
.wa-send-btn.loading .wa-btn-icon    { display: none; }
.wa-send-btn.loading .wa-btn-spinner { display: block; }

/* Status line */
.wa-status {
  padding: 4px 14px 8px;
  font-size: 12px;
  background: #f0f0f0;
  min-height: 22px;
  color: #888;
  flex-shrink: 0;
}

/* Visibility — controlled by JS via .style.display, default hidden */
#wa-main-empty,
#wa-main-new,
#wa-main-chat { display: none; }
#wa-main-empty.active,
#wa-main-new.active,
#wa-main-chat.active { display: flex; }
