:root {
    --bg-primary: #121214;
    --bg-secondary: #1C1C1F;
    --border-color: #2D2D32;
    --text-primary: #EDEDED;
    --text-secondary: #A0A0A5;
    
    --accent: #5E6AD2;
    --accent-hover: #737DF0;
    
    --c-red: #E05252;
    --c-yellow: #E0C852;
    --c-green: #52E07A;
    --c-blue: #5289E0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 320px;
    background: rgba(28, 28, 31, 0.5);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 28px;
}

.brand h1 {
    font-size: 20px;
    font-weight: 600;
}

.panel h3 {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Personality Bars */
.bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bar-label {
    width: 40px;
    font-size: 13px;
    color: var(--text-secondary);
}

.bar-bg {
    flex: 1;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 25%;
    transition: width 0.5s ease;
}
.bar-fill.red { background: var(--c-red); }
.bar-fill.yellow { background: var(--c-yellow); }
.bar-fill.green { background: var(--c-green); }
.bar-fill.blue { background: var(--c-blue); }

/* Mood */
.mood-indicator {
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-weight: 500;
}

/* Facts */
.facts-list {
    list-style: none;
}

.facts-list li {
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.check {
    font-size: 16px;
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at top right, rgba(94, 106, 210, 0.05), transparent 40%);
}

.chat-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 16px;
    font-weight: 500;
}

.status {
    font-size: 13px;
    color: var(--c-yellow);
}
.status.connected {
    color: var(--c-green);
}

.messages {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.message.buddy {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
}

.bubble {
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.message.buddy .bubble {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top-left-radius: 4px;
}

.message.user .bubble {
    background: var(--accent);
    color: white;
    border-top-right-radius: 4px;
}

.input-area {
    padding: 24px 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
}

input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

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

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

button:hover {
    background: var(--accent-hover);
}

/* Markdown specific styling in responses */
.bubble strong { font-weight: 600; color: white; }
.bubble ul { margin-left: 20px; margin-top: 8px; }
.bubble li { margin-bottom: 4px; }
