/* R4PW theme: WHATSAPP look (light + dark)
   Place at: public/css/r4pw/r4pw-theme-whatsapp.css
   Loaded ONLY when the admin panel selects the "WhatsApp" chat widget style (after r4pw-base.css).
   Light and dark are both here. Dark follows the menu theme button through <html data-theme="dark">.
   THEME HOOK: if the menu switch uses another hook (a class, another attribute), change the selector
   on the dark block below, and nothing else.
   Palette follows today's WhatsApp and the reference screens supplied for this project:
   light  green header #008069, chat wallpaper #E5DDD5 + doodle image, white received bubbles, sent #E7FFDD,
          input bar #F0F2F5, send button #00A884.
   dark   header and bubbles #202C33, chat canvas #0B141A + doodle image at 7%, sent #005C4B, text #E9EDEF.
   Only text contrast was nudged (muted greys, green text) to hold 4.5:1. */

/* ---- light ---- */
.r4pw{
  --r4pw-surface:#E5DDD5;--r4pw-card:#FFFFFF;--r4pw-head:#008069;--r4pw-bar:#F0F2F5;--r4pw-field:#FFFFFF;
  --r4pw-head-ink:#FFFFFF;--r4pw-head-sub:#FFFFFF;--r4pw-ava-ring:#FFFFFF;
  --r4pw-head-hover:rgba(255,255,255,.16);--r4pw-grab:rgba(255,255,255,.55);
  --r4pw-border:#E9EDEF;--r4pw-border-hover:#D1D7DB;--r4pw-ink:#111B21;--r4pw-muted:#5F707A;
  --r4pw-brand:#00A884;--r4pw-brand-text:#008069;--r4pw-on-brand:#FFFFFF;--r4pw-tint:#D9FDD3;--r4pw-accent:#008069;
  --r4pw-shadow:rgba(11,20,26,.25);--r4pw-scrim:rgba(11,20,26,.5);--r4pw-soft:rgba(11,20,26,.13);
  --r4pw-badge:#007BFC;--r4pw-badge-check:#FFFFFF;--r4pw-badge-ring:#FFFFFF;
  --r4pw-sent:#E7FFDD;--r4pw-sent-ink:#111B21;--r4pw-sent-bd:transparent;--r4pw-cta-bg:#008069;--r4pw-cta-ink:#FFFFFF;
  --r4pw-panel-r:16px;--r4pw-bubble-r:0 8px 8px 8px;--r4pw-act-r:8px;
  --r4pw-wall:var(--r4pw-wall-light);--r4pw-wall-o:1;
}

/* ---- dark (THEME HOOK) ---- */
[data-theme="dark"] .r4pw{
  --r4pw-surface:#0B141A;--r4pw-card:#202C33;--r4pw-head:#202C33;--r4pw-bar:#202C33;--r4pw-field:#202C33;
  --r4pw-head-ink:#E9EDEF;--r4pw-head-sub:#93A3AD;--r4pw-ava-ring:#3B4A54;
  --r4pw-head-hover:rgba(255,255,255,.1);--r4pw-grab:#3B4A54;
  --r4pw-border:#222D34;--r4pw-border-hover:#3B4A54;--r4pw-ink:#E9EDEF;--r4pw-muted:#93A3AD;
  --r4pw-brand:#00A884;--r4pw-brand-text:#25D366;--r4pw-on-brand:#111B21;--r4pw-tint:rgba(0,168,132,.18);--r4pw-accent:#06CF9C;
  --r4pw-shadow:rgba(0,0,0,.55);--r4pw-scrim:rgba(0,0,0,.65);--r4pw-soft:rgba(0,0,0,.35);
  --r4pw-badge-ring:transparent;
  --r4pw-sent:#005C4B;--r4pw-sent-ink:#E9EDEF;--r4pw-cta-bg:#00A884;--r4pw-cta-ink:#111B21;
  --r4pw-wall:var(--r4pw-wall-dark);--r4pw-wall-o:.07;
}

/* ======================================================================
   WhatsApp-specific shapes (override the shared base; same selectors, one class higher)
   ====================================================================== */

/* S4 · HEADER */
.r4pw .r4pw-hd{border-bottom-color:transparent}
.r4pw .r4pw-hd__avatar{border-color:var(--r4pw-border-hover)}

/* S6 · MESSAGES + OPTIONS */
.r4pw :is(.r4pw-greet,.r4pw-ask,.r4pw-info){border-color:transparent;box-shadow:0 1px 1px var(--r4pw-soft)}
.r4pw :is(.r4pw-greet,.r4pw-ask,.r4pw-info)::before{content:"";position:absolute;top:-1px;left:-9px;width:8px;height:13px;background:var(--r4pw-card);clip-path:polygon(100% 0,0 0,100% 100%)}
.r4pw .r4pw-sel{border-radius:8px 0 8px 8px;box-shadow:0 1px 1px var(--r4pw-soft)}
.r4pw .r4pw-sel::before{content:"";position:absolute;top:-1px;right:-9px;width:8px;height:13px;background:var(--r4pw-sent);clip-path:polygon(0 0,100% 0,0 100%)}
.r4pw .r4pw-opts{gap:6px}
.r4pw :is(.r4pw-opt,.r4pw-optlink){justify-content:center;gap:8px;min-height:46px;border-color:transparent;box-shadow:0 1px 1px var(--r4pw-soft);color:var(--r4pw-brand-text);text-align:center}
.r4pw :is(.r4pw-opt__icon,.r4pw-optlink__icon){width:auto;height:auto;background:transparent}
.r4pw :is(.r4pw-opt__icon-svg,.r4pw-optlink__icon-svg){width:18px;height:18px}
.r4pw :is(.r4pw-opt__label,.r4pw-optlink__label){flex:none;text-align:center}
.r4pw :is(.r4pw-opt__arrow,.r4pw-optlink__arrow){display:none}
.r4pw :is(.r4pw-back,.r4pw-skip,.r4pw-sentchip){border-color:transparent;box-shadow:0 1px 1px var(--r4pw-soft)}

/* S7 · COMPOSER */
.r4pw .r4pw-comp{grid-template-columns:1fr 48px;gap:8px;padding:8px 8px calc(8px + env(safe-area-inset-bottom,0px));background:transparent;border-top:0}
.r4pw .r4pw-comp__input{min-height:46px;padding:11px 18px;border-color:transparent;border-radius:23px;box-shadow:0 1px 2px var(--r4pw-soft)}
.r4pw .r4pw-comp__input:focus{border-color:transparent;box-shadow:0 0 0 2px var(--r4pw-brand)}
.r4pw .r4pw-comp__send{width:48px;height:48px;box-shadow:0 1px 3px var(--r4pw-soft)}
.r4pw :is(.r4pw-comp__ico-wa,.r4pw-comp__ico-line,.r4pw-comp__ico-fill){width:24px;height:24px}
.r4pw .r4pw-comp__send[data-r4pw-state="typed"] .r4pw-comp__ico-line{display:none}
.r4pw .r4pw-comp__send[data-r4pw-state="typed"] .r4pw-comp__ico-fill{display:block}
.r4pw .r4pw-comp__hint{justify-self:center;padding:3px 10px;border-radius:8px;background:var(--r4pw-card);box-shadow:0 1px 1px var(--r4pw-soft)}
