/* assets/css/ai.css */
/* --- Professional AI Assistant Styles (v3 - Updated for .show toggle) --- */
: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;
}
/* SHOW when .show is present */
.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;
}
@keyframes message-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message {
    display: flex;
    max-width: 85%;
    align-items: flex-start;
    gap: 10px;
    animation: message-fade-in 0.4s ease-out;
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.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 .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-user-msg-bg); color: var(--ai-text-primary); border-top-right-radius: 4px; }

.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); }
}

/* === Mobile Responsive Fixes === */
@media (max-width: 480px) {
    .ai-assistant-container {
        right: 15px;
        bottom: 15px;
    }
    .ai-chat-box {
        width: calc(100vw - 30px);
        max-height: 75vh;
        bottom: 80px;
        right: -15px;
    }
}
.dot-loader {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

.dot-loader .dot {
  width: 6px;
  height: 6px;
  margin: 0 3px;
  background-color: white;
  border-radius: 50%;
  animation: dot-bounce 1.4s infinite ease-in-out both;
}

.dot-loader .dot:nth-child(1) { animation-delay: 0s;    }
.dot-loader .dot:nth-child(2) { animation-delay: 0.16s; }
.dot-loader .dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0); }
  40%           { transform: scale(1); }
}

