/* AI Assistant Styles */
:root {
    --ai-primary: #667eea;
    --ai-secondary: #764ba2;
    --ai-bg: rgba(22, 33, 62, 0.85);
    --ai-text: #e8e8e8;
    --ai-user-bg: #4a5568;
    --ai-bot-bg: #2d3748;
}

/* Floating Action Button */
.ai-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ai-primary), var(--ai-secondary));
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    outline: none;
}

.ai-fab:hover {
    transform: scale(1.1);
}

.ai-fab svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chat Window Container */
.ai-window {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 350px;
    height: 500px;
    max-height: 80vh;
    background: var(--ai-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

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

/* Header */
.ai-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header h3 {
    font-size: 1rem;
    margin: 0;
    color: #fff;
}

.ai-close {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.2rem;
}

.ai-close:hover {
    color: white;
}

/* Messages Area */
.ai-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.ai-message {
    max-width: 85%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-message.user {
    background: var(--ai-user-bg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.ai-message.bot {
    background: var(--ai-bot-bg);
    color: #cbd5e0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Input Area */
.ai-input-area {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: white;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
}

.ai-input-area input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--ai-primary);
}

.ai-send {
    background: var(--ai-primary);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-send:hover {
    background: #5a67d8;
}

.ai-send svg {
    width: 16px;
    height: 16px;
    fill: white;
    margin-left: 2px; /* Visual correction */
}

/* Loading Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0.5rem 1rem;
    background: var(--ai-bot-bg);
    border-radius: 12px;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.dot {
    width: 6px;
    height: 6px;
    background: #a0aec0;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Responsive */
@media (max-width: 480px) {
    .ai-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: none;
    }
    
    .ai-fab {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}
