/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    height: 100%;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 600px;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

header {
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    text-align: center;
}

#chat-container {
    height: 300px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.message {
    padding: 10px;
    margin: 10px 0;
    border-radius: 5px;
    max-width: 60%; /* Limits message width */
    word-wrap: break-word;
}

.assistant-message {
    /* Styles for assistant messages */
    background-color: #778899;
    color: #ffffff;
    align-self: flex-start; /* Aligns assistant messages to the left */
}

.user-message {
    /* Styles for user messages */
    background-color: #4682B4;
    color: #ffffff;
    align-self: flex-end; /* Aligns user messages to the right */
}

/* Adjustments to ensure .loading inherits assistant-message alignment */
.loading {
    /* Ensure loading dots align with assistant messages */
    display: flex;
    justify-content: flex-start; /* Aligns loading indicator to the left */
}


#user-input {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-top: 10px;
    outline: none;
    background: rgba(255, 255, 255, 0.5);
    color: #000;
}

#user-input::placeholder {
    color: #eee;
}

.loading .dot {
    height: 8px;
    width: 8px;
    margin: 0 4px;
    background-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: dotFlashing 1s infinite linear alternate;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.25s; }
.dot:nth-child(3) { animation-delay: 0.5s; }

@keyframes dotFlashing {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}