/* /css/ai-assistant.css */

/* =================================== */
/* ====== Floating Action Button ===== */
/* =================================== */

.ai-fab {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color, #6a11cb); /* Използваме променлива от style.css или резервен цвят */
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1050; /* Под модалите, но над повечето съдържание */
    transition: transform 0.2s ease-in-out, background-color 0.2s;
}

.ai-fab:hover {
    transform: scale(1.1);
    background-color: var(--primary-hover-color, #8a2be2); /* По-светъл цвят при hover */
}

/* =================================== */
/* ====== AI Modal Container ========= */
/* =================================== */

.ai-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055; /* Над стандартния z-index на Bootstrap модалите */
    
    /* Скрит по подразбиране */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Клас за показване на модала */
.ai-modal-container.show {
    visibility: visible;
    opacity: 1;
}

/* =================================== */
/* ====== AI Modal Content =========== */
/* =================================== */

.ai-modal-content {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 450px;
    height: 70vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.ai-modal-container.show .ai-modal-content {
    transform: scale(1);
}

/* --- Modal Header --- */
.ai-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.ai-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

.ai-title-span {
    font-weight: 400;
    font-size: 0.9rem;
    color: #6c757d;
}

/* --- Modal Body (Messages Area) --- */
.ai-modal-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word;
}

.ai-message.user-message {
    background-color: var(--primary-color, #6a11cb);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-message.assistant-message {
    background-color: #e9ecef;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-message.assistant-message.thinking::after {
    content: '...';
    display: inline-block;
    animation: thinking-dots 1.5s infinite;
}

@keyframes thinking-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* --- Modal Footer (Input Area) --- */
.ai-modal-footer {
    display: flex;
    align-items: flex-start; /* Подравняване по горния край за многоредов textarea */
    padding: 1rem 1.5rem;
    border-top: 1px solid #dee2e6;
    gap: 10px;
    background-color: #f8f9fa;
}

#ai-assistant-input {
    flex-grow: 1;
    border-radius: 20px;
    padding: 8px 15px;
    resize: none; /* Забрана на ръчното оразмеряване */
    max-height: 100px; /* Ограничение на височината */
    overflow-y: auto;
    line-height: 1.5;
    border: 1px solid #ced4da;
}

#ai-assistant-send-btn {
    flex-shrink: 0; /* Бутонът да не се свива */
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}