/* Styles pour l'interface de chat Oriana */

/* Animation d'affichage progressif du texte */
.typing-animation {
    position: relative;
}

.typing-animation::after {
    content: '|';
    position: absolute;
    display: inline-block;
    opacity: 0;
    animation: cursor-blink 0.8s infinite;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 700px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f9fafb;
    scroll-behavior: smooth;
}

.chat-message {
    display: flex;
    margin-bottom: 1rem;
    max-width: 100%;
}

.user-message {
    justify-content: flex-end;
}

.assistant-message {
    justify-content: flex-start;
}

.message-avatar {
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg,#ffffff3d,#fff0), var(--bs-primary) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.message-content {
    max-width: 80%;
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
    margin-bottom: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.assistant-message .message-bubble {
    background-color: #fff;
    border: 1px solid #e5e9f2;
    border-top-left-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-message .message-bubble {
    background: linear-gradient(180deg,#ffffff3d,#fff0), var(--bs-primary) !important;
    color: white;
    border-top-right-radius: 0.25rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.user-bubble {
    background: linear-gradient(180deg,#ffffff3d,#fff0), var(--bs-primary) !important;
    color: white;
}

.message-info {
    font-size: 0.75rem;
    color: #8094ae;
    padding: 0 0.5rem;
}

.chat-input-container {
    position: sticky;
    bottom: 0;
    background-color: #fff;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e5e9f2;
    z-index: 10;
    margin-top: auto;
}

.chat-input-container .input-group {
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chat-input-container textarea {
    border-radius: 30px !important;
    resize: none;
    padding-right: 60px !important;
    border: 1px solid #e5e9f2;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.chat-input-container textarea:focus {
    border-color: #3459ff;
    border-width: 2px;
}

.chat-input-container .btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.chat-input-container .btn:hover {
    transform: translateY(-50%) scale(1.05);
}

/* Style pour le contenu HTML dans les bulles */
.message-bubble .ai-content {
    max-width: 100%;
    overflow-x: auto;
}

/* Style pour l'en-tête fixe */
.chat-header {
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
    border-bottom: 1px solid #e5e9f2;
    padding: 0.75rem 1rem;
}

/* Styles pour l'historique des conversations */
#historyCollapse .card {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: none;
}

#historyCollapse .list-group-item {
    border-left: none;
    border-right: none;
    transition: all 0.2s ease;
}

#historyCollapse .list-group-item:first-child {
    border-top: none;
}

#historyCollapse .list-group-item:hover {
    background-color: #f5f6fa;
}

#historyCollapse .list-group-item.active {
    background-color: #eef0ff;
    color: var(--bs-primary);
    border-color: #e5e9f2;
}

.message-bubble .ai-content h1,
.message-bubble .ai-content h2,
.message-bubble .ai-content h3 {
    font-size: 14px;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    color: black;
}

.message-bubble .ai-content h1:first-child,
.message-bubble .ai-content h2:first-child,
.message-bubble .ai-content h3:first-child {
    margin-top: 0;
}

.message-bubble .ai-content p {
    margin-bottom: 0.5rem;
    font-size: 12px;
}

.message-bubble .ai-content ul,
.message-bubble .ai-content ol {
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.message-bubble .ai-content table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.message-bubble .ai-content table th,
.message-bubble .ai-content table td {
    border: 1px solid #e5e9f2;
    padding: 0.5rem;
}

.message-bubble .ai-content table th {
    background-color: #f5f6fa;
}

.loading-bubble {
    min-width: 100px;
    background-color: #f5f6fa !important;
}

/* Animation pour le chargement */
.oriana-thinckloader {
    display: flex;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 30px;
    height: 30px;
    position: relative;
}

.spinnerin {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--bs-primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .message-content {
        max-width: 90%;
    }
    
    .chat-messages-container {
        height: 300px;
    }
}


#animated-response {
    overflow: hidden;
}