/* =============================================
   CHATBOT.CSS — WhatsApp Chat Widget
   Adzoyi Gold & Trading Enterprise
   ============================================= */

/* ── CSS VARIABLES ── */
:root {
    --wa-green: #25D366;
    --wa-dark: #128C7E;
    --wa-light: #DCF8C6;
    --chat-bg: #0b0f19;
    --chat-header: #111827;
    --chat-input: #1a2236;
    --chat-bubble-bot: #1e293b;
    --chat-bubble-user: rgba(212, 175, 55, .15);
    --chat-text: #e2e8f0;
    --chat-muted: #94a3b8;
    --chat-radius: 16px;
    --chat-gold: #D4AF37;
}

/* ── FLOATING BUTTON ── */
.wa-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wa-green);
    border: none;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, .4);
    transition: all .3s ease;
    animation: wa-pulse 2s infinite;
}

.wa-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(37, 211, 102, .55);
}

.wa-fab svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.wa-fab.active svg.wa-icon-chat {
    display: none;
}

.wa-fab svg.wa-icon-close {
    display: none;
}

.wa-fab.active svg.wa-icon-close {
    display: block;
}

/* Pulse animation */
@keyframes wa-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, .4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, .6), 0 0 0 12px rgba(37, 211, 102, .08);
    }

    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, .4);
    }
}

/* Notification badge */
.wa-fab-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    border-radius: 50%;
    font-size: .65rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--chat-bg);
    animation: wa-badge-pop .3s ease;
}

@keyframes wa-badge-pop {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ── CHAT WINDOW ── */
.wa-chat {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    width: 370px;
    max-height: 520px;
    border-radius: var(--chat-radius);
    background: var(--chat-bg);
    border: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(.95);
    pointer-events: none;
    transition: all .3s cubic-bezier(.4, 0, .2, 1);
}

.wa-chat.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* ── HEADER ── */
.wa-header {
    background: var(--chat-header);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.wa-header-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--chat-gold);
}

.wa-header-info {
    flex: 1;
}

.wa-header-name {
    font-weight: 600;
    font-size: .95rem;
    color: white;
}

.wa-header-status {
    font-size: .75rem;
    color: var(--wa-green);
    display: flex;
    align-items: center;
    gap: 4px;
}

.wa-header-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--wa-green);
    border-radius: 50%;
    display: inline-block;
}

.wa-header-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    border: none;
    color: var(--chat-muted);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.wa-header-close:hover {
    background: rgba(255, 255, 255, .12);
    color: white;
}

/* ── MESSAGES AREA ── */
.wa-messages {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 200px;
    max-height: 280px;
    background:
        radial-gradient(circle at 20% 80%, rgba(212, 175, 55, .03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(37, 211, 102, .03) 0%, transparent 50%),
        var(--chat-bg);
}

/* Scrollbar */
.wa-messages::-webkit-scrollbar {
    width: 4px;
}

.wa-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .1);
    border-radius: 4px;
}

/* ── MESSAGE BUBBLES ── */
.wa-msg {
    max-width: 85%;
    padding: .75rem 1rem;
    border-radius: 12px;
    font-size: .88rem;
    line-height: 1.5;
    animation: wa-msg-in .3s ease;
}

@keyframes wa-msg-in {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.wa-msg.bot {
    background: var(--chat-bubble-bot);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.wa-msg.bot .wa-msg-name {
    font-size: .72rem;
    color: var(--chat-gold);
    font-weight: 600;
    margin-bottom: .25rem;
}

.wa-msg-time {
    font-size: .65rem;
    color: var(--chat-muted);
    margin-top: .35rem;
    text-align: right;
}

/* ── QUICK ACTIONS ── */
.wa-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: 0 1.25rem .75rem;
}

.wa-quick-btn {
    padding: .45rem .85rem;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, .25);
    background: rgba(212, 175, 55, .06);
    color: var(--chat-gold);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}

.wa-quick-btn:hover {
    background: rgba(212, 175, 55, .15);
    border-color: var(--chat-gold);
}

/* ── INPUT AREA ── */
.wa-input-area {
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, .06);
    display: flex;
    gap: .5rem;
    align-items: center;
    background: var(--chat-input);
}

.wa-input {
    flex: 1;
    padding: .65rem 1rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    color: white;
    font-size: .88rem;
    outline: none;
    transition: border .2s;
}

.wa-input::placeholder {
    color: var(--chat-muted);
}

.wa-input:focus {
    border-color: var(--wa-green);
}

.wa-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--wa-green);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.wa-send-btn:hover {
    background: var(--wa-dark);
    transform: scale(1.05);
}

.wa-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ── POWERED BY ── */
.wa-powered {
    text-align: center;
    padding: .4rem;
    font-size: .65rem;
    color: var(--chat-muted);
    background: var(--chat-header);
    border-top: 1px solid rgba(255, 255, 255, .04);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .wa-chat {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: var(--chat-radius) var(--chat-radius) 0 0;
    }

    .wa-messages {
        max-height: calc(100vh - 220px);
        max-height: calc(100dvh - 220px);
    }

    .wa-fab {
        bottom: 1rem;
        right: 1rem;
    }
}