/* ================================================
   ChatPilot - Frontend Widget Styles
   v2.2.5 — Light theme, mobile-friendly popup
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --chatpilot-primary:        #6C63FF;
    --chatpilot-primary-dark:   #5A52D5;
    --chatpilot-primary-light:  #8B85FF;

    /* Light theme */
    --chatpilot-bg-window:      #ffffff;
    --chatpilot-bg-chat:        #f5f5f7;
    --chatpilot-bg-msg-bot:     #ffffff;
    --chatpilot-bg-msg-user:    var(--chatpilot-primary);
    --chatpilot-text:           #1a1a2e;
    --chatpilot-text-muted:     #6b6b80;
    --chatpilot-border:         #e2e2ec;
    --chatpilot-shadow:         0 12px 40px rgba(0,0,0,0.15);
    --chatpilot-radius:         20px;
    --chatpilot-radius-sm:      12px;
    --chatpilot-transition:     0.25s cubic-bezier(0.4,0,0.2,1);
    --chatpilot-font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Toggle Button ── */
#chatpilot-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatpilot-primary), var(--chatpilot-primary-dark));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 20px rgba(108,99,255,0.4), 0 0 0 0 rgba(108,99,255,0.3);
    transition: var(--chatpilot-transition);
    z-index: 99998;
    animation: chatpilot-launcher-glow 2.4s ease-in-out infinite;
}
#chatpilot-toggle:hover  { transform: scale(1.1); box-shadow: 0 6px 30px rgba(108,99,255,0.5); }
#chatpilot-toggle:active { transform: scale(0.95); }

@keyframes chatpilot-pulse {
    0%,100% { box-shadow: 0 4px 20px rgba(108,99,255,0.4), 0 0 0 0  rgba(108,99,255,0.3); }
    50%      { box-shadow: 0 4px 20px rgba(108,99,255,0.4), 0 0 0 12px rgba(108,99,255,0); }
}

.chatpilot-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--chatpilot-transition);
}

/* Badge */
.chatpilot-badge {
    position: absolute;
    top: -4px; right: -4px;
    width: 22px; height: 22px;
    background: #FF4757;
    color: #fff;
    font-size: 11px; font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
    animation: chatpilot-badge-bounce 0.5s ease;
}
@keyframes chatpilot-badge-bounce {
    0%,100% { transform: scale(1); }
    50%      { transform: scale(1.3); }
}

/* ── Position variants ── */
#chatpilot-container.chatpilot-position-bottom-left #chatpilot-toggle { left: 24px; right: auto; }
#chatpilot-container.chatpilot-position-bottom-left .chatpilot-window  { left: 24px; right: auto; }

/* ── Chat Window (desktop) ── */
.chatpilot-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 560px;
    max-height: calc(100vh - 140px);
    background: var(--chatpilot-bg-window);
    border-radius: var(--chatpilot-radius);
    box-shadow: var(--chatpilot-shadow);
    border: 1px solid var(--chatpilot-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99999;
    font-family: var(--chatpilot-font);
    animation: chatpilot-window-open 0.3s ease;
}

@keyframes chatpilot-window-open {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}
.chatpilot-window-closing {
    animation: chatpilot-window-close 0.22s ease forwards;
}
@keyframes chatpilot-window-close {
    to { opacity: 0; transform: translateY(16px) scale(0.97); }
}

/* Swipe-to-close drag feedback */
.chatpilot-window.chatpilot-dragging {
    transition: none !important;
    animation: none !important;
}

/* ── Header ── */
.chatpilot-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--chatpilot-primary), var(--chatpilot-primary-dark));
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}
.chatpilot-header-info { display: flex; align-items: center; gap: 10px; }

