:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-card: #0f3460;
    --accent: #D35400;
    --accent-light: #e67e22;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-dark: #1a1a2e;
    --bubble-user: #D35400;
    --bubble-bot: #0f3460;
    --border: #2a2a4a;
    --error: #e74c3c;
    --success: #2ecc71;
}

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

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

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 1rem;
}

.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-card h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.login-card .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; }

.input-group { margin-bottom: 1rem; }

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

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

.btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.btn:hover { background: var(--accent-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.error-msg {
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

.otp-section { display: none; }
.otp-section.active { display: block; }

.chat-layout { display: flex; height: 100vh; }

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 { font-size: 1.1rem; }

.toggle-sidebar {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message {
    max-width: 75%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 0.95rem;
}

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

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

.chat-input {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

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

.chat-input button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    padding: 1rem;
    overflow-y: auto;
    transition: width 0.2s;
}

.sidebar.collapsed { width: 0; padding: 0; overflow: hidden; }

.sidebar h3 { font-size: 0.95rem; color: var(--accent); margin-bottom: 0.75rem; }

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.stat-value { color: var(--accent); font-weight: 600; }

.weak-list { list-style: none; margin-top: 0.5rem; }
.weak-list li { padding: 0.3rem 0; font-size: 0.85rem; color: var(--text-secondary); }

.typing-indicator {
    align-self: flex-start;
    padding: 0.6rem 0.9rem;
    background: var(--bubble-bot);
    border-radius: 12px;
    color: var(--text-secondary);
    font-style: italic;
    display: none;
}

@media (max-width: 768px) {
    .sidebar { position: fixed; right: 0; top: 0; height: 100vh; z-index: 10; }
    .sidebar.collapsed { width: 0; }
    .message { max-width: 85%; }
}
