/* Quickmart WhatsApp Smart Shopper — chat simulator */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --wa-green-dark: #075E54;
  --wa-green: #00A884;
  --wa-teal-header: #008069;
  --wa-chat-bg: #EFEAE2;
  --wa-out-bubble: #D9FDD3;
  --wa-in-bubble: #FFFFFF;
  --wa-blue-tick: #53BDEB;
  --wa-btn-text: #00A5F4;
  --qm-red: #E4002B;
  --ink: #111B21;
  --page-bg: #0B141A;
}
html, body { height: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 70% -10%, #1c2c35 0%, var(--page-bg) 55%);
  color: #e9edef;
  display: flex; align-items: center; justify-content: center;
  gap: 42px; padding: 26px; min-height: 100vh;
}

/* ---------- side panel (demo controls) ---------- */
.side {
  width: 330px; max-width: 92vw;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 18px; padding: 22px;
  backdrop-filter: blur(6px);
}
.side .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.side .brand .logo {
  width: 42px; height: 42px; border-radius: 12px; background: var(--qm-red);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; color: #fff; letter-spacing: -1px;
}
.side .brand h1 { font-size: 17px; line-height: 1.25; }
.side .brand small { color: #8696a0; font-weight: 400; display: block; font-size: 12px; }
.side .sec { margin-top: 18px; }
.side label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #8696a0; display: block; margin-bottom: 7px; }
.side select {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: #202c33; border: 1px solid rgba(255,255,255,.12); color: #e9edef; outline: none;
}
.side .hint { font-size: 12.5px; color: #aebac1; line-height: 1.55; }
.side .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.side .chip {
  border: 1px solid rgba(0,168,132,.55); color: #7fd8c5; background: rgba(0,168,132,.08);
  font-size: 12.5px; border-radius: 999px; padding: 7px 12px; cursor: pointer; transition: .15s;
}
.side .chip:hover { background: rgba(0,168,132,.22); }
.side .links { display: flex; flex-direction: column; gap: 8px; }
.side .links a {
  color: #e9edef; text-decoration: none; font-size: 13.5px;
  background: rgba(255,255,255,.06); padding: 10px 13px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08); transition: .15s;
}
.side .links a:hover { background: rgba(255,255,255,.12); }
.side .reset { color: #f28b82 !important; }
.side .foot { margin-top: 18px; font-size: 11.5px; color: #667781; line-height: 1.5; }

/* ---------- phone ---------- */
.phone {
  width: 393px; height: 800px; max-height: 94vh;
  background: #000; border-radius: 46px; padding: 11px;
  box-shadow: 0 30px 80px rgba(0,0,0,.65), 0 0 0 2px #2a3942 inset;
  position: relative; flex-shrink: 0;
}
.phone .screen {
  width: 100%; height: 100%; border-radius: 36px; overflow: hidden;
  display: flex; flex-direction: column; background: var(--wa-chat-bg);
}
.notch {
  position: absolute; top: 11px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 28px; background: #000; border-radius: 0 0 18px 18px; z-index: 40;
}

/* status bar */
.statusbar {
  background: var(--wa-teal-header); color: #fff; font-size: 12px;
  display: flex; justify-content: space-between; padding: 8px 22px 2px; font-weight: 600;
}

/* header */
.wa-header {
  background: var(--wa-teal-header); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px;
}
.wa-header .back { font-size: 20px; opacity: .95; }
.wa-header .avatar {
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--qm-red);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px;
  flex-shrink: 0;
}
.wa-header .avatar.staff-av { color: #075E54; }
.wa-header .who { flex: 1; min-width: 0; }
.wa-header .who .name { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wa-header .who .name .verified {
  display: inline-flex; width: 15px; height: 15px; border-radius: 50%; background: #25D366;
  color: #fff; font-size: 10px; align-items: center; justify-content: center;
}
.wa-header .who .sub { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-header .icons { display: flex; gap: 18px; font-size: 17px; opacity: .95; }

/* chat area with WhatsApp doodle-ish background */
.chat {
  flex: 1; overflow-y: auto; padding: 14px 12px 10px;
  background:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.020) 0 8px, transparent 9px),
    radial-gradient(circle at 75% 60%, rgba(0,0,0,.020) 0 6px, transparent 7px),
    radial-gradient(circle at 45% 85%, rgba(0,0,0,.020) 0 7px, transparent 8px),
    var(--wa-chat-bg);
  background-size: 180px 180px, 220px 220px, 260px 260px, auto;
}
.chat::-webkit-scrollbar { width: 5px; }
.chat::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 3px; }

.datechip {
  margin: 6px auto 12px; width: max-content; background: #fff; color: #54656f;
  font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.sysnote {
  margin: 4px auto 12px; width: max-content; max-width: 86%; text-align: center;
  background: #FFF3C7; color: #54656f; font-size: 12px; padding: 6px 12px; border-radius: 8px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08);
}

.row { display: flex; margin-bottom: 4px; }
.row.in  { justify-content: flex-start; }
.row.out { justify-content: flex-end; }
.bubble {
  max-width: 82%; padding: 7px 9px 8px; border-radius: 9px; position: relative;
  font-size: 14.2px; line-height: 1.42; color: var(--ink);
  box-shadow: 0 1px 1px rgba(0,0,0,.09); white-space: pre-wrap; word-wrap: break-word;
}
.row.in  .bubble { background: var(--wa-in-bubble); border-top-left-radius: 2px; }
.row.out .bubble { background: var(--wa-out-bubble); border-top-right-radius: 2px; }
.bubble .sender-tag { font-size: 12px; font-weight: 700; color: var(--wa-teal-header); margin-bottom: 3px; }
.bubble .sender-tag.campaign-tag { color: #d33f92; }
.bubble .timerow {
  float: right; margin: 6px -2px -4px 8px; font-size: 11px; color: #667781;
  display: flex; align-items: center; gap: 3px;
}
.bubble .ticks { color: var(--wa-blue-tick); font-size: 12px; letter-spacing: -2px; }

/* interactive quick-reply buttons */
.btnstack { max-width: 82%; width: 100%; }
.btnstack .bubble { max-width: 100%; }
.wa-btns { margin-top: 5px; display: flex; flex-direction: column; gap: 5px; }
.wa-btn {
  background: #fff; border: none; color: var(--wa-btn-text); font-size: 14px; font-weight: 500;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; box-shadow: 0 1px 1px rgba(0,0,0,.09);
  transition: .12s; font-family: inherit;
}
.wa-btn:hover { background: #f2fbff; }
.wa-btn:disabled { opacity: .55; cursor: default; }

/* typing indicator */
.typing .bubble { display: inline-flex; gap: 5px; align-items: center; padding: 12px 14px; }
.typing .dot { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: blink 1.2s infinite; }
.typing .dot:nth-child(2) { animation-delay: .2s; }
.typing .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* input bar */
.inputbar { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: transparent; }
.inputbar .field {
  flex: 1; display: flex; align-items: center; gap: 9px; background: #fff;
  border-radius: 24px; padding: 9px 14px; box-shadow: 0 1px 1px rgba(0,0,0,.08);
}
.inputbar .field .emoji { font-size: 19px; opacity: .55; }
.inputbar input {
  flex: 1; border: none; outline: none; font-size: 14.5px; font-family: inherit; color: var(--ink);
  background: transparent;
}
.inputbar .send {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--wa-green); color: #fff; font-size: 18px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; transition: .15s;
}
.inputbar .send:hover { background: #01977a; }

/* staff theme */
body.staff-theme .statusbar, body.staff-theme .wa-header { background: #1F2C34; }
body.staff-theme .wa-header .avatar { background: #00A884; color: #fff; }
body.staff-theme .side .chip { border-color: rgba(83,189,235,.5); color: #8fd3f2; background: rgba(83,189,235,.08); }
body.staff-theme .side .chip:hover { background: rgba(83,189,235,.2); }

@media (max-width: 900px) {
  body { flex-direction: column; padding: 12px; gap: 18px; }
  .phone { height: 88vh; width: min(393px, 96vw); }
  .side { order: 2; }
}
