/* ===== WhatsApp Chatbot Module ===== */
.civet-chatbot {
    --cb-primary: #25D366;
    --cb-primary-dark: #128C7E;
    --cb-header: #075E54;
    --cb-bg: #ECE5DD;
    --cb-bubble-bot: #ffffff;
    --cb-bubble-user: #DCF8C6;
    --cb-text: #1f2937;
    --cb-muted: #6b7280;
    position: fixed;
    right: 24px;
    bottom: 50px;
    z-index: 1080;
    font-family: 'Inter', sans-serif;
}

.civet-chatbot__launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--cb-primary);
    color: #fff;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease, background 0.25s ease;
}

.civet-chatbot__launcher:hover {
    background: var(--cb-primary-dark);
    transform: scale(1.06);
}

.civet-chatbot__launcher-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--cb-primary);
    animation: civetChatbotPulse 1.8s ease-out infinite;
    pointer-events: none;
}

@keyframes civetChatbotPulse {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.7); opacity: 0; }
}

.civet-chatbot.is-open .civet-chatbot__launcher {
    transform: scale(0.85);
    opacity: 0;
    pointer-events: none;
}

.civet-chatbot__window {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.civet-chatbot.is-open .civet-chatbot__window {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.civet-chatbot__header {
    background: var(--cb-header);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.civet-chatbot__header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.civet-chatbot__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
}

.civet-chatbot__title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
}

.civet-chatbot__status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.civet-chatbot__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}

.civet-chatbot__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.civet-chatbot__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.12);
}

.civet-chatbot__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--cb-bg);
    background-image:
        radial-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.civet-chatbot__body::-webkit-scrollbar {
    width: 6px;
}

.civet-chatbot__body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 3px;
}

.civet-chatbot__msg {
    max-width: 82%;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--cb-text);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
    word-wrap: break-word;
    animation: civetChatbotFadeIn 0.25s ease;
}

@keyframes civetChatbotFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.civet-chatbot__msg--bot {
    background: var(--cb-bubble-bot);
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.civet-chatbot__msg--user {
    background: var(--cb-bubble-user);
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.civet-chatbot__msg-time {
    display: block;
    font-size: 10px;
    color: var(--cb-muted);
    margin-top: 4px;
    text-align: right;
}

.civet-chatbot__typing {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    padding: 10px 12px;
    background: var(--cb-bubble-bot);
    border-radius: 10px;
    border-top-left-radius: 2px;
    align-self: flex-start;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}

.civet-chatbot__typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: civetChatbotBounce 1.2s infinite ease-in-out;
}

.civet-chatbot__typing span:nth-child(2) { animation-delay: 0.15s; }
.civet-chatbot__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes civetChatbotBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-5px); opacity: 1; }
}

.civet-chatbot__options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-start;
    max-width: 92%;
    animation: civetChatbotFadeIn 0.25s ease;
}

.civet-chatbot__option {
    background: #fff;
    border: 1px solid var(--cb-primary);
    color: var(--cb-primary-dark);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.civet-chatbot__option:hover {
    background: var(--cb-primary);
    color: #fff;
}

.civet-chatbot__footer {
    background: #f0f2f5;
    border-top: 1px solid #e5e7eb;
    padding: 10px 12px;
}

.civet-chatbot__input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 24px;
    padding: 4px 4px 4px 14px;
    margin-bottom: 6px;
}

.civet-chatbot__input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--cb-text);
    padding: 8px 0;
}

.civet-chatbot__send {
    border: none;
    background: var(--cb-primary);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.civet-chatbot__send:hover {
    background: var(--cb-primary-dark);
}

.civet-chatbot__brand {
    text-align: center;
    font-size: 11px;
    color: var(--cb-muted);
}

.civet-chatbot__brand strong {
    color: var(--cb-primary-dark);
}

@media (max-width: 575.98px) {
    .civet-chatbot {
        right: 16px;
        bottom: 16px;
    }

    .civet-chatbot__window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 72px;
    }

    .civet-chatbot__launcher {
        width: 54px;
        height: 54px;
        font-size: 24px;
    }
}
