/* AI Assistant Floating Button */
.ai-assistant-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 9998;
}

.ai-assistant-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.ai-assistant-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff6b6b;
    color: white;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
}

/* AI Assistant Container */
.ai-assistant-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    height: 650px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.ai-assistant-container.minimized {
    height: 60px;
}

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

/* Header */
.ai-assistant-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

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

.ai-assistant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.ai-assistant-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-assistant-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-assistant-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

.ai-assistant-status.typing::before {
    background: #fbbf24;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.ai-assistant-header-actions {
    display: flex;
    gap: 8px;
}

.ai-assistant-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-assistant-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

.ai-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

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

.ai-assistant-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.ai-assistant-message {
    display: flex;
    gap: 10px;
    animation: messageIn 0.3s ease-out;
}

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

.ai-assistant-message.user {
    flex-direction: row-reverse;
}

.ai-assistant-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-assistant-message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 70%;
}

.ai-assistant-message.user .ai-assistant-message-content {
    align-items: flex-end;
}

.ai-assistant-message-text {
    padding: 12px 16px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    line-height: 1.5;
    font-size: 14px;
    color: #1e293b;
}

.ai-assistant-message.user .ai-assistant-message-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ai-assistant-message-text strong {
    font-weight: 600;
}

.ai-assistant-message-time {
    font-size: 11px;
    color: #94a3b8;
    padding: 0 4px;
}

/* Typing Indicator */
.ai-assistant-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai-assistant-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingDot 1.4s infinite;
}

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

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

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* Quick Actions */
.ai-assistant-quick-actions {
    padding: 12px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.ai-assistant-quick-btn {
    padding: 6px 12px;
    border-radius: 16px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-assistant-quick-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.ai-assistant-quick-btn.clear {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.ai-assistant-quick-btn.clear:hover {
    background: #fecaca;
}

/* Input */
.ai-assistant-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ai-assistant-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.ai-assistant-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    transition: all 0.2s;
}

.ai-assistant-input:focus {
    outline: none;
    border-color: #667eea;
}

.ai-assistant-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.ai-assistant-input-actions {
    display: flex;
    gap: 8px;
}

.ai-assistant-voice-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-assistant-voice-btn:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.ai-assistant-voice-btn.listening {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    animation: pulse 1.5s ease-in-out infinite;
}

.ai-assistant-voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-assistant-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-assistant-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.ai-assistant-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .ai-assistant-container {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 16px;
        right: 16px;
    }

    .ai-assistant-fab {
        bottom: 16px;
        right: 16px;
    }

    .ai-assistant-message-content {
        max-width: 85%;
    }
}
