body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    margin-bottom: 15px;
}

.chat-input-container {
    margin-top: auto;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    max-width: 80%;
    position: relative;
}

.message-user {
    background-color: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.message-ai {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.message-time {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
    text-align: right;
}

.message-ai .message-time {
    text-align: left;
}

.chat-session {
    cursor: pointer;
}

.chat-session.active {
    background-color: #e9ecef;
}

#chatSessionsList {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.nav-tabs .nav-link {
    color: white;
}

.nav-tabs .nav-link.active {
    font-weight: bold;
}

.text-truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loader styling */
.loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Adjust the typing indicator message */
.message.typing {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.message.typing .message-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

/* Stile per il markdown */
.message-content {
    word-wrap: break-word;
}

.message-content pre {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

.message-content code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
}

.message-user .message-content pre,
.message-user .message-content code {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}