:root {
    --primary-color: #3b82f6;
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --msg-user-bg: #3b82f6;
    --msg-bot-bg: #334155;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #94a3b8;
    font-size: 20px;
}

main {
    display: flex;
    flex: 1;
    gap: 16px;
    overflow: hidden;
}

.avatar-container {
    flex: 1;
    background-color: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

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

.placeholder-avatar {
    color: #475569;
    font-size: 14px;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-container {
    display: flex;
    flex-direction: column;
    background-color: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.messages-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    margin-bottom: 12px;
    line-height: 1.5;
    font-size: 15px;
    animation: slideIn 0.3s ease-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.message.bot {
    background-color: var(--msg-bot-bg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background-color: var(--msg-user-bg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.input-area {
    padding: 15px;
    border-top: 1px solid #334155;
    display: flex;
    gap: 10px;
}

input {
    flex: 1;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.message strong {
    font-weight: 600;
    color: #e2e8f0;
}

.message em {
    font-style: italic;
}

.message a {
    color: #60a5fa;
    text-decoration: underline;
}

.message a:hover {
    color: #93c5fd;
}

.message ul {
    margin: 8px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.message li {
    margin: 2px 0;
}

input:focus {
    border-color: var(--primary-color);
}

button {
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2563eb;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .chat-container {
        max-width: 100%;
        height: 50%;
    }

    .avatar-container {
        height: 50%;
    }
}

.status-bar {
    padding: 4px 20px;
    background-color: transparent;
    border: none;
    font-size: 9px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 4px;
    opacity: 0.7;
}

.status-bar.connected {
    color: #10b981;
}

.status-bar.error {
    color: #ef4444;
}

.status-bar.offline {
    color: #f59e0b;
}