:root {
    --pnd-primary: #10b981
}

.pnd-chatbot-toggle {
    position: fixed;
    z-index: 999999;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: var(--pnd-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
    transition: all .3s cubic-bezier(.4, 0, .2, 1)
}

.pnd-chatbot-toggle.bottom-right {
    bottom: 24px;
    right: 24px
}

.pnd-chatbot-toggle.bottom-left {
    bottom: 24px;
    left: 24px
}

.pnd-chatbot-toggle:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 10px 35px rgba(0, 0, 0, .3)
}

.pnd-chatbot-toggle.active .pnd-icon-chat {
    display: none !important
}

.pnd-chatbot-toggle.active .pnd-icon-close {
    display: block !important
}

.pnd-icon-close {
    display: none
}

.pnd-chatbot-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 18px;
    background: var(--pnd-primary);
    opacity: 0;
    animation: pnd-pulse 2s cubic-bezier(0, 0, .2, 1) infinite;
    pointer-events: none
}

.pnd-chatbot-toggle.active .pnd-chatbot-pulse {
    display: none
}

@keyframes pnd-pulse {
    0% {
        transform: scale(1);
        opacity: .35
    }

    100% {
        transform: scale(1.7);
        opacity: 0
    }
}

.pnd-greeting-bubble {
    position: fixed;
    z-index: 999;
    max-width: 220px;
    padding: 10px 16px;
    background: #fff;
    color: #1e293b;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px) scale(.9);
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
    border: 1px solid #e2e8f0
}

.pnd-greeting-bubble.bottom-right {
    bottom: 30px;
    right: 96px
}

.pnd-greeting-bubble.bottom-right::after {
    content: '';
    position: absolute;
    right: -6.5px;
    top: 50%;
    margin-top: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    transform: rotate(45deg)
}

.pnd-greeting-bubble.bottom-left {
    bottom: 30px;
    left: 96px
}

.pnd-greeting-bubble.bottom-left::after {
    content: '';
    position: absolute;
    left: -6.5px;
    top: 50%;
    margin-top: -6px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    border-left: 1px solid #e2e8f0;
    transform: rotate(45deg)
}

.pnd-greeting-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto
}

.pnd-greeting-close {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    background: #64748b;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
}

.pnd-greeting-close:hover {
    background: #ef4444
}

#pnd-chatbot-window {
    position: fixed;
    z-index: 999999;
    opacity: 0;
    transform: translateY(20px) scale(.95);
    transition: all .3s cubic-bezier(.4, 0, .2, 1)
}

#pnd-chatbot-window.bottom-right {
    bottom: 96px;
    right: 24px;
    display: none
}

#pnd-chatbot-window.bottom-left {
    bottom: 96px;
    left: 24px
}

#pnd-chatbot-window.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    display: block
}

#chat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 120px);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 25px 60px rgba(0, 0, 0, .15)
}

#pnd-chatbot-window.dark #chat-container {
    background: #0b0f1a;
    border-color: #1e293b
}

#pnd-chatbot-window header {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff
}

#pnd-chatbot-window.dark header {
    background: #0b0f1a;
    border-bottom-color: #1e293b
}

#pnd-chat-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3
}

#pnd-chatbot-window.dark #pnd-chat-title {
    color: #fff
}

#pnd-chatbot-window header button {
    padding: 6px;
    border-radius: 8px;
    color: #94a3b8;
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer
}

#pnd-chatbot-window header button:hover {
    background: #f1f5f9;
    color: #475569
}

#pnd-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: rgba(248, 250, 252, .5);
    display: flex;
    flex-direction: column;
    gap: 16px
}

#pnd-chatbot-window.dark #pnd-chatbot-messages {
    background: transparent
}

.pnd-msg-in {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%
}

.pnd-msg-out {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start;
    gap: 12px;
    max-width: 100%;
    margin-left: auto
}

.pnd-msg-in>div:first-child {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    background: var(--pnd-primary)
}

.pnd-msg-out>div:first-child {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0
}

.pnd-bubble-bot {
    padding: 10px 14px;
    border-radius: 14px;
    border-top-left-radius: 4px;
    background: #fff;
    border: 1px solid #f1f5f9;
    color: #475569;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    line-height: 1.55;
    font-size: 13px;
    word-wrap: break-word
}

.pnd-bubble-user {
    padding: 10px 14px;
    border-radius: 14px;
    border-top-right-radius: 4px;
    background: var(--pnd-primary);
    color: #fff;
    line-height: 1.55;
    font-size: 13px;
    word-wrap: break-word
}

