/* Global Reset */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: #ffffff; /* Changed to white for cleaner full screen look */
    color: #333;
}

/* Layout Container - Full Screen */
.main-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    flex-direction: column;
}

/* Chat Header Bar */
.chat-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    background-color: #ffffff;
    color: #1f2937;
    z-index: 10;
}

/* Chat Area (Right) */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    position: relative;
    max-width: 1000px; /* Max width for readability on large screens */
    margin: 0 auto;
    width: 100%;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

.message-row {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
}

.message-row.user {
    justify-content: flex-end;
}

.message-row.bot {
    justify-content: flex-start;
}

.avatar-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-top: 4px;
}

.message-row.bot .avatar-icon {
    margin-right: 12px;
    background-color: #e0f2fe; /* Light blue bg for bot avatar */
    color: #0284c7;
}

.message-row.user .avatar-icon {
    margin-left: 12px;
    background-color: #e5e7eb; /* Gray for user */
    color: #6b7280;
    order: 2; /* Move to right */
}

.message-bubble {
    max-width: 70%;
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 1rem; /* Slightly larger font */
    line-height: 1.6;
    position: relative;
    white-space: pre-wrap; /* Handle newlines correctly */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    word-wrap: break-word;
}

.message-row.bot .message-bubble {
    background-color: #f3f4f6; /* Very light gray for bot */
    color: #1f2937;
    border-top-left-radius: 4px;
}

.message-row.user .message-bubble {
    background-color: #0ea5e9; /* Modern blue */
    color: white;
    border-top-right-radius: 4px;
    order: 1;
}

/* Input Area */
.input-container-wrapper {
    padding: 20px 40px 40px;
    background: transparent;
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.input-container {
    width: 100%;
    max-width: 800px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 24px; /* Rounder corners */
    padding: 12px 20px;
    display: flex;
    align-items: flex-end; 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.input-container:focus-within {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #0ea5e9;
}

.input-box {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 1rem;
    resize: none;
    max-height: 150px;
    padding: 8px 0;
    background: transparent;
    min-height: 24px;
    line-height: 1.5;
}

.send-btn {
    background-color: #0ea5e9;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* Circular button */
    margin-left: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

.send-btn:hover {
    background-color: #0284c7;
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Loading Animation - Improved */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background-color: #0ea5e9; /* Use theme blue */
    border-radius: 50%;
    opacity: 0.6;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Login Page Styles (kept for compatibility) */
.login-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    max-width: 400px;
    margin: 10vh auto; /* Center vertically roughly */
}

.login-container input {
    width: 80%;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.login-container button {
    padding: 10px 20px;
    background-color: #0ea5e9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
