/* General Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

header h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 2rem;
}

/* Layout */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.video-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.panel {
    background: #fdfdfd;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.panel h2 {
    margin-top: 0;
    color: #34495e;
}

#userVideo, #aiVisual {
    width: 100%;
    height: auto;
    border-radius: 6px;
    background-color: #000;
}

/* ================================================= */
/* === UPDATED CHAT STYLES FOR BUBBLE APPEARANCE === */
/* ================================================= */

.conversation-panel {
    padding: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chat-log {
    height: 250px; /* Adjusted height slightly */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1rem;
    background-color: #fff;
    /* This is the key: Use Flexbox to align chat bubbles */
    display: flex;
    flex-direction: column;
    gap: 10px; /* Adds space between messages */
}

/* Base style for ALL message bubbles */
.message {
    padding: 10px 15px;
    border-radius: 18px; /* Rounded corners */
    max-width: 75%; /* Bubbles don't take the full width */
    word-wrap: break-word; /* Prevents long words from overflowing */
    line-height: 1.4;
}

/* Style for the AI's messages */
.ai-message {
    background-color: #E9E9EB; /* Light gray background */
    color: #000;
    align-self: flex-start; /* Aligns this bubble to the LEFT */
    border-top-left-radius: 4px; /* Makes the corner look like a chat bubble */
}

/* Style for the User's messages */
.user-message {
    background-color: #007AFF; /* Blue background */
    color: white;
    align-self: flex-end; /* Aligns this bubble to the RIGHT */
    border-top-right-radius: 4px; /* Makes the corner look like a chat bubble */
}

/* Controls */
.controls-panel, #setup {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

input[type="file"], textarea, button {
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #ccc;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

button {
    cursor: pointer;
    background-color: #2980b9;
    color: white;
    border: none;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #3498db;
}

#recordButton.recording {
    background-color: #c0392b;
}
#recordButton.recording:hover {
    background-color: #e74c3c;
}