/* Pause-N-Throw Chatbot Widget */

#pnt-chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    overflow: visible;
}


/* Animations */
@keyframes pnt-bounce-in {
    0%   { transform: translateY(-100vh); opacity: 0; }
    8%   { opacity: 1; }
    55%  { transform: translateY(0); }
    68%  { transform: translateY(-32px); }
    78%  { transform: translateY(0); }
    86%  { transform: translateY(-16px); }
    92%  { transform: translateY(0); }
    96%  { transform: translateY(-7px); }
    99%  { transform: translateY(0); }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes pnt-glow-pulse {
    0%   { box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 0 rgba(255,166,0,0.7); }
    60%  { box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 14px rgba(255,166,0,0); }
    100% { box-shadow: 0 4px 16px rgba(0,0,0,0.25), 0 0 0 0 rgba(255,166,0,0); }
}

/* Toggle Button */
#pnt-chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2e7d32;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    margin-left: auto;
    line-height: 1.1;
    animation: pnt-bounce-in 2.4s cubic-bezier(0.25,0.1,0.25,1) 1.0s both,
               pnt-glow-pulse 1.6s ease-out 3s infinite;
}

#pnt-ask-ai {
    font-size: 9px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-top: 2px;
    display: block;
}

#pnt-chat-toggle:hover {
    background: #1b5e20;
    transform: scale(1.05);
}

#pnt-chat-close {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

/* Chat Box */
#pnt-chat-box {
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    max-height: 480px;
}

/* Header */
#pnt-chat-header {
    background: #2e7d32;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#pnt-chat-header strong {
    font-size: 15px;
}

#pnt-chat-header span {
    font-size: 12px;
    opacity: 0.85;
}

/* Messages */
#pnt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 300px;
}

.pnt-message {
    max-width: 85%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
}

.pnt-assistant {
    background: #f1f8e9;
    color: #1b2a1b;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
}

.pnt-user {
    background: #2e7d32;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 3px;
}

.pnt-typing {
    background: #f1f8e9;
    color: #888;
    align-self: flex-start;
    font-style: italic;
    font-size: 13px;
}

/* Input Area */
#pnt-chat-input-area {
    padding: 10px;
    border-top: 1px solid #e8f5e9;
    display: flex;
    gap: 8px;
    align-items: stretch;
}

#pnt-chat-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

#pnt-chat-input {
    flex: 1;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    line-height: 1.4;
}

#pnt-chat-input:focus {
    border-color: #2e7d32;
}

#pnt-chat-send {
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
    width: 100%;
    flex: 1;
}

#pnt-chat-send:hover {
    background: #1b5e20;
}

#pnt-chat-send:disabled {
    background: #a5d6a7;
    cursor: not-allowed;
}

/* Mobile */
@media (max-width: 600px) {

    /* Pin widget to bottom edge with safe area support */
    #pnt-chat-widget {
        bottom: 12px;
        right: 12px;
        left: 12px;
        /* Don't stretch — keep button right-aligned */
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        /* Prevent widget from affecting page layout */
        pointer-events: none;
    }

    #pnt-chat-toggle,
    #pnt-chat-box {
        pointer-events: all;
    }

    /* Full-width chat box that stays within the screen */
    #pnt-chat-box {
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 4px 4px;
        /* Limit height so it doesn't cover the whole screen */
        max-height: 65vh;
        margin-bottom: 10px;
    }

    #pnt-chat-messages {
        min-height: 140px;
        max-height: calc(65vh - 160px);
    }

    /* Fix iOS zoom on input focus — font-size must be >= 16px */
    #pnt-chat-input {
        font-size: 16px;
    }

    #pnt-chat-send {
        font-size: 15px;
        padding: 8px 12px;
    }

    .pnt-message {
        font-size: 14px;
    }
}

/* Buy Now button inside chat */
.pnt-buy-btn {
    display: inline-block;
    margin-top: 8px;
    background: #ffa600;
    color: #fff !important;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    transition: background 0.2s;
}

.pnt-buy-btn:hover {
    background: #e09500;
}

/* Joke bubble */
.pnt-joke {
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: #3e2c00;
    align-self: flex-start;
    border-bottom-left-radius: 3px;
    font-style: italic;
}

/* Joke button — stacked below Send, same width */
#pnt-joke-btn {
    background: none;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    color: #2e7d32;
    font-weight: 600;
    width: 100%;
    flex: 1;
}

#pnt-joke-btn:hover {
    background: #f1f8e9;
}

#pnt-joke-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Instagram in-app browser — push widget above rounded screen corners */
body.pnt-instagram-browser #pnt-chat-widget {
    bottom: 50px !important;
    right: 28px !important;
}
