/* OneBiz AI Website Chatbot Styles */

#onebiz-chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #00BCD4);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.4);
    z-index: 99999;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#onebiz-chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(21, 101, 192, 0.5);
}

#onebiz-chat-toggle.onebiz-chat-toggle-active {
    transform: rotate(90deg);
}

#onebiz-chat-container {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    z-index: 99998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#onebiz-chat-container.onebiz-chat-closed {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

#onebiz-chat-container.onebiz-chat-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Header */
.onebiz-chat-header {
    background: linear-gradient(135deg, #1565C0, #00BCD4);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.onebiz-chat-header-title {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.onebiz-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.8;
    padding: 0 4px;
    line-height: 1;
}

.onebiz-chat-close:hover {
    opacity: 1;
}

/* Messages */
.onebiz-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.onebiz-chat-msg {
    display: flex;
    max-width: 85%;
}

.onebiz-chat-msg-user {
    align-self: flex-end;
}

.onebiz-chat-msg-ai {
    align-self: flex-start;
}

.onebiz-chat-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.onebiz-chat-msg-user .onebiz-chat-bubble {
    background: linear-gradient(135deg, #1565C0, #1976D2);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.onebiz-chat-msg-ai .onebiz-chat-bubble {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* Email form */
.onebiz-chat-email-form {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.onebiz-chat-email-form p {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.onebiz-chat-field {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.onebiz-chat-field:focus {
    border-color: #1565C0;
    box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.15);
}

.onebiz-chat-btn-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #1565C0, #00BCD4);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.onebiz-chat-btn-submit:hover {
    opacity: 0.9;
}

/* Input area */
.onebiz-chat-input-area {
    display: flex;
    padding: 10px;
    gap: 8px;
    background: #fff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

#onebiz-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
}

#onebiz-chat-input:focus {
    border-color: #1565C0;
}

#onebiz-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #00BCD4);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#onebiz-chat-send:hover {
    opacity: 0.9;
}

#onebiz-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing indicator */
.onebiz-typing .onebiz-chat-bubble {
    display: flex;
    gap: 4px;
    padding: 12px 18px;
}

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

.onebiz-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.onebiz-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes onebiz-typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 480px) {
    #onebiz-chat-container {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 80px;
        height: calc(100vh - 100px);
        border-radius: 12px;
    }

    #onebiz-chat-toggle {
        bottom: 16px;
        right: 16px;
    }
}
