/* WhatsApp Centering Override */
.floating-wpp {
    left: calc(50% - 65px) !important;
    right: auto !important;
}

.floating-wpp .floating-wpp-popup {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
}

/* Chatbot Floating Button */
.chatbot-toggler {
    position: fixed;
    left: calc(50% + 5px);
    /* Positioned to the right of the center line */
    bottom: 15px;
    /* Matching floating-wpp.css default bottom */
    height: 60px;
    width: 60px;
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    cursor: pointer;
    background: #04af04;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10001;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.chatbot-toggler:hover {
    transform: scale(1.05);
}

.chatbot-toggler span {
    font-size: 25px;
    position: absolute;
}

.chatbot-toggler span:last-child,
.chatbot-container.show-chatbot .chatbot-toggler span:first-child {
    opacity: 0;
}

.chatbot-container.show-chatbot .chatbot-toggler span:last-child {
    opacity: 1;
}

/* Chatbot Window */
.chatbot-window {
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    bottom: 82px;
    /* Matching floating-wpp-popup bottom */
    width: 350px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.chatbot-container.show-chatbot .chatbot-window {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.chatbot-header {
    background: #04af04;
    padding: 15px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header .header-info {
    display: flex;
    flex-direction: column;
}

.chatbot-header h2 {
    font-size: 1.1rem;
    margin: 0;
}

.model-tag {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 300;
}

.chatbox {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat {
    display: flex;
    list-style: none;
}

.chat .message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 85%;
    font-size: 0.93rem;
    line-height: 1.55;
    word-break: break-word;
}

.chat .message .chat-p {
    margin: 0 0 8px 0;
    line-height: 1.55;
}

.chat .message .chat-p:last-child {
    margin-bottom: 0;
}

.chat .message strong {
    font-weight: 600;
    color: #ffffff;
}

.chat.incoming .message strong {
    color: #38ef7d;
}

.chat .message em {
    font-style: italic;
    color: #d1d5db;
}

.chat .message .chat-h2,
.chat .message .chat-h3,
.chat .message .chat-h4 {
    margin: 10px 0 6px 0;
    font-weight: 700;
    color: #38ef7d;
    line-height: 1.3;
}

.chat .message .chat-h2 { font-size: 1.08rem; }
.chat .message .chat-h3 { font-size: 1.02rem; }
.chat .message .chat-h4 { font-size: 0.96rem; }

.chat .message .chat-ul,
.chat .message .chat-ol {
    margin: 6px 0 10px 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.chat .message .chat-li {
    line-height: 1.45;
    position: relative;
}

.chat.incoming .message .chat-ul .chat-li::marker {
    color: #04af04;
}

.chat .message .chat-link {
    color: #38ef7d;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.chat .message .chat-link:hover {
    opacity: 0.85;
}

.chat .message .chat-code {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.86em;
    font-family: Consolas, Monaco, monospace;
    color: #38ef7d;
}

.chat .message .chat-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), rgba(255,255,255,0.2), rgba(255,255,255,0.05));
    margin: 10px 0;
}

.chat .message .error-text {
    color: #ff6b6b;
    font-weight: 500;
}

.chat.incoming .message {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    border-bottom-left-radius: 2px;
}

.chat.incoming .message.error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.chat.outgoing {
    justify-content: flex-end;
}

.chat.outgoing .message {
    background: linear-gradient(135deg, #04af04 0%, #038a03 100%);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px rgba(4, 175, 4, 0.25);
}

.chat-input {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    background: rgba(10, 10, 10, 0.5);
}

.chat-input textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    background: transparent;
    color: #fff;
    font-size: 0.95rem;
    padding: 10px 0;
    font-family: inherit;
}

.chat-input span {
    align-self: flex-end;
    color: #04af04;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 5px;
    transition: transform 0.2s;
}

.chat-input span:hover {
    transform: scale(1.1);
}

/* Scrollbar Styling */
.chatbox::-webkit-scrollbar {
    width: 5px;
}

.chatbox::-webkit-scrollbar-track {
    background: transparent;
}

.chatbox::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}