:root {
    --md-sys-color-primary: #8f7aff;
    --md-sys-color-surface: #121212;
    --md-sys-color-on-surface: #eaeaea;
    --md-sys-color-outline: #444;
    --bubble-user: #5b47d6;
    --bubble-bot: #2a2a2a;
    --button-disabled-bg: #333;
    --button-disabled-text: #777;
}

body {
    margin: 0;
    font-family: "Roboto", sans-serif;
    background: var(--md-sys-color-surface);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#chat-container {
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    background: #181818;
}

/* ---------- MESSAGES ---------- */
#messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.msg {
    padding: 12px 40px 16px 16px;
    margin-bottom: 12px;
    border-radius: 16px;
    max-width: 80%;
    position: relative;
    white-space: pre-wrap;
    color: var(--md-sys-color-on-surface);
}

.user {
    background: var(--bubble-user);
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.bot {
    background: var(--bubble-bot);
    border-top-left-radius: 0;
}

.typing {
    background: var(--bubble-bot);
    color: #aaa;
    font-style: italic;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 16px;
    max-width: 50%;
}

/* ---------- COPY BUTTON ---------- */
.copy-button {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    color: #ddd;
}

/* ---------- ACTION BAR ---------- */
#action-bar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: #202020;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: var(--md-sys-color-primary);
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.action-btn.disabled {
    background: var(--button-disabled-bg);
    color: var(--button-disabled-text);
    cursor: not-allowed;
}

/* ---------- INPUT BAR ---------- */
#input-bar {
    padding: 12px;
    display: flex;
    gap: 10px;
    background: #202020;
    border-top: 1px solid #333;
    align-items: flex-end;
}

#text-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 12px;
    font-size: 16px;
    background: #111;
    color: #eee;
    resize: none;
    overflow: hidden;
    min-height: 50px;
    max-height: 30vh;
}

#send-btn {
    background: var(--md-sys-color-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    height: 50px;
}