/**
 * Codice CSS della Chat
 */
 
 .chat-container {
    display: flex;
    flex-direction: column;
    height: 75vh;
    background-color: transparent;
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    position: relative;
}

.chat-box {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-container {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-top: auto;
    max-width: 780px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.input-container.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-top: 0;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 780px;
}

.chat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
    margin-bottom: 10px;
}

.chat-input:focus {
    border-color: #1f91f3;
}

.button-container {
    display: flex;
    align-items: center;
    gap: 10px;
}


.chat-send-btn {
    background: #1f91f3;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.chat-send-btn.disabled {
    background: #cccccc;
    cursor: not-allowed;
}

.chat-send-btn:hover:not(.disabled) {
    background-color: #1676c1;
}

.upload-btn {
    border: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-bottom: 0;
    transition: background-color 0.3s ease;
}

.upload-btn:hover {
    background-color: #eeeeee;
}

#file-input {
    display: none;
}

.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    max-width: 70%;
    margin-bottom: 12px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-self: flex-end;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-content {
    font-size: 14px;
    line-height: 1.6;
    padding: 12px 16px;
    border-radius: 20px;
    word-wrap: break-word;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in-out;
    background-color: #1f91f3;
    color: white;
}

.user-message {
    align-self: flex-end;
    display: flex;
    flex-direction: row;
}

.user-message .message-content {
    background-color: #1f91f3;
    color: white;
    border-radius: 20px;
}

.user-message .message-content p {
    margin: 0; 
    padding: 0;
}

.bot-message {
    align-self: flex-start;
    display: flex;
    flex-direction: row;
}

.bot-message .message-content {
    background-color: #f5f5f5;
    color: #212529;
    border-radius: 20px;
}

.bot-message .message-content strong {
    font-weight: bold;
}

.bot-message .message-content em {
    font-style: italic;
}

.bot-message .message-content code {
    font-weight: 600;
    background-color: #ddd;
    color: #404040;
    border-radius: 4px;
    font-family: 'Roboto Mono';
    padding: 2px 4px;
}

.bot-message .message-content ul {
    margin: 10px 0 10px 20px;
    padding: 0;
    font-size: 14px;
    list-style-type: disc;
}

.bot-message .message-content ol {
    list-style-type: decimal;
    margin: 10px 0 10px 20px;
    padding: 0;
}

.bot-message .message-content li {
    margin-bottom: 5px;
    font-size: 14px;
}

.bot-message .message-content li::marker {
    color: #404040;
    font-weight: bold;
}

.bot-message .message-content a {
    color: #1f91f3;
    text-decoration: none;
}

.bot-message .message-content a:hover {
    text-decoration: underline;
}

.file-preview-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    width: fit-content;
}

.file-preview-box i {
    font-size: 20px;
    color: #1f91f3;
}

.file-preview-box span {
    font-size: 14px;
    color: #333;
}

.file-preview-box button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview-box button i {
    font-size: 16px;
    color: #666;
}

.file-preview-box button:hover i {
    color: #ff0000;
}

.initial-message {
    text-align: center;
    margin-bottom: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -180%);
    width: 100%;
}

.initial-message h1 {
    font-size: 24px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.initial-message p {
    font-size: 16px;
    color: #666;
}

.warehouse-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #1f91f3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex; 
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 180px;
    box-sizing: border-box;
    transition: background-color 0.3s ease;
}

.warehouse-btn i{
    font-size: 16px;
    margin-right: 8px;
}

.warehouse-btn:hover {
    background-color: #1676c1;
}

.button-container {
    margin-top: 10px;
    text-align: center;
    align-items: center;
    gap: 10px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    animation: fadeIn 0.4s ease-in-out;
}

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

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

.chat-send-btn.loading {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn.loading .loading-spinner {
    margin: 0;
}