:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #111316;
    --bg-tertiary: #1a1d24;
    --accent: #7c3aed;
    --accent-light: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #a0a8b9;
    --border-color: #2a2f38;
    --message-user: #1e1f2b;
    --message-ai: #1a1d24;
    --success: #10b981;
    --sidebar-width: 280px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* User info section */
.user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-info span {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-info #userId {
    color: var(--accent);
    font-weight: 600;
}

.user-info button {
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.user-info button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
}

.user-info button:active {
    transform: translateY(0);
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.new-chat-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
}

.conversation-item {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.conversation-item:hover {
    border-color: var(--accent);
}

.conversation-item.active {
    border-color: var(--accent);
    background: rgba(124, 58, 237, 0.1);
}

.conversation-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.conversation-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.model-indicator {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.model-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.model-badge {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 0.25rem;
    font-size: 0.625rem;
}

/* Chat Main */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

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

.chat-header-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.conversation-id {
    font-size: 0.625rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.model-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 2rem;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Messages */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.welcome-message {
    text-align: center;
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.welcome-message h3 {
    margin-bottom: 0.5rem;
}

.welcome-message p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.features {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.features span {
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    font-size: 0.75rem;
}

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

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

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

.message-content {
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    position: relative;
}

.message.user .message-content {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.message.ai .message-content {
    background: var(--bg-tertiary);
    border-bottom-left-radius: 0.25rem;
}

.message-timestamp {
    font-size: 0.625rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    padding-left: 0.5rem;
}

.message-model {
    font-size: 0.625rem;
    color: var(--accent-light);
    margin-top: 0.25rem;
    padding-left: 0.5rem;
}

/* Input Area */
.input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 1rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
}

.input-wrapper textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    resize: none;
    outline: none;
}

.input-wrapper textarea::placeholder {
    color: var(--text-secondary);
}

.input-wrapper button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--accent);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-wrapper button:hover {
    background: var(--accent-light);
    transform: scale(0.95);
}

.input-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 0.5rem;
    padding: 0 0.5rem;
}

.shortcut {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

/* Loading */
.typing-indicator {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
}

.typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-4px); opacity: 1; }
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}