:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --background-color: #f9f9f9;
    --box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-color);
}

header {
    background-color: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

h1 {
    margin-bottom: 0.5rem;
}

.tagline {
    font-style: italic;
    opacity: 0.8;
}

main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

section {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
}

h2 {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.info {
    background-color: #e8f4f8;
    border-left: 4px solid var(--primary-color);
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

form {
    margin-bottom: 1rem;
}

#uploadForm {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
}

.file-input-wrapper label {
    background-color: #f0f0f0;
    color: #333;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: inline-block;
    transition: var(--transition);
}

.file-input-wrapper:hover label {
    background-color: #e0e0e0;
}

input[type="text"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

button:hover {
    background-color: #2980b9;
}

.content-box {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
    background-color: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

#fileContent, #chatHistory {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

#chatForm {
    display: flex;
    align-items: center;
    margin-top: 20px; /* Adjust as needed for spacing from the chatbox */
}

#userInput {
    flex: 1;
    padding: 10px;
    margin-right: 10px; /* Space between input and button */
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    height: 40px; /* Ensure consistent height */
}

#spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-left: 10px; /* Adjust as needed */
}

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

#sendButton {
    padding: 0 20px; /* Adjust padding to ensure consistent height */
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    box-sizing: border-box;
    height: 40px; /* Ensure consistent height */
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton:hover {
    background-color: #0056b3;
}

footer {
    text-align: center;
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
}

.spinner {
    display: none;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.status {
    margin-top: 10px;
    font-weight: bold;
}

.status.success {
    color: #2ecc71;
}

.status.error {
    color: #e74c3c;
}

.chat-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
}

.message {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}

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

.drop-zone {
    border: 2px dashed var(--primary-color);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    transition: background-color 0.3s ease;
}

.drop-zone.dragover {
    background-color: rgba(52, 152, 219, 0.1);
}

.drop-zone p {
    margin-bottom: 10px;
}

.message.you-message {
    background-color: #d1e7f8; /* Light blue background for User messages */
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.message.ai-message {
    background-color: #f0f0f0; /* Light grey background for AI messages */
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}