/*
 * Whats Chat Plugin
 * Golden Apple Multimedia — gambvi.com
 * Version: 1.0.1
 */

/* =========================================================
   1. FLOATING TRIGGER BUTTON
   ========================================================= */

.whats-chat-trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #25d366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whats-chat-trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.34);
}

.whats-chat-trigger:focus-visible {
    outline: 3px solid #075e54;
    outline-offset: 3px;
}

/* Pulse animation to attract attention on first load */
@keyframes whatsChatPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70%  { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

.whats-chat-trigger {
    animation: whatsChatPulse 2.2s ease-out 1.5s 3;
}

/* =========================================================
   2. OVERLAY BACKDROP
   ========================================================= */

.whats-chat-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.48);
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 24px 90px;
    box-sizing: border-box;
}

.whats-chat-overlay.is-open {
    display: flex;
}

/* =========================================================
   3. MODAL CARD
   ========================================================= */

.whats-chat-modal {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    animation: whatsChatSlideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* =========================================================
   4. MODAL HEADER
   ========================================================= */

.whats-chat-modal-header {
    background: #25d366;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.whats-chat-header-icon {
    flex-shrink: 0;
    line-height: 0;
}

.whats-chat-modal-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    flex: 1;
    font-family: inherit;
    line-height: 1.3;
}

.whats-chat-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0.85;
    transition: opacity 0.15s ease;
}

.whats-chat-close-btn:hover {
    opacity: 1;
}

.whats-chat-close-btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    opacity: 1;
}

/* =========================================================
   5. MODAL BODY
   ========================================================= */

.whats-chat-modal-body {
    padding: 18px 16px 8px;
}

.whats-chat-greeting {
    font-size: 14px;
    color: #333333;
    margin: 0 0 12px;
    line-height: 1.5;
}

.whats-chat-textarea {
    width: 100%;
    border: 1.5px solid #dddddd;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    color: #222222;
    background: #fafafa;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1.5;
}

.whats-chat-textarea::placeholder {
    color: #aaaaaa;
}

.whats-chat-textarea:focus {
    outline: none;
    border-color: #25d366;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}

.whats-chat-char-count {
    font-size: 12px;
    color: #aaaaaa;
    text-align: right;
    margin: 6px 0 0;
}

/* =========================================================
   6. MODAL FOOTER
   ========================================================= */

.whats-chat-modal-footer {
    padding: 10px 16px 18px;
}

.whats-chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #25d366;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    font-family: inherit;
    line-height: 1;
}

.whats-chat-send-btn:hover {
    background: #1ebe5d;
}

.whats-chat-send-btn:focus-visible {
    outline: 3px solid #075e54;
    outline-offset: 2px;
}

.whats-chat-send-btn:disabled {
    background: #a8e6c0;
    cursor: not-allowed;
}

/* Override SVG fill inside the send button to white */
.whats-chat-send-btn svg {
    flex-shrink: 0;
    fill: #ffffff;
}

.whats-chat-disclaimer {
    font-size: 11px;
    color: #aaaaaa;
    text-align: center;
    margin: 10px 0 0;
    line-height: 1.4;
}

/* =========================================================
   7. RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 480px) {
    .whats-chat-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
    }

    .whats-chat-modal {
        border-radius: 16px 16px 0 0;
        max-width: 100%;
    }

    .whats-chat-trigger {
        bottom: 16px;
        right: 16px;
        width: 54px;
        height: 54px;
    }
}

/* =========================================================
   8. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .whats-chat-trigger {
        animation: none;
        transition: none;
    }

    .whats-chat-modal {
        animation: none;
    }
}
