/* RAG Assistant - Chat Widget Styles */

.rag-chat-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fff;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* Header */
.rag-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #1e3a5f;
    color: #fff;
}

.rag-chat-avatar {
    font-size: 28px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rag-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.rag-chat-status {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 4px;
}

.rag-chat-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
}

/* Messages area */
.rag-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f8fafc;
}

/* Messages */
.rag-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.rag-message-bot { align-self: flex-start; }
.rag-message-user { align-self: flex-end; }

.rag-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.6;
}

.rag-message-bot .rag-message-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 4px;
    color: #1a202c;
}

.rag-message-user .rag-message-content {
    background: #1e3a5f;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* Sources */
.rag-sources {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f0f4f8;
    border-radius: 8px;
    border-left: 3px solid #1e3a5f;
}

.rag-sources-title {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rag-source-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.rag-source-icon { font-size: 14px; }

.rag-source-link {
    color: #1e3a5f;
    text-decoration: none;
    font-weight: 500;
}

.rag-source-link:hover { text-decoration: underline; }

.rag-source-relevance {
    font-size: 11px;
    color: #718096;
    margin-left: auto;
}

/* Typing indicator */
.rag-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.rag-typing span {
    width: 8px;
    height: 8px;
    background: #cbd5e0;
    border-radius: 50%;
    animation: rag-bounce 1.2s infinite;
}

.rag-typing span:nth-child(2) { animation-delay: 0.2s; }
.rag-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes rag-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Input area */
.rag-chat-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

.rag-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.rag-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    max-height: 120px;
    overflow-y: auto;
}

.rag-chat-input:focus { border-color: #1e3a5f; }

.rag-send-btn {
    width: 42px;
    height: 42px;
    background: #1e3a5f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.rag-send-btn:hover { background: #2d5986; }
.rag-send-btn:disabled { background: #cbd5e0; cursor: not-allowed; }

.rag-send-btn svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
}

.rag-chat-disclaimer {
    font-size: 11px;
    color: #a0aec0;
    margin: 8px 0 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .rag-chat-container { border-radius: 0; }
    .rag-message { max-width: 95%; }
}