/* assets/css/ai.css */
/* --- Professional AI Assistant Styles (v2 - Mobile Fix) --- */
:root {
    --ai-primary: #4361ee;
    --ai-background: #ffffff;
    --ai-header-bg: #f8f9fa;
    --ai-user-msg-bg: #eef2ff;
    --ai-bot-msg-bg: #f1f5f9;
    --ai-text-primary: #1e293b;
    --ai-text-secondary: #64748b;
    --ai-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --ai-transition: all 0.3s ease-in-out;
}

.ai-assistant-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1050;
}

.ai-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--ai-primary), #5a74f1);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--ai-transition);
    animation: pulse 2s infinite;
}
.ai-toggle-btn:hover {
    transform: scale(1.1);
}

.ai-chat-box {
    width: 370px;
    max-height: 600px;
    background-color: var(--ai-background);
    border-radius: 16px;
    box-shadow: var(--ai-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.ai-chat-box.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--ai-header-bg);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.ai-header-info { display: flex; align-items: center; gap: 12px; }
.ai-header-info i { font-size: 20px; color: var(--ai-primary); }
.ai-title { font-weight: 600; color: var(--ai-text-primary); }
.ai-status { font-size: 13px; color: var(--success, #059669); }
.ai-close-btn { background: none; border: none; font-size: 24px; color: var(--ai-text-secondary); cursor: pointer; }

.ai-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.message {
    display: flex;
    max-width: 85%;
    align-items: flex-start;
    gap: 10px;
    animation: message-fade-in 0.4s ease-out;
}
@keyframes message-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.message .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ai-primary); color: white; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.user .avatar { background: var(--ai-text-secondary); }
.message-content { padding: 12px 16px; border-radius: 18px; font-size: 15px; line-height: 1.6; }
.message.bot .message-content { background: var(--ai-bot-msg-bg); color: var(--ai-text-primary); border-top-left-radius: 4px; }
.message.user .message-content { background: var(--ai-primary); color: white; border-top-right-radius: 4px; }
.message-content strong { color: var(--ai-primary); }
.message-content ul { padding-left: 20px; margin: 10px 0 0; }

.ai-footer { display: flex; padding: 15px; border-top: 1px solid var(--border-color, #e2e8f0); }
#aiInput {
    flex-grow: 1;
    border: 1px solid var(--border-color, #e2e8f0);
    padding: 12px 15px;
    border-radius: 50px;
    outline-color: var(--ai-primary);
    font-size: 15px;
}
#aiSendBtn {
    background: var(--ai-primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--ai-transition);
}
#aiSendBtn:hover { background: var(--primary-dark, #3a56d4); }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(67, 97, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0); }
}

/* === THE FIX IS HERE (Mobile Responsive CSS) === */
@media (max-width: 480px) {
    .ai-assistant-container {
        right: 15px;
        bottom: 15px;
    }
    .ai-chat-box {
        width: calc(100vw - 30px); /* Full width minus some padding */
        max-height: 75vh;
        bottom: 80px;
        right: -15px; /* Align with new container position */
    }
}
/*
 * ai.css
 * v1.0 - Styles for the Alpha AI Trading Chatbot
 */

/* Main Chat Toggle Button */
#aiToggleBtn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: #4361ee;
    color: white;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 999;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}

#aiToggleBtn:hover {
    transform: scale(1.1);
    background-color: #3a56d1;
}

/* Chatbox Container */
#aiChatBox {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 370px;
    max-width: 90vw;
    height: 500px;
    max-height: 70vh;
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0.3s;
    z-index: 1000;
}

#aiChatBox.show {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0s 0s;
}

/* Chatbox Header */
.ai-chat-header {
    background-color: #4361ee;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-chat-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

#aiCloseBtn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#aiCloseBtn:hover {
    opacity: 1;
}

/* Messages Area */
#aiMessages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f8fafc;
}

.message {
    display: flex;
    align-items: flex-end;
    margin-bottom: 15px;
    animation: fadeIn 0.4s ease-out;
}

.message.user {
    flex-direction: row-reverse;
}

.message .avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin: 0 10px;
    flex-shrink: 0;
}

.message-content {
    max-width: 75%;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
}

.message.bot .message-content {
    background-color: #eef2ff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background-color: #4361ee;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Input Area */
.ai-chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

#aiInput {
    flex-grow: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 10px 18px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#aiInput:focus {
    border-color: #4361ee;
}

#aiSendBtn {
    width: 45px;
    height: 45px;
    border: none;
    background-color: #4361ee;
    color: white;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s;
}

#aiSendBtn:hover {
    background-color: #3a56d1;
}

/* Animated Dots for Live Support */
.dot-loader {
    display: inline-flex;
    align-items: flex-end;
    margin-left: 5px;
    height: 20px; /* Aligns with text better */
}

.dot-loader .dot {
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot-loader .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot-loader .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