.chatpilot-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.chatpilot-avatar img         { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.chatpilot-avatar-default     { font-size: 20px; }

.chatpilot-status-dot {
    position: absolute; bottom: 1px; right: 1px;
    width: 10px; height: 10px;
    background: #2ED573; border-radius: 50%;
    border: 2px solid var(--chatpilot-primary);
    animation: chatpilot-dot-pulse 2s infinite;
}
@keyframes chatpilot-dot-pulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.chatpilot-header-text h4 {
    margin: 0;
    font-size: 14px; font-weight: 600; letter-spacing: 0.01em;
}
.chatpilot-status { font-size: 11px; opacity: 0.85; }

/* Header action buttons */
.chatpilot-header-actions { display: flex; gap: 4px; }

.chatpilot-header-actions button {
    background: rgba(255,255,255,0.92);
    border: none;
    color: #1a1a2e !important;
    width: 30px; height: 30px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: var(--chatpilot-transition);
}
.chatpilot-header-actions button:hover  { background: #fff; transform: scale(1.08); }
.chatpilot-header-actions button:active { transform: scale(0.93); }

/* Close (X) — red hover */
#chatpilot-close {
    background: rgba(255,255,255,0.92);
    font-weight: 800;
}
#chatpilot-close:hover { background: #ff4757; color: #fff !important; }

/* ── Messages Area ── */
.chatpilot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--chatpilot-bg-chat);
    scroll-behavior: smooth;
}
.chatpilot-messages::-webkit-scrollbar       { width: 4px; }
.chatpilot-messages::-webkit-scrollbar-track { background: transparent; }
.chatpilot-messages::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 10px; }

/* Message Bubbles */
.chatpilot-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: var(--chatpilot-radius-sm);
    font-size: 14px;
    line-height: 1.55;
    color: var(--chatpilot-text);
    word-wrap: break-word;
    animation: chatpilot-msg-in 0.25s ease;
    position: relative;
}
@keyframes chatpilot-msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);   }
}

