/* WP Chatbot Styles */

.wp-chatbot-container {
    position: fixed;
    width: 350px;
    height: 500px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
}

.wp-chatbot-container.wp-chatbot-visible {
    transform: translateY(0);
    opacity: 1;
}

/* Position classes */
.wp-chatbot-position-bottom-right {
    bottom: 100px;
    right: 20px;
}

.wp-chatbot-position-bottom-left {
    bottom: 100px;
    left: 20px;
}

.wp-chatbot-position-top-right {
    top: 100px;
    right: 20px;
}

.wp-chatbot-position-top-left {
    top: 100px;
    left: 20px;
}

/* Header */
.wp-chatbot-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.wp-chatbot-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.wp-chatbot-icon {
    font-size: 20px;
}

.wp-chatbot-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wp-chatbot-close:hover {
    opacity: 1;
}

/* Body */
.wp-chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wp-chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wp-chatbot-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    word-wrap: break-word;
    animation: messageAppear 0.3s ease;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wp-chatbot-user-message {
    align-self: flex-end;
    background: #3a86ff;
    color: white;
    border-bottom-right-radius: 4px;
}

.wp-chatbot-bot-message {
    align-self: flex-start;
    background: #f0f2f5;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}

.wp-chatbot-message-content {
    white-space: pre-wrap;
}

/* Input area */
.wp-chatbot-input-area {
    padding: 16px 20px;
    border-top: 1px solid #e4e6eb;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.wp-chatbot-input {
    flex: 1;
    border: 1px solid #e4e6eb;
    border-radius: 20px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    min-height: 44px;
    line-height: 1.4;
    transition: border-color 0.2s;
}

.wp-chatbot-input:focus {
    outline: none;
    border-color: #3a86ff;
}

.wp-chatbot-send {
    background: #3a86ff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.wp-chatbot-send:hover {
    background: #2a76ef;
}

.wp-chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Footer */
.wp-chatbot-footer {
    padding: 12px 20px;
    border-top: 1px solid #e4e6eb;
    text-align: center;
    font-size: 12px;
    color: #65676b;
}

/* Toggle button */
.wp-chatbot-toggle {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999998;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wp-chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wp-chatbot-toggle.wp-chatbot-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wp-chatbot-toggle.wp-chatbot-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.wp-chatbot-toggle.wp-chatbot-position-top-right {
    top: 20px;
    right: 20px;
}

.wp-chatbot-toggle.wp-chatbot-position-top-left {
    top: 20px;
    left: 20px;
}

.wp-chatbot-toggle-icon {
    font-size: 28px;
}

/* Loading indicator */
.wp-chatbot-loading {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.wp-chatbot-loading-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #999;
    animation: loadingDot 1.4s infinite ease-in-out both;
}

.wp-chatbot-loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.wp-chatbot-loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .wp-chatbot-container {
        width: calc(100vw - 40px);
        height: 60vh;
        max-height: 500px;
        bottom: 80px;
        left: 20px;
        right: 20px;
        top: auto;
    }
    
    .wp-chatbot-toggle {
        width: 56px;
        height: 56px;
    }
    
    .wp-chatbot-toggle.wp-chatbot-position-bottom-right,
    .wp-chatbot-toggle.wp-chatbot-position-bottom-left {
        bottom: 20px;
    }
    
    .wp-chatbot-toggle.wp-chatbot-position-top-right,
    .wp-chatbot-toggle.wp-chatbot-position-top-left {
        top: 20px;
    }
}

/* Typing indicator */
.wp-chatbot-typing-indicator {
    background: #f0f2f5;
    padding: 12px 16px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    display: flex;
    gap: 4px;
    align-items: center;
}

.wp-chatbot-typing-text {
    font-size: 12px;
    color: #65676b;
    margin-right: 8px;
}