/* ===== WhatsApp Chat Widget Styles ===== */

/* ---------- Widget Container ---------- */
#whatsapp-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ---------- Floating Action Button ---------- */
#wa-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow:
        0 4px 16px rgba(37, 211, 102, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s ease,
        background 0.3s ease;
    position: relative;
    z-index: 10;
}

#wa-fab:hover {
    transform: scale(1.1);
    box-shadow:
        0 8px 28px rgba(37, 211, 102, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.12);
}

#wa-fab:active {
    transform: scale(0.95);
}

#wa-fab.wa-fab-active {
    background: #1e1b4b;
    box-shadow:
        0 4px 16px rgba(30, 27, 75, 0.3),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

#wa-fab svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

#wa-fab:hover svg {
    transform: scale(1.05);
}

/* ---------- Pulse Ring ---------- */
#wa-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #25D366;
    animation: waPulse 2.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: none;
}

@keyframes waPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.25);
        opacity: 0;
    }
}

/* ---------- Chat Box ---------- */
#wa-chatbox {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 370px;
    max-width: calc(100vw - 48px);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 8px 24px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

#wa-chatbox.wa-hidden {
    opacity: 0;
    transform: scale(0.8) translateY(16px);
    pointer-events: none;
    visibility: hidden;
}

#wa-chatbox.wa-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
    visibility: visible;
}

/* ---------- Header ---------- */
#wa-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
}

#wa-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#wa-header-text {
    flex: 1;
    min-width: 0;
}

#wa-header-title {
    font-weight: 700;
    font-size: 0.9375rem;
    line-height: 1.3;
    margin: 0;
}

#wa-header-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    margin: 2px 0 0 0;
    line-height: 1.3;
}

#wa-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wa-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* ---------- Body ---------- */
#wa-body {
    padding: 20px;
    min-height: 100px;
    background: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23d5c9b8' fill-opacity='0.15'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40zm0-40h2l-2 2V0zm0 4l4-4h2l-6 6V4zm0 4l8-8h2L40 10V8zm0 4L52 0h2L40 14v-2zm0 4L56 0h2L40 18v-2zm0 4L60 0h2L40 22v-2zm0 4L64 0h2L40 26v-2zm0 4L68 0h2L40 30v-2zm0 4L72 0h2L40 34v-2zm0 4L76 0h2L40 38v-2zm0 4L80 0v2L42 40h-2zm4 0L80 4v2L46 40h-2zm4 0L80 8v2L50 40h-2zm4 0l28-28v2L54 40h-2zm4 0l24-24v2L58 40h-2zm4 0l20-20v2L62 40h-2zm4 0l16-16v2L66 40h-2zm4 0l12-12v2L70 40h-2zm4 0l8-8v2l-6 6h-2zm4 0l4-4v2l-2 2h-2z'/%3E%3C/g%3E%3C/svg%3E");
}

#wa-bubble {
    background: white;
    border-radius: 0 12px 12px 12px;
    padding: 12px 16px;
    max-width: 85%;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    animation: waBubbleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

#wa-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent white transparent transparent;
}

#wa-bubble p {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #1e1b4b;
    margin: 0;
}

#wa-time {
    display: block;
    text-align: right;
    font-size: 0.6875rem;
    color: #94a3b8;
    margin-top: 4px;
}

@keyframes waBubbleIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ---------- Input Area ---------- */
#wa-input-area {
    padding: 12px 16px 10px;
    background: #f0f0f0;
    border-top: 1px solid #e2e8f0;
}

#wa-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

#wa-input {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 24px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    color: #1e1b4b;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

#wa-input:focus {
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.3), 0 1px 3px rgba(0, 0, 0, 0.06);
}

#wa-input::placeholder {
    color: #94a3b8;
}

#wa-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease, background 0.2s ease;
}

#wa-send:hover {
    transform: scale(1.1);
    background: #1EBE5A;
}

#wa-send:active {
    transform: scale(0.95);
}

#wa-powered {
    text-align: center;
    font-size: 0.625rem;
    color: #94a3b8;
    margin: 8px 0 0 0;
    letter-spacing: 0.02em;
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 480px) {
    #whatsapp-widget {
        bottom: 16px;
        right: 16px;
    }

    #wa-fab {
        width: 54px;
        height: 54px;
    }

    #wa-fab svg {
        width: 24px;
        height: 24px;
    }

    #wa-chatbox {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 70px;
    }
}

/* ---------- Entrance Animation ---------- */
#wa-fab {
    animation: waFabEntrance 0.6s cubic-bezier(0.16, 1, 0.3, 1) 1.5s both;
}

@keyframes waFabEntrance {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ---------- Print: hide widget ---------- */
@media print {
    #whatsapp-widget {
        display: none !important;
    }
}