/* General Body Styles */
body {
    font-family: 'Inter', sans-serif;
    background-image: url('../images/mainbackground.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #f0f2f5; /* Fallback color if image fails to load */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    color: #333;
}

/* Chat Container */
.chat-container {
    width: 100%;
    max-width: 600px;
    height: 90vh;
    max-height: 800px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #007bff;
    color: white;
    padding: 16px 24px;
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.chat-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

.chat-header p {
    margin: 4px 0 0;
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Messages Area */
.chat-messages {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background-image: url('../images/botbackground.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Fallback color in case the image doesn't load */
    background-color: #ffffff;
}

/* Individual Message Styles */
.message {
    display: flex;
    max-width: 80%;
}

.message p {
    margin: 0;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Bot Message Styles */
.bot-message {
    align-self: flex-start;
}

.bot-message p {
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* User Message Styles (assuming a .user-message class will be added by JS) */
.user-message {
    align-self: flex-end;
}

.user-message p {
    background-color: #007bff;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.typing-indicator p {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 16px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    background-color: #868e96;
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.3s infinite;
}

.typing-indicator span:nth-of-type(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-of-type(3) {
    animation-delay: 0.3s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

/* Chat Input Area */
.chat-input-area {
    display: flex;
    align-items: flex-end; /* Align items to the bottom */
    padding: 12px 16px;
    border-top: 1px solid #ddd;
    background-color: #f8f9fa;
    flex-shrink: 0;
    gap: 8px;
}

/* Attachment button */
.input-action-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #5f6368;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    margin-bottom: 5px; /* Align with textarea */
}

.input-action-btn:hover {
    background-color: #e9ecef;
    color: #007bff;
}

/* Textarea for user input */
#user-input { /* Changed from input to textarea */
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
    resize: none; /* Disable manual resizing */
    line-height: 1.4;
    max-height: 120px; /* Limit height to prevent breaking layout */
    overflow-y: auto; /* Add scrollbar if max-height is reached */
}

#user-input:focus {
    border-color: #007bff;
}

#send-btn {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    align-self: flex-end; /* Keep button at the bottom */
}

#send-btn:hover {
    background-color: #0056b3;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
