/* AI Shopping Assistant Styles */

/* Toggle Button */
.ai-toggle {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 80;
    transition: all 0.3s ease;
}

.ai-toggle.ai-toggle-hidden {
    transform: scale(0);
    opacity: 0;
}

.ai-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.ai-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(255, 107, 53, 0.6);
}

.ai-toggle-btn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

.ai-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 10px;
    border: 2px solid white;
}

/* Chat Window */
.ai-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    height: 600px;
    background: var(--bg);
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    transform: scale(0) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 90;
    pointer-events: none;
}

.ai-chat.ai-chat-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.ai-chat-header {
    background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header-content {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-avatar {
    font-size: 32px;
    line-height: 1;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.ai-status {
    font-size: 12px;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

.ai-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ai-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-close svg {
    width: 18px;
    height: 18px;
}

/* Messages Area */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-message {
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.ai-message.ai-message-visible {
    opacity: 1;
    transform: translateY(0);
}

.ai-message-bot {
    align-self: flex-start;
}

.ai-message-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ai-message-avatar {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.ai-message-content {
    background: var(--accent);
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 70%;
}

.ai-message-user .ai-message-content {
    background: #ff6b35;
    color: white;
}

.ai-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.ai-message-content p + p {
    margin-top: 8px;
}

/* Suggestions */
.ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.ai-suggestion {
    background: white;
    border: 2px solid #ff6b35;
    color: #ff6b35;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.ai-suggestion:hover {
    background: #ff6b35;
    color: white;
    transform: translateX(4px);
}

/* Typing Indicator */
.ai-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px 10px;
    font-size: 12px;
    color: var(--mute);
}

.ai-typing-indicator {
    display: flex;
    gap: 4px;
}

.ai-typing-indicator span {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Area */
.ai-chat-input {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    border-radius: 0 0 16px 16px;
}

.ai-chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--line);
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--fg);
    transition: all 0.3s ease;
    min-width: 0;
    width: 100%;
}

.ai-chat-input input::placeholder {
    color: var(--mute);
    opacity: 0.7;
    font-size: 13px;
}

.ai-chat-input input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

.ai-chat-input button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ff6b35;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.ai-chat-input button:hover {
    background: #e55a2b;
    transform: scale(1.1);
}

.ai-chat-input button svg {
    width: 20px;
    height: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-toggle {
        right: 12px;
        bottom: 90px;
    }
    
    .ai-toggle-btn {
        width: 56px;
        height: 56px;
    }
    
    .ai-toggle-btn svg {
        width: 26px;
        height: 26px;
    }
    
    .ai-chat {
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .ai-chat-header {
        border-radius: 0;
        padding: 16px;
    }
    
    .ai-message-content {
        max-width: 80%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ai-message-content {
        background: var(--bg3);
    }
    
    .ai-suggestion {
        background: var(--bg2);
        border-color: #ff6b35;
    }
    
    .ai-chat-input input {
        background: var(--bg2);
    }
}

/* Scrollbar */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--mute);
}
