/**
 * WooCommerce AI Assistant - Chat Widget Styles
 */

/* Chat Bubble */
.wc-ai-chat-bubble {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    z-index: 9998;
    animation: pulse 2s infinite;
}

.wc-ai-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.wc-ai-chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    }
}

/* Chat Panel */
.wc-ai-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

.wc-ai-chat-panel.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat Header */
.wc-ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.wc-ai-chat-header-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wc-ai-chat-header-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
}

.wc-ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 20px;
    line-height: 1;
}

.wc-ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.wc-ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc-ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.wc-ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wc-ai-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.wc-ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Message Bubbles */
.wc-ai-message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-ai-message.user {
    justify-content: flex-end;
}

.wc-ai-message.assistant {
    justify-content: flex-start;
}

.wc-ai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.wc-ai-message.user .wc-ai-message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.wc-ai-message.assistant .wc-ai-message-content {
    background: #ffffff;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Product Links in Messages */
.wc-ai-message-content a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
}

.wc-ai-message.assistant .wc-ai-message-content a {
    color: #667eea;
}

/* Typing Indicator */
.wc-ai-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 75px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.wc-ai-typing-dot {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.wc-ai-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wc-ai-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #cbd5e0;
    }
    30% {
        transform: translateY(-10px);
        background: #667eea;
    }
}

/* Chat Input */
.wc-ai-chat-input {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.wc-ai-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.wc-ai-chat-input input:focus {
    border-color: #667eea;
}

.wc-ai-chat-input button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.wc-ai-chat-input button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wc-ai-chat-input button:active {
    transform: translateY(0);
}

.wc-ai-chat-input button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Welcome Message */
.wc-ai-welcome {
    text-align: center;
    padding: 20px;
    color: #718096;
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .wc-ai-chat-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .wc-ai-chat-header {
        border-radius: 0;
    }

    .wc-ai-chat-bubble {
        bottom: 15px;
        right: 15px;
    }

    .wc-ai-message-content {
        max-width: 85%;
    }
}

/* Error Message */
.wc-ai-error {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 8px 0;
    text-align: center;
}
