/* Picoo Assistant Chatbox Styles */

/* Variables - Adjust to match your site theme */
:root {
    --chatbox-primary: #014c80;
    --chatbox-primary-dark: #013a61;
    --chatbox-secondary: #f5f5f5;
    --chatbox-text: #333333;
    --chatbox-text-light: #666666;
    --chatbox-white: #ffffff;
    --chatbox-shadow: rgba(0, 0, 0, 0.15);
    --chatbox-user-bubble: #014c80;
    --chatbox-assistant-bubble: #f0f0f0;
}

/* Floating Bubble Button */
.chatbox-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--chatbox-primary);
    box-shadow: 0 4px 12px var(--chatbox-shadow);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.chatbox-bubble:hover {
    transform: scale(1.1);
    background: var(--chatbox-primary-dark);
}

.chatbox-bubble svg {
    width: 28px;
    height: 28px;
    fill: var(--chatbox-white);
}

.chatbox-bubble.active svg.chat-icon {
    display: none;
}

.chatbox-bubble.active svg.close-icon {
    display: block;
}

.chatbox-bubble svg.close-icon {
    display: none;
}

/* Chat Window */
.chatbox-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 370px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: var(--chatbox-white);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--chatbox-shadow);
    z-index: 9997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatbox-slideUp 0.3s ease;
}

.chatbox-window.open {
    display: flex;
}

@keyframes chatbox-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.chatbox-header {
    background: var(--chatbox-primary);
    color: var(--chatbox-white);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chatbox-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--chatbox-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chatbox-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.chatbox-header-avatar svg {
    width: 24px;
    height: 24px;
    fill: var(--chatbox-primary);
}

.chatbox-header-info {
    flex: 1;
}

.chatbox-header-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--chatbox-white);
}

.chatbox-header-status {
    font-size: 12px;
    opacity: 0.9;
    margin: 0;
    color: var(--chatbox-white);
}

/* Chat Messages Area */
.chatbox-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chatbox-secondary);
}

/* Message Bubbles */
.chatbox-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chatbox-message.user {
    align-self: flex-end;
    background: var(--chatbox-user-bubble);
    color: var(--chatbox-white);
    border-bottom-right-radius: 4px;
}

.chatbox-message.assistant {
    align-self: flex-start;
    background: var(--chatbox-assistant-bubble);
    color: var(--chatbox-text);
    border-bottom-left-radius: 4px;
}

/* Welcome Message */
.chatbox-welcome {
    text-align: center;
    padding: 20px;
    color: var(--chatbox-text-light);
    font-size: 14px;
}

.chatbox-welcome-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    background: var(--chatbox-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chatbox-welcome-icon svg {
    width: 28px;
    height: 28px;
    fill: var(--chatbox-white);
}

/* Typing Indicator */
.chatbox-typing {
    align-self: flex-start;
    background: var(--chatbox-assistant-bubble);
    padding: 12px 16px;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: none;
}

.chatbox-typing.visible {
    display: block;
}

.chatbox-typing-dots {
    display: flex;
    gap: 4px;
}

.chatbox-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--chatbox-text-light);
    border-radius: 50%;
    animation: chatbox-bounce 1.4s ease-in-out infinite;
}

.chatbox-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbox-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatbox-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* Chat Input Area */
.chatbox-input-area {
    padding: 12px 16px;
    background: var(--chatbox-white);
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbox-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.chatbox-input:focus {
    border-color: var(--chatbox-primary);
}

.chatbox-input::placeholder {
    color: #999;
}

.chatbox-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--chatbox-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.chatbox-send:hover {
    background: var(--chatbox-primary-dark);
}

.chatbox-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chatbox-send svg {
    width: 18px;
    height: 18px;
    fill: var(--chatbox-white);
}

/* Responsive */
@media (max-width: 480px) {
    .chatbox-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
        max-height: none;
        border-radius: 12px;
    }

    .chatbox-bubble {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }
}

/* Scrollbar styling */
.chatbox-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbox-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbox-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.chatbox-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