.chatpilot-msg-bot {
    align-self: flex-start;
    background: var(--chatpilot-bg-msg-bot);
    border: 1px solid var(--chatpilot-border);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    color: #1a1a2e;
}
.chatpilot-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--chatpilot-primary), var(--chatpilot-primary-dark));
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Bot markdown */
.chatpilot-msg-bot p             { margin: 0 0 6px; color: #1a1a2e; }
.chatpilot-msg-bot p:last-child  { margin-bottom: 0; }
.chatpilot-msg-bot ul,.chatpilot-msg-bot ol { margin: 4px 0; padding-left: 16px; }
.chatpilot-msg-bot li            { margin-bottom: 3px; color: #1a1a2e; }
.chatpilot-msg-bot a             { color: var(--chatpilot-primary); text-decoration: underline; }
.chatpilot-msg-bot a:hover       { color: var(--chatpilot-primary-dark); }
.chatpilot-msg-bot strong        { color: #1a1a2e; font-weight: 600; }
.chatpilot-msg-bot code {
    background: #f0f0f8;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--chatpilot-primary-dark);
}

/* Timestamp */
.chatpilot-msg-time {
    font-size: 10px;
    color: var(--chatpilot-text-muted);
    margin-top: 4px;
    display: block;
    opacity: 0.65;
}
.chatpilot-msg-user .chatpilot-msg-time { color: rgba(255,255,255,0.65); text-align: right; }

/* Typing Indicator */
.chatpilot-typing {
    display: flex; align-items: center; gap: 5px;
    padding: 12px 16px;
    background: var(--chatpilot-bg-msg-bot);
    border: 1px solid var(--chatpilot-border);
    border-radius: var(--chatpilot-radius-sm);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    max-width: 70px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.chatpilot-typing-dot {
    width: 7px; height: 7px;
    background: #aaaacc;
    border-radius: 50%;
    animation: chatpilot-typing-bounce 1.4s infinite ease-in-out;
}
.chatpilot-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chatpilot-typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatpilot-typing-bounce {
    0%,60%,100% { transform: translateY(0);  opacity: 0.4; }
    30%          { transform: translateY(-7px); opacity: 1;   }
}

/* ── Input Area ── */
.chatpilot-input-area {
    padding: 10px 14px 12px;
    background: var(--chatpilot-bg-window);
    border-top: 1px solid var(--chatpilot-border);
    flex-shrink: 0;
}
.chatpilot-input-wrapper {
    display: flex; align-items: flex-end; gap: 8px;
    background: #f5f5f7;
    border: 1.5px solid var(--chatpilot-border);
    border-radius: 14px;
    padding: 6px 8px 6px 14px;
    transition: var(--chatpilot-transition);
}
.chatpilot-input-wrapper:focus-within {
    border-color: var(--chatpilot-primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
    background: #fff;
}
#chatpilot-input {
    flex: 1;
    border: none; outline: none;
    background: transparent;
    color: #1a1a2e;
    font-size: 14px;
    font-family: var(--chatpilot-font);
    resize: none;
    max-height: 100px;
    padding: 5px 0;
    line-height: 1.4;
}
#chatpilot-input::placeholder { color: #aaaacc; }

#chatpilot-send {
    width: 36px; height: 36px;
    border-radius: 10px; border: none;
    background: var(--chatpilot-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: var(--chatpilot-transition);
    flex-shrink: 0;
}
#chatpilot-send:hover:not(:disabled) { background: var(--chatpilot-primary-dark); transform: scale(1.05); }
#chatpilot-send:disabled             { opacity: 0.35; cursor: not-allowed; }

/* ── Error Message ── */
.chatpilot-msg-error {
    background: #fff0f0;
    border: 1px solid #ffc0c0;
    color: #cc3333;
    font-size: 13px;
    align-self: center;
    text-align: center;
    max-width: 90%;
    border-radius: var(--chatpilot-radius-sm);
    padding: 10px 14px;
}

/* ── Swipe hint (mobile only) ── */
.chatpilot-swipe-hint {
    display: none;
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    padding-bottom: 2px;
    letter-spacing: 0.03em;
}

/* ═══════════════════════════════
   MOBILE  ≤ 600px
   Popup style: tidak fullscreen,
   muncul dari bawah dengan margin
   ═══════════════════════════════ */
@media (max-width: 600px) {
    /* ── Mobile: widget memenuhi seluruh layar (fullscreen) ── */
    .chatpilot-window {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        /* Fallback for browsers without dvh */
        height: 100vh;
        max-height: 100vh;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        border-radius: 0;
        border: none;
        box-shadow: none;
        touch-action: pan-y;
        transition: none;
        /* When keyboard opens, the visible viewport shrinks; this var
           (set by JS) keeps the input above the keyboard. */
        padding-bottom: var(--chatpilot-kb-offset, 0px);
        box-sizing: border-box;
    }

    /* dvh-aware height for modern browsers (overrides the vh fallback). */
    @supports (height: 100dvh) {
        .chatpilot-window {
            height: 100dvh;
            max-height: 100dvh;
        }
    }

    /* Keyboard open: no special shrink needed — padding-bottom already
       reserves the keyboard space. Class kept for JS compatibility. */
    .chatpilot-window.chatpilot-keyboard-open {
        padding-bottom: var(--chatpilot-kb-offset, 0px);
    }

    /* The floating launcher (green circle) is hidden once the fullscreen
       window is open — the header X is the only exit on mobile. */
    #chatpilot-container:not(.chatpilot-hidden) #chatpilot-toggle {
        display: none !important;
    }

    /* Launcher styling while the widget is closed. */
    #chatpilot-toggle {
        bottom: 16px;
        right: 16px;
        width: 52px;
        height: 52px;
    }

    .chatpilot-header {
        padding: 14px 14px;
        border-radius: 0;
        cursor: grab;
        position: relative;
        /* Clear the iPhone notch/status bar. */
        padding-top: max(14px, env(safe-area-inset-top));
    }

    /* Drag handle indicator (swipe-down-to-close still works). */
    .chatpilot-header::before {
        content: '';
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px; height: 4px;
        background: rgba(255,255,255,0.4);
        border-radius: 2px;
    }

    .chatpilot-swipe-hint { display: block; }

    /* Exit (X) button — top-right of the header, clearly tappable. */
    #chatpilot-close {
        width: 36px; height: 36px;
        background: rgba(255,255,255,0.3);
        border-radius: 50%;
        font-size: 17px;
    }
    #chatpilot-close:hover,
    #chatpilot-close:active { background: rgba(220,50,50,0.8); }

    .chatpilot-msg { font-size: 15px; }

    #chatpilot-input { font-size: 16px; /* Cegah zoom di iOS */ }

    /* Safe area for iPhone notch / home bar. */
    .chatpilot-input-area {
        padding: 10px 12px 16px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
}

/* ── Transition for open/close ── */
.chatpilot-hidden .chatpilot-window { display: none !important; }

/* ════════════════════════════════════════════════
   Onboarding Gate & Language Picker  (light theme)
   ════════════════════════════════════════════════ */
/* Onboarding container — no overflow here, children control scroll */
.chatpilot-onboarding {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
    overflow: hidden;   /* children manage their own scroll */
    min-height: 0;
}

/* Scrollable content — name, email, language flags */
.chatpilot-onboarding-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 18px 10px;
    min-height: 0;
}
.chatpilot-onboarding-scroll::-webkit-scrollbar       { width: 4px; }
.chatpilot-onboarding-scroll::-webkit-scrollbar-track { background: transparent; }
.chatpilot-onboarding-scroll::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 10px; }

