/* A lIe — Dark theme chat interface */

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

:root {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --accent: #c23b22;
    --accent-light: #e04a30;
    --user-bg: #2d4a2d;
    --border: #333;
    --input-bg: #1e1e1e;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

body {
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    padding: 16px 20px 8px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

header h1 {
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--text-primary);
    font-family: Georgia, "Times New Roman", serif;
}

header .lie {
    font-weight: 700;
}

header .tagline {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Disclaimer */
.disclaimer {
    text-align: center;
    padding: 8px 20px;
    background: rgba(200, 170, 0, 0.15);
    color: #e0c040;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

/* Chat area */
main#chat {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages */
.message {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.message.user {
    margin-left: auto;
    margin-right: auto;
}

.message.user .message-content {
    background: var(--user-bg);
    border-radius: 12px;
    padding: 12px 16px;
    margin-left: 60px;
}

.message.assistant .message-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px 20px;
    line-height: 1.6;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code {
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.message-content details {
    margin: 10px 0;
    border-radius: 8px;
    background: var(--bg-tertiary);
}

.message-content details summary {
    cursor: pointer;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    user-select: none;
}

.message-content details summary:hover {
    color: var(--text-primary);
}

.message-content details pre {
    margin: 0;
    border-radius: 0 0 8px 8px;
}

.message-content pre {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 10px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
}

/* Thinking animation */
.thinking {
    color: var(--text-secondary);
    font-style: italic;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Dashboard container */
.dashboard-container {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    max-width: 800px;
    width: 100%;
    overflow-x: auto;
    color: #333;
}

.dashboard-container svg {
    max-width: 100%;
    height: auto;
}

.vega-chart {
    margin: 8px 0;
}

.render-error {
    color: var(--accent);
    padding: 12px;
    font-size: 14px;
}

.error {
    color: var(--accent-light);
}

/* Input area */
footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

#chat-form {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.4;
    max-height: 200px;
}

#message-input:focus {
    border-color: var(--text-secondary);
}

#message-input::placeholder {
    color: var(--text-secondary);
}

#send-btn {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    flex-shrink: 0;
    transition: background 0.2s;
}

#send-btn:hover {
    background: var(--accent-light);
}

#send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Scrollbar */
main#chat::-webkit-scrollbar {
    width: 6px;
}

main#chat::-webkit-scrollbar-track {
    background: transparent;
}

main#chat::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 600px) {
    .message.user .message-content {
        margin-left: 20px;
    }

    header h1 {
        font-size: 22px;
    }
}
