/* ============================================
   AI ASSISTANT CHAT WIDGET STYLES
   ============================================ */

/* Chat Widget Container */
.ai-chat-widget {
    position: fixed;
    bottom: 280px;
    right: 32px;
    z-index: var(--z-modal);
}

/* Chat Button */
.ai-chat-button {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: var(--color-white);
    border: none;
    font-size: var(--text-2xl);
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

.ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
}

.ai-chat-button.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0);
}

/* Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 400px;
    max-width: calc(100vw - 64px);
    height: 600px;
    max-height: calc(100vh - 100px);
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all var(--transition-base);
}

.ai-chat-window.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

/* Chat Header */
.ai-chat-header {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: var(--color-white);
    padding: var(--space-4);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.ai-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-lg);
}

.ai-chat-header h4 {
    margin: 0;
    font-size: var(--text-base);
    color: var(--color-white);
}

.ai-status {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ai-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: var(--radius-full);
    display: inline-block;
    animation: pulse 2s infinite;
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--color-white);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Messages Container */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    background: #F9FAFB;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: var(--radius-full);
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* AI Message */
.ai-message {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.ai-message-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.ai-message-content {
    background: var(--color-white);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-sm);
    box-shadow: var(--shadow-sm);
    max-width: 75%;
    font-size: var(--text-sm);
    line-height: 1.6;
    color: var(--color-gray-700);
    animation: fadeInUp 0.3s ease-out;
}

/* User Message */
.user-message {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    justify-content: flex-end;
}

.user-message-avatar {
    width: 32px;
    height: 32px;
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.user-message-content {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: var(--color-white);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
    box-shadow: var(--shadow-sm);
    max-width: 75%;
    font-size: var(--text-sm);
    line-height: 1.6;
    animation: fadeInUp 0.3s ease-out;
}

/* Typing Indicator */
.typing-indicator .ai-message-content {
    padding: var(--space-3);
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #6366F1;
    border-radius: var(--radius-full);
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Quick Suggestions */
.ai-quick-suggestions {
    padding: var(--space-3) var(--space-4);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    flex-wrap: wrap;
}

.ai-quick-suggestions::-webkit-scrollbar {
    height: 4px;
}

.ai-quick-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.ai-quick-suggestions::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: var(--radius-full);
}

.ai-suggestion-btn {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    color: var(--color-gray-700);
}

.ai-suggestion-btn:hover {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: var(--color-white);
    border-color: transparent;
    transform: translateY(-2px);
}

/* Input Area */
.ai-chat-input-area {
    padding: var(--space-4);
    background: var(--color-white);
    border-top: 1px solid var(--color-gray-200);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    display: flex;
    gap: var(--space-3);
}

.ai-chat-input {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    background: #F9FAFB;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #6366F1;
    background: var(--color-white);
}

.ai-chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.ai-chat-send:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

/* Powered By */
.ai-powered-by {
    padding: var(--space-2) var(--space-4);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    background: #F9FAFB;
    border-top: 1px solid var(--color-gray-200);
}

.ai-powered-by a {
    color: var(--color-gold);
    text-decoration: none;
    font-weight: var(--weight-semibold);
}

.ai-powered-by a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 220px;
        right: 16px;
    }

    .ai-chat-button {
        width: 50px;
        height: 50px;
        font-size: var(--text-xl);
    }

    .ai-chat-window {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        max-width: none;
        height: calc(100vh - 100px);
    }

    .ai-message-content,
    .user-message-content {
        max-width: 85%;
    }
}

@media (max-width: 480px) {
    .ai-chat-window {
        height: calc(100vh - 80px);
    }

    .ai-quick-suggestions {
        flex-wrap: nowrap;
    }
}