/* Sticky footer — always pinned at the bottom */
.chatpilot-onboarding-footer {
    padding: 10px 18px 18px;
    background: #fff;
    border-top: 1px solid #f0f0f8;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.chatpilot-onboarding h3 {
    margin: 0 0 4px;
    font-size: 17px; font-weight: 700;
    color: #1a1a2e;
}
.chatpilot-onboarding-sub {
    margin: 0 0 14px;
    font-size: 13px;
    color: #6b6b80;
    line-height: 1.5;
}
.chatpilot-onboarding-label {
    display: block;
    margin: 10px 0 5px;
    font-size: 12px; font-weight: 600;
    color: #3a3a4e;
}
.chatpilot-onboarding-input {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #e2e2ec;
    border-radius: 10px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.18s ease;
}
.chatpilot-onboarding-input:focus {
    outline: none;
    border-color: var(--chatpilot-primary);
    box-shadow: 0 0 0 3px rgba(108,99,255,0.1);
}

/* Language flags grid */
.chatpilot-onboarding-langs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-top: 6px;
}
.chatpilot-lang-flag {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    background: #f4f4f8;
    border: 1.5px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.chatpilot-lang-flag:hover        { background: #ececf4; }
.chatpilot-lang-flag:active       { transform: scale(0.95); }
.chatpilot-lang-flag-active {
    border-color: var(--chatpilot-primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(108,99,255,0.12);
}
.chatpilot-lang-flag-emoji { font-size: 20px; line-height: 1; }
.chatpilot-lang-flag-name  {
    font-size: 9px; font-weight: 600;
    color: #5a5a70;
    text-align: center; line-height: 1.2;
}

.chatpilot-onboarding-error {
    margin-top: 10px;
    padding: 9px 12px;
    background: #fff0f0;
    border: 1px solid #ffc0c0;
    border-radius: 8px;
    font-size: 12.5px;
    color: #c0392b;
}
.chatpilot-onboarding-submit {
    margin-top: 0;
    padding: 13px;
    background: var(--chatpilot-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, opacity 0.18s;
    width: 100%;
}
.chatpilot-onboarding-submit:hover    { background: var(--chatpilot-primary-dark); }
.chatpilot-onboarding-submit:disabled { opacity: 0.55; cursor: not-allowed; }

/* Chat area */
.chatpilot-chatarea {
    display: flex; flex-direction: column;
    flex: 1; min-height: 0;
    background: var(--chatpilot-bg-chat);
}

@media (max-width: 600px) {
    .chatpilot-onboarding-langs { grid-template-columns: repeat(4,1fr); gap: 6px; }
    .chatpilot-lang-flag-name   { font-size: 8.5px; }
    .chatpilot-onboarding-input { font-size: 16px; /* Cegah zoom iOS */ }
}

/* ================================================
   v2.4.0 — Satisfaction Rating
   ================================================ */

.chatpilot-rating-box {
    background: #f4f4f8;
    border: 1px solid #e2e2ec;
    border-radius: 12px;
    padding: 16px 14px;
    margin: 10px 0;
    text-align: center;
}

.chatpilot-rating-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
}

.chatpilot-rating-emojis {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.chatpilot-rating-emoji {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1.5px solid #e2e2ec;
    border-radius: 10px;
    padding: 9px 12px;
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.1s ease;
    flex: 1;
}

.chatpilot-rating-emoji:hover {
    border-color: var(--chatpilot-primary, #6C63FF);
}

.chatpilot-rating-emoji:active {
    transform: scale(0.96);
}

.chatpilot-rating-emoji-active {
    border-color: var(--chatpilot-primary, #6C63FF);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.12);
}

.chatpilot-rating-emoji-char {
    font-size: 26px;
    line-height: 1;
}

.chatpilot-rating-emoji-label {
    font-size: 10.5px;
    font-weight: 600;
    color: #5a5a70;
}

.chatpilot-rating-comment {
    width: 100%;
    margin-top: 12px;
    padding: 9px 11px;
    border: 1.5px solid #e2e2ec;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.chatpilot-rating-comment:focus {
    outline: none;
    border-color: var(--chatpilot-primary, #6C63FF);
}

.chatpilot-rating-submit {
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--chatpilot-primary, #6C63FF);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, opacity 0.18s ease;
}

.chatpilot-rating-submit:hover {
    background: var(--chatpilot-primary-dark, #5a52e0);
}

.chatpilot-rating-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chatpilot-rating-thanks {
    font-size: 13px;
    font-weight: 600;
    color: #1a7f37;
    padding: 6px 0;
}

.chatpilot-closing-note {
    text-align: center;
    font-size: 11.5px;
    color: #8a8a9a;
    font-style: italic;
    margin: 10px 0 6px;
    padding: 0 12px;
}

/* ── Start New Chat button (shown after conversation ends) ── */
.chatpilot-new-chat-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 0 14px 14px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--chatpilot-primary), var(--chatpilot-primary-dark));
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: var(--chatpilot-font);
    cursor: pointer;
    text-align: center;
    transition: opacity 0.18s ease, transform 0.12s ease;
    animation: chatpilot-msg-in 0.3s ease;
}
.chatpilot-new-chat-btn:hover  { opacity: 0.88; transform: translateY(-1px); }
.chatpilot-new-chat-btn:active { transform: scale(0.97); }

/* ── v2.10.5 — Contact action card (Email + WhatsApp) ── */
.chatpilot-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 12px;
    padding: 0;
}
.chatpilot-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
}
.chatpilot-contact-btn:active { transform: scale(0.98); }
.chatpilot-contact-btn-email {
    background: #f2f3f5;
    color: #1a1a2e;
    border: 1px solid #e2e2ec;
}
.chatpilot-contact-btn-email:hover { background: #e8e9ed; }
.chatpilot-contact-btn-wa {
    background: #25D366;
    color: #fff;
}
.chatpilot-contact-btn-wa:hover { opacity: 0.92; }
.chatpilot-contact-btn-msgr {
    background: #0084FF;
    color: #fff;
}
.chatpilot-contact-btn-msgr:hover { opacity: 0.92; }

/* ── WhatsApp composer modal ── */
#chatpilot-wa-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.chatpilot-wa-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    animation: chatpilot-wa-pop 0.16s ease-out;
}
@keyframes chatpilot-wa-pop {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.chatpilot-wa-modal-head {
    background: #25D366;
    color: #fff;
    padding: 13px 16px;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatpilot-wa-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}
.chatpilot-wa-modal-body {
    padding: 16px;
}
.chatpilot-wa-notice {
    background: #fff8db;
    border: 1px solid #f2e3a3;
    color: #6a5400;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 12px;
}
.chatpilot-wa-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}
#chatpilot-wa-text {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1.5px solid #e2e2ec;
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
}
#chatpilot-wa-text:focus {
    outline: none;
    border-color: #25D366;
}
.chatpilot-wa-send {
    width: 100%;
    background: #25D366;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.chatpilot-wa-send:disabled {
    background: #b9e0c4;
    cursor: not-allowed;
}
.chatpilot-wa-send:not(:disabled):hover { opacity: 0.92; }

/* Shortcode / custom chat-open button (overridable) */
.chatpilot-chat-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(46,125,50,.35);
    transition: transform .18s ease, box-shadow .18s ease;
    font-family: inherit;
    line-height: 1.2;
}
.chatpilot-chat-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,125,50,.45); }
.chatpilot-chat-trigger:active { transform: translateY(0); }

