/* Basic Reset and Body Styling */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 20px;
}

/* New Two-Column App Container */
.app-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 95vh;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Left Column: Chat Container */
.chat-container {
    width: 40%;
    min-width: 400px;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

/* Right Column: Video Container */
.video-container {
    width: 60%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #1c1c1e; /* Dark background for video */
}

.video-stage {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-placeholder {
    text-align: center;
    color: #888;
}

.video-placeholder h3 {
    margin-bottom: 10px;
}

#video-stage video {
    width: 100%;
    height: auto;
    max-height: 100%;
    border-radius: 6px;
}

/* Chat History Box (no major changes) */
.chat-box {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 90%;
    line-height: 1.5;
    word-wrap: break-word;
}

.user-message {
    background-color: #007bff;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.bot-message {
    background-color: #e9ecef;
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.bot-message.loading p {
    font-style: italic;
    color: #666;
}

/* Sources Section Styling (no major changes) */
.sources-container {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

.sources-title {
    font-size: 0.9em;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.source-item {
    font-size: 0.85em;
    background-color: #f8f9fa;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.source-item:hover {
    background-color: #e2e6ea;
}

.source-item .chapter {
    font-weight: bold;
}

/* Chat Input Area (no major changes) */
.chat-input-area {
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

.chat-form {
    display: flex;
}

#user-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 1em;
}

#user-input:focus {
    outline: none;
    border-color: #007bff;
}

.chat-form button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s;
}

.chat-form button:hover {
    background-color: #0056b3;
}