/* Floating Container */
#wo-chat-container {
    position: fixed;
    bottom: 100px; /* Offset above the WhatsApp floating button (which sits at ~20px) */
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#wo-chat-container.wo-pos-right {
    right: 20px;
}

#wo-chat-container.wo-pos-left {
    left: 20px;
}

/* Toggle Button */
#wo-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #77921E;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    padding: 0;
}

#wo-chat-container.wo-pos-right #wo-chat-toggle {
    float: right;
}

#wo-chat-container.wo-pos-left #wo-chat-toggle {
    float: left;
}

#wo-chat-toggle:hover {
    transform: scale(1.05);
}

#wo-chat-toggle img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Chat Window */
#wo-chat-window {
    width: 350px;
    height: 560px;
    max-height: 80vh;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 15px;
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    transform-origin: bottom right;
}

#wo-chat-container.wo-pos-left #wo-chat-window {
    transform-origin: bottom left;
}

#wo-chat-window.wo-hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    position: absolute;
}

/* Header */
.wo-chat-header {
    background: #77921E;
    color: #ffffff;
    padding: 15px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

#wo-chat-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
}

#wo-chat-close:hover {
    opacity: 1;
}

/* Body */
#wo-chat-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Messages */
.wo-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.wo-message p {
    margin: 0 0 8px 0;
}

.wo-message p:last-child {
    margin: 0;
}

.wo-message.wo-bot {
    align-self: flex-start;
    background: #ffffff;
    color: #333333;
    border: 1px solid #eeeeee;
    border-bottom-left-radius: 2px;
}

.wo-message.wo-user {
    align-self: flex-end;
    background: #77921E;
    color: #ffffff;
    border-bottom-right-radius: 2px;
}

.wo-message a {
    color: #556B2F;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted #556B2F;
    transition: all 0.2s ease;
}

.wo-message a:hover {
    color: #3b4d1b;
    border-bottom: 1px solid #3b4d1b;
}

/* Footer / Input area */
.wo-chat-footer {
    display: flex;
    padding: 15px;
    background: #ffffff;
    border-top: 1px solid #eeeeee;
    gap: 10px;
    align-items: center;
}

#wo-chat-input {
    flex-grow: 1;
    border: 1px solid #dddddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#wo-chat-input:focus {
    border-color: #77921E;
}

#wo-chat-send {
    background: #77921E;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

#wo-chat-send svg {
    width: 18px;
    height: 18px;
    margin-left: 2px;
    /* optical alignment */
}

/* Loading Dots */
.wo-typing {
    display: flex;
    gap: 4px;
    padding: 5px;
}

.wo-typing span {
    width: 6px;
    height: 6px;
    background: #999;
    border-radius: 50%;
    animation: wo-bounce 1.4s infinite ease-in-out both;
}

.wo-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.wo-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes wo-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

@media screen and (max-width: 768px) {
    #wo-chat-window {
        width: calc(100vw - 40px);
        max-width: 290px;
        height: 55vh;
        margin-right: 20px;
    }
}

/* Quick-action buttons */
.wo-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 6px 0;
    align-self: flex-start;
    max-width: 100%;
}

.wo-quick-btn {
    background: transparent;
    border: 1.5px solid #77921E;
    color: #77921E;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    line-height: 1.3;
    font-family: inherit;
}

.wo-quick-btn:hover {
    background: #77921E;
    color: #ffffff;
    transform: translateY(-1px);
}

.wo-quick-btn:active {
    transform: translateY(0);
}