/* === Eye-catching launcher: breathing glow + beacon ring + icon wiggle === */
#chatpilot-toggle { overflow: visible; }
#chatpilot-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--chatpilot-primary);
    z-index: -1;
    pointer-events: none;
    animation: chatpilot-launcher-ring 2.4s ease-out infinite;
}
.chatpilot-toggle-icon {
    animation: chatpilot-launcher-wiggle 5.5s ease-in-out infinite;
}
@keyframes chatpilot-launcher-glow {
    0%,100% { box-shadow: 0 4px 20px rgba(108,99,255,0.45), 0 0 0 0 rgba(108,99,255,0); }
    50%     { box-shadow: 0 6px 28px rgba(108,99,255,0.75), 0 0 22px 6px rgba(108,99,255,0.45); }
}
@keyframes chatpilot-launcher-ring {
    0%   { transform: scale(1);   opacity: 0.55; }
    80%  { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}
@keyframes chatpilot-launcher-wiggle {
    0%, 82%, 100% { transform: rotate(0deg)   scale(1); }
    85%           { transform: rotate(-12deg) scale(1.08); }
    89%           { transform: rotate(10deg)  scale(1.08); }
    92%           { transform: rotate(-7deg)  scale(1.05); }
    95%           { transform: rotate(5deg)   scale(1.03); }
    98%           { transform: rotate(0deg)   scale(1); }
}
/* Calm down once the chat window is open */
#chatpilot-container:not(.chatpilot-hidden) #chatpilot-toggle::after { display: none; }
#chatpilot-container:not(.chatpilot-hidden) .chatpilot-toggle-icon { animation: none; }
@media (prefers-reduced-motion: reduce) {
    #chatpilot-toggle, #chatpilot-toggle::after, .chatpilot-toggle-icon { animation: none !important; }
}

/* ── Multi-channel contact launcher (speed-dial) ───────────────────────── */
#chatpilot-container .chatpilot-launcher{
	position:absolute; right:4px; bottom:78px;
	display:flex; flex-direction:column; align-items:flex-end; gap:12px;
	opacity:0; transform:translateY(12px); pointer-events:none;
	transition:opacity .22s ease, transform .22s ease;
}
#chatpilot-container.chatpilot-launcher-open .chatpilot-launcher{
	opacity:1; transform:translateY(0); pointer-events:auto;
}
#chatpilot-container .chatpilot-launch-item{
	display:flex; align-items:center; gap:10px;
	text-decoration:none; background:none; border:0; padding:0; cursor:pointer;
}
#chatpilot-container .chatpilot-launch-label{
	background:#fff; color:#1f2328; font-size:13px; font-weight:600;
	padding:6px 12px; border-radius:16px; white-space:nowrap;
	box-shadow:0 2px 10px rgba(0,0,0,.15);
}
#chatpilot-container .chatpilot-launch-icon{
	width:46px; height:46px; border-radius:50%;
	display:flex; align-items:center; justify-content:center;
	color:#fff; box-shadow:0 3px 12px rgba(0,0,0,.22);
	transition:transform .15s ease;
}
#chatpilot-container .chatpilot-launch-item:hover .chatpilot-launch-icon{ transform:scale(1.08); }
#chatpilot-container .chatpilot-launch-icon svg{ width:24px; height:24px; display:block; }
#chatpilot-container .chatpilot-launch-whatsapp  .chatpilot-launch-icon{ background:#25D366; }
#chatpilot-container .chatpilot-launch-telegram  .chatpilot-launch-icon{ background:#229ED9; }
#chatpilot-container .chatpilot-launch-messenger .chatpilot-launch-icon{ background:#0084FF; }
#chatpilot-container .chatpilot-launch-instagram .chatpilot-launch-icon{ background:radial-gradient(circle at 30% 110%,#fdf497 0%,#fd5949 45%,#d6249f 62%,#285AEB 90%); }
#chatpilot-container .chatpilot-launch-line      .chatpilot-launch-icon{ background:#06C755; }
#chatpilot-container .chatpilot-launch-phone     .chatpilot-launch-icon{ background:#2E7D32; }
#chatpilot-container .chatpilot-launch-livechat  .chatpilot-launch-icon{ background:#6C63FF; }
/* Left-positioned widget: fan out on the left. */
#chatpilot-container.chatpilot-position-bottom-left .chatpilot-launcher{ left:4px; right:auto; align-items:flex-start; }
#chatpilot-container.chatpilot-position-bottom-left .chatpilot-launch-item{ flex-direction:row-reverse; }
