body, html {
    width: 100%;
    height: 100%;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #121212;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chat-container {
    width: 100%; /* Increase width */
    max-width: 1200px; /* Increase max-width for larger screens */
    max-height: 100vh; /* 100% of the viewport height */
    height: auto; /* Adjust height to auto for natural expansion */
    min-height: 600px; /* Minimum height to ensure container visibility */
    margin: 2% auto; /* Add some margin at the top and bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 8px;
    background-color: #202124;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
}

.User {
    color: green;
}

.Assistant {
    color: red;
}

#thread-history {
    flex-grow: 1;
    min-height: 200px; /* or any other value that fits well in your layout */
    overflow-y: auto;
    margin: 20px 0; /* Add more vertical space */
    padding: 20px; /* Increase padding for spacing */
    border-radius: 8px;
    background: #333333;
}

#thread-history h3 {
    color: #aaa;
    margin-bottom: 20px; /* Add space below the title */
}

#messages-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#user-input {
    width: calc(100% - 20px); /* Subtract padding from width calculation */
    height: 50px;
    border: 1px solid #555; /* Add a border for definition */
    border-radius: 8px;
    padding: 10px;
    font-size: 16px;
    margin-top: 20px; /* Space between the input and the messages above */
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

#button-container {
    display: flex;
    justify-content: center; /* Centers the buttons horizontally */
    gap: 10px; /* Adds space between the buttons */
}

#send-btn, #new-thread-btn, #voice-input-btn {
    flex: 1; /* Each button will take up an equal amount of space */
    padding: 10px 20px; /* Adjust padding to your liking */
    margin: 10px 0; /* Retain the margin for spacing */
    border-radius: 8px; /* Retain the border-radius for rounded corners */
    background-color: #5c6bc0; /* Retain the background color */
    color: white; /* Retain the text color */
    font-size: 16px; /* Retain the font size */
    cursor: pointer; /* Retain the cursor style */
    transition: background-color 0.3s; /* Retain the transition for hover effect */
    width: auto; /* Make the button width dependent on the content */
    max-width: 200px; /* Set a maximum width for the buttons */
    display: inline-block; /* Allows the width to be as small as the content requires */
    margin: 10px auto; /* 'auto' for left and right margins centers the block-level elements */
    display: flex; /* Make the buttons block-level so 'auto' margins work for horizontal centering */
    justify-content: center;
    align-items: center;
}

#send-btn:hover, #new-thread-btn:hover, #voice-input-btn:hover {
    background-color: #3949ab; /* Retain the hover effect */
}

#thread-id {
    margin: 10px 0;
    color: #bbbbbb;
}

#logs {
    min-height: 50px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px; /* Space before the input field */
}

/* Adjustments for smaller screens */
@media (max-width: 768px) {
    #chat-container {
        width: 95%;
        min-height: 500px;
    }

    #user-input, #logs, #thread-history {
        width: calc(100% - 40px); /* Adjusting for padding */
    }
}

/* Loading animation styles */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  
  .loader {
    border: 2px solid #f3f3f3; /* Light grey, adjust as needed */
    border-top: 2px solid #3498db; /* Blue color, adjust as needed */
    border-radius: 50%;
    width: 16px; /* Adjust to fit within button */
    height: 16px; /* Adjust to fit within button */
    animation: spin 2s linear infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.voice-recording {
    animation: pulse 1s infinite;
}

input[type="file"]#file-input,
button,
#file-input-label {
    margin: 10px 0;
    padding: 10px 20px; /* Example padding, adjust as needed */
    font-size: 16px; /* Example font size, adjust as needed */
    line-height: 1.5; /* Adjust line height as needed */
    border: 2px solid transparent; /* Adjust or remove border as needed */
    border-radius: 8px;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-flex; /* Use flex to center content */
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
    vertical-align: middle; /* Aligns the element baseline */
    background-color: #5c6bc0;
    color: white;
}

input[type="file"]#file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

#file-input-label {
    margin-left: 10px; /* Space between this label and other elements */
    background-color: #FFC107; /* Example color, adjust as needed */
}

button:hover,
#file-input-label:hover {
    background-color: #3949ab; /* Darken button on hover */
}

/* Example classes for other buttons for consistency */
button {
    background-color: #5c6bc0;
    /* Rest of your button styles */
}

pre, code {
    background-color: #858585;
    border-radius: 4px;
    /* padding: 0.5em; */
    font-family: 'Courier New', Courier, monospace;
    white-space: pre-wrap; /* For <code> in case of long lines */
}

pre {
    padding: 1em;
    overflow-x: auto; /* For very long lines in code blocks */
}