.pnd-bubble-error {
    padding: 10px 14px;
    border-radius: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    line-height: 1.55;
    font-size: 13px
}

#pnd-chatbot-window.dark .pnd-bubble-bot {
    background: #1a2133;
    border-color: #1e293b;
    color: #cbd5e1
}

.pnd-typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px 0
}

.pnd-typing-dot {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: pnd-bounce 1.4s ease-in-out infinite
}

.pnd-typing-dot:nth-child(2) {
    animation-delay: .2s
}

.pnd-typing-dot:nth-child(3) {
    animation-delay: .4s
}

@keyframes pnd-bounce {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: .35
    }

    40% {
        transform: translateY(-8px);
        opacity: 1
    }
}

#pnd-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px
}

.pnd-suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    background: #f1f5f9;
    border: none;
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    white-space: nowrap
}

.pnd-suggestion-chip:hover {
    background: var(--pnd-primary);
    color: #fff
}

#pnd-chatbot-window footer {
    padding: 12px 14px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0
}

#pnd-chatbot-window.dark footer {
    background: #0b0f1a;
    border-top-color: #1e293b
}

#pnd-chatbot-input {
    width: 100%;
    padding: 10px 54px 10px 28px;
    border-radius: 14px;
    background: #f1f5f9;
    border: 2px solid transparent;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.5;
    outline: none
}

#pnd-chatbot-input:focus {
    border-color: rgba(16, 185, 129, .4);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .08);
    background: #f1f5f9
}

#pnd-chatbot-window.dark #pnd-chatbot-input {
    background: #1a2133;
    color: #f1f5f9
}

#pnd-chatbot-send {
    padding: 8px;
    border-radius: 10px;
    background: var(--pnd-primary);
    color: #fff;
    box-shadow: 0 0 12px rgba(16, 185, 129, .4);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    cursor: pointer
}

#pnd-chatbot-send:disabled {
    opacity: .4;
    cursor: not-allowed
}

#pnd-chatbot-send:not(:disabled):hover {
    filter: brightness(1.1);
    transform: translateY(-50%) scale(1.05)
}

form {
    margin: 0;
    padding: 0;
    position: relative
}

#pnd-chatbot-messages::-webkit-scrollbar {
    width: 6px
}

#pnd-chatbot-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px
}

.pnd-msg-in,
.pnd-msg-out {
    animation: pnd-msg-in .3s ease-out
}

@keyframes pnd-msg-in {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

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

.pnd-timestamp {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 500;
    padding: 0 4px;
    display: block;
    margin-top: 4px
}

@media(max-width:480px) {
    .pnd-chatbot-toggle {
        width: 52px;
        height: 52px;
        border-radius: 14px;
        bottom: 16px !important;
        right: 16px !important
    }

    #pnd-chatbot-window,
    #pnd-chatbot-window.bottom-right,
    #pnd-chatbot-window.bottom-left {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        transform: none !important
    }

    #pnd-chatbot-window.visible {
        transform: none !important
    }

    #chat-container {
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important
    }
}

.pnd-contact-wrapper {
    position: fixed;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center
}

.pnd-contact-wrapper.bottom-right {
    bottom: 24px;
    right: 24px
}

.pnd-contact-wrapper.bottom-left {
    bottom: 24px;
    left: 24px
}

.pnd-contact-wrapper .pnd-chatbot-toggle {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    margin: 0 !important
}

.pnd-contact-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer
}

.pnd-contact-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    color: #fff !important
}

.pnd-zalo-btn {
    background: #0068FF
}

.pnd-telegram-btn {
    background: #229ED9
}

.pnd-phone-btn {
    background: #10b981
}

@media(max-width:575.98px) {
    .pnd-greeting-bubble {
        display: none !important
    }

    .pnd-contact-wrapper {
        flex-direction: row-reverse;
        gap: 8px
    }

    .pnd-contact-wrapper.bottom-right {
        bottom: 16px !important;
        right: 16px !important;
        gap: 8px
    }

    .pnd-contact-wrapper.bottom-left {
        bottom: 16px !important;
        left: 16px !important;
        gap: 8px
    }

    .pnd-contact-wrapper .pnd-chatbot-toggle,
    .pnd-contact-btn {
        width: 44px;
        height: 44px;
        border-radius: 50%
    }
}
