/* ===================================================================
   NAC WhatsApp Lead Bot — widget styles
   Self-contained. Namespaced under #nac-wab to avoid clashes.
   =================================================================== */

#nac-wab, #nac-wab * { box-sizing: border-box; }

/* ---- Chat panel ---- */
#nac-wab {
    position: fixed;
    bottom: 96px;
    right: 28px;
    z-index: 1000;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 140px);
    display: none;
    flex-direction: column;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
    font-family: 'DM Sans', 'Cairo', system-ui, sans-serif;
    background: #ECE5DD;
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
#nac-wab.nac-open { display: flex; opacity: 1; transform: translateY(0) scale(1); }

#nac-wab[dir="rtl"] { right: auto; left: 28px; }

/* ---- Header ---- */
#nac-wab .nac-head {
    background: #075E54;
    color: #fff;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
#nac-wab .nac-head .nac-ava {
    width: 40px; height: 40px; border-radius: 50%;
    background: #128C7E; flex: 0 0 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
#nac-wab .nac-head .nac-meta { flex: 1; min-width: 0; }
#nac-wab .nac-head .nac-name { font-weight: 700; font-size: 15px; line-height: 1.2; }
#nac-wab .nac-head .nac-status { font-size: 11px; opacity: 0.85; }
#nac-wab .nac-head .nac-close {
    background: transparent; border: 0; color: #fff;
    font-size: 22px; cursor: pointer; padding: 4px 6px; line-height: 1;
    border-radius: 6px;
}
#nac-wab .nac-head .nac-close:hover { background: rgba(255,255,255,0.15); }

/* ---- Messages area ---- */
#nac-wab .nac-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 12px;
    background-color: #ECE5DD;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='4' cy='4' r='1' fill='%23d9d0c7'/%3E%3C/svg%3E");
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

/* ---- Bubbles ---- */
#nac-wab .nac-msg {
    max-width: 82%;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    animation: nac-in 0.18s ease;
}
@keyframes nac-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#nac-wab .nac-bot  { align-self: flex-start; background: #fff; color: #1f2937; border-top-left-radius: 3px; }
#nac-wab .nac-user { align-self: flex-end; background: #DCF8C6; color: #1f2937; border-top-right-radius: 3px; }
#nac-wab[dir="rtl"] .nac-bot  { border-top-left-radius: 10px; border-top-right-radius: 3px; }
#nac-wab[dir="rtl"] .nac-user { border-top-right-radius: 10px; border-top-left-radius: 3px; }

/* ---- Typing indicator ---- */
#nac-wab .nac-typing { align-self: flex-start; background: #fff; padding: 10px 12px; border-radius: 10px; display: inline-flex; gap: 4px; }
#nac-wab .nac-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa0a6; animation: nac-blink 1.2s infinite; }
#nac-wab .nac-typing span:nth-child(2) { animation-delay: 0.2s; }
#nac-wab .nac-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nac-blink { 0%,60%,100% { opacity: 0.3; } 30% { opacity: 1; } }

/* ---- Quick-reply chips ---- */
#nac-wab .nac-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 12px 6px; background: #ECE5DD; }
#nac-wab .nac-chip {
    background: #fff; color: #075E54; border: 1px solid #cfe9e2;
    border-radius: 16px; padding: 7px 13px; font-size: 12.5px; cursor: pointer;
    font-family: inherit; transition: background 0.15s, transform 0.1s;
}
#nac-wab .nac-chip:hover { background: #d7f0ea; }
#nac-wab .nac-chip:active { transform: scale(0.96); }

/* ---- Input row ---- */
#nac-wab .nac-foot { display: flex; align-items: center; gap: 8px; padding: 9px 10px; background: #F0F0F0; }
#nac-wab .nac-input {
    flex: 1; border: 0; outline: none; border-radius: 20px;
    padding: 9px 14px; font-size: 13.5px; font-family: inherit;
    background: #fff; color: #1f2937;
}
#nac-wab .nac-send {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: #128C7E; color: #fff; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
#nac-wab .nac-send:hover { background: #075E54; }
#nac-wab .nac-send:disabled { background: #9db8b2; cursor: default; }

/* honeypot — hidden from humans, bait for bots */
#nac-wab .nac-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---- Mobile: full screen ---- */
@media (max-width: 480px) {
    #nac-wab {
        bottom: 0; right: 0; left: 0;
        width: 100vw; max-width: 100vw;
        height: 100vh; max-height: 100vh;
        border-radius: 0;
    }
    #nac-wab[dir="rtl"] { left: 0; }
}

/* red dot on the float button when bot has an unseen greeting */
.wa-float .nac-badge {
    position: absolute; top: -2px; right: -2px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #ff3b30; color: #fff; font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}
