/* Add these styles to your existing style.css */

body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 95vh;
}

#chat-container {
    width: 100%;
    max-width: 600px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 80vh; /* Adjusted height slightly */
}

h1 {
    text-align: center;
    color: #333;
    padding: 15px;
    margin: 0;
    border-bottom: 1px solid #eee;
    font-size: 1.2em;
}

#chat-box {
    flex-grow: 1; /* Takes available space */
    padding: 15px;
    overflow-y: auto; /* Enables scrolling */
    /* Removed border-bottom here, added below preview */
    display: flex;
    flex-direction: column;
}

.message {
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%;
    line-height: 1.4;
    word-wrap: break-word; /* Wrap long words */
}

.user-message {
    background-color: #007bff;
    color: white;
    align-self: flex-end; /* Aligns user messages to the right */
    border-bottom-right-radius: 5px;
}

.bot-message {
    background-color: #e9e9eb;
    color: #333;
    align-self: flex-start; /* Aligns bot messages to the left */
    border-bottom-left-radius: 5px;
}

.system-message {
    font-style: italic;
    color: #888;
    text-align: center;
    font-size: 0.9em;
}

/* --- New/Modified Styles --- */

#image-preview-area {
    padding: 5px 15px;
    font-size: 0.9em;
    color: #555;
    border-top: 1px solid #eee; /* Separator */
    border-bottom: 1px solid #eee; /* Separator */
    min-height: 25px; /* Ensure area is visible even when empty */
    display: flex; /* Added for alignment */
    align-items: center; /* Added for alignment */
    flex-wrap: wrap; /* Allow wrapping if needed */
}

.preview-item {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    padding: 3px 8px;
    border-radius: 10px;
    margin-right: 5px; /* Spacing between items if multiple previews needed */
}

.preview-item img {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    object-fit: cover;
    border-radius: 3px;
}

.remove-preview {
    margin-left: 5px;
    cursor: pointer;
    color: #888;
    font-weight: bold;
}
.remove-preview:hover {
    color: #333;
}


#input-area {
    display: flex;
    padding: 15px;
    align-items: center; /* Align items vertically */
}

.upload-button {
    padding: 8px 10px;
    margin-right: 8px;
    cursor: pointer;
    color: #555;
    font-size: 1.1em;
    border: 1px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px; /* Fixed width */
    height: 38px; /* Fixed height */
    box-sizing: border-box;
}
.upload-button:hover {
    background-color: #f0f0f0;
    color: #000;
}


#message-input {
    flex-grow: 1;
    padding: 10px 15px; /* Added more padding */
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 1em;
    height: 38px; /* Match button height */
    box-sizing: border-box;
}

#send-button {
    padding: 0 15px; /* Adjusted padding */
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
    height: 38px; /* Match input height */
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

#send-button:hover {
    background-color: #0056b3;
}

#send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
/* Add this keyframes rule to your style.css */
@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}

/* Style the thinking indicator message */
#thinking-indicator span {
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}

#thinking-indicator span:nth-child(1) { /* targeting dot1 */
    animation-delay: 0s;
}
#thinking-indicator span:nth-child(2) { /* targeting dot2 */
    animation-delay: 0.2s;
}
#thinking-indicator span:nth-child(3) { /* targeting dot3 */
    animation-delay: 0.4s;
}
/* Add these styles to your existing style.css */

/* ... (previous styles) ... */

#input-area {
    display: flex;
    padding: 15px;
    align-items: center; /* Align items vertically */
}

/* ... (styles for upload-button, message-input) ... */

#send-button {
    /* Existing styles */
    /* Make space if stop button is visible */
    /* margin-left: 5px; remove this if stop button is positioned differently */
}

/* Style for the new Stop Button */
.stop-button {
    padding: 0 15px;
    background-color: #dc3545; /* Red color */
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em; /* Slightly smaller */
    height: 38px;
    box-sizing: border-box;
    display: flex; /* Use flex to align icon and text */
    align-items: center;
    justify-content: center;
    margin: 0 8px; /* Add some margin */
    transition: background-color 0.2s;
}

.stop-button i {
    margin-right: 5px; /* Space between icon and text */
}


.stop-button:hover {
    background-color: #c82333; /* Darker red on hover */
}

/* Initially hidden - JS will toggle display */
/* #stop-button[style*="display: none"] is handled inline for initial state */


@keyframes blink {
    0% { opacity: 0.2; }
    20% { opacity: 1; }
    100% { opacity: 0.2; }
}
#thinking-indicator span {
    animation-duration: 1.4s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
}
#thinking-indicator span:nth-child(1) { animation-delay: 0s; }
#thinking-indicator span:nth-child(2) { animation-delay: 0.2s; }
#thinking-indicator span:nth-child(3) { animation-delay: 0.4s; }