/* static/style.css */
:root {
    --bg: #0a0a0d;
    --sidebar: #121218;
    --panel: #16161e;
    --border: #252530;
    --text: #f0f0f5;
    --text-muted: #a0a0b0;
    --accent: #4fc3f7;
    --accent-hover: #29b6f6;
    --user-msg: #1e3a5f;
    --bot-msg: #202028;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Боковая панель с ботами */
.sidebar {
    width: 220px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 16px 0;
}

.sidebar-header {
    padding: 0 16px 16px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.bot-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}

.bot-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    text-align: left;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.bot-item:hover {
    background: rgba(79, 195, 247, 0.08);
    color: var(--text);
}

.bot-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: rgba(79, 195, 247, 0.12);
}

/* Главная область чата */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--panel);
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 1.1rem;
    font-weight: 600;
}

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

.msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 10px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.msg.bot {
    background: var(--bot-msg);
    align-self: flex-start;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
}

.msg.user {
    background: var(--user-msg);
    color: white;
    align-self: flex-end;
    border-top-left-radius: 24px;
    border-bottom-left-radius: 24px;
}

.msg a {
    color: var(--accent);
    text-decoration: underline;
}

.text-link {
    color: var(--accent) !important;
    text-decoration: underline !important;
}

/* Inline-кнопки */
.inline-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.inline-btn,
.inline-callback-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.inline-btn:hover,
.inline-callback-btn:hover {
    background: rgba(79, 195, 247, 0.15);
    color: var(--accent);
    border-color: var(--accent);
}

.inline-btn {
    text-decoration: none;
    display: inline-block;
}

/* Панель ввода */
.chat-input {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    background: #1e1e28;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 1rem;
    outline: none;
}

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

.chat-input button {
    padding: 12px 24px;
    background: var(--accent);
    color: #0a0a0d;
    border: none;
    border-radius: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Стили для страницы входа */
.panel-login {
    max-width: 420px;
    margin: auto;
    background: var(--panel);
    padding: 32px;
    border-radius: 16px;
    border: 1px solid var(--border);
    margin-top: 10vh;
}

.panel-login h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--accent);
    font-weight: 600;
}

.panel-login label {
    display: block;
    margin: 16px 0 8px;
    color: var(--text-muted);
}

.panel-login input {
    width: 100%;
    padding: 12px 16px;
    background: #1e1e28;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 1rem;
}

.panel-login button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #0a0a0d;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.05rem;
}

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

.error {
    color: #ff5252;
    margin-top: 12px;
    text-align: center;
    font-size: 0.95rem;
}