
:root {
    --bg-sidebar: #171717;
    --bg-main: #212121;
    --bg-input: #2f2f2f;
    --bg-user-bubble: #2f2f2f;
    --text-primary: #ececf1;
    --text-secondary: #b4b4b4;
    --border-color: rgba(255, 255, 255, 0.1);
    --accent-green: #10a37f;
    --sidebar-width: 260px;
}

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

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

.app-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    padding: 12px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.new-chat-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    margin-bottom: 20px;
}

.new-chat-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.chat-history {
    flex: 1;
    overflow-y: auto;
}

.history-group {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 10px 12px;
    font-weight: 600;
}

.history-item {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.history-item.active {
    background-color: #212121;
}

.sidebar-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.avatar-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-avatar {
    background: #5436da;
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.mobile-nav {
    display: none;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
}

.mobile-title {
    font-weight: 500;
}

.mobile-nav button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
}

/* Welcome Screen */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-width: 800px;
    width: 100%;
    padding: 0 20px;
    text-align: center;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: white;
    color: black;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 24px;
}

.welcome-screen h1 {
    font-size: 24px;
    margin-bottom: 40px;
    font-weight: 600;
}

.suggestion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
}

.suggestion-card {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.suggestion-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.suggestion-card strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
}

.suggestion-card span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Messages */
.message-row {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.message-inner {
    max-width: 768px;
    width: 100%;
    display: flex;
    gap: 16px;
    padding: 0 20px;
}

.user-row {
    justify-content: flex-end;
}

.user-row .message-inner {
    justify-content: flex-end;
}

.user-bubble {
    background-color: var(--bg-user-bubble);
    padding: 10px 16px;
    border-radius: 20px;
    max-width: 85%;
    line-height: 1.5;
    font-size: 16px;
}

.bot-icon {
    width: 30px;
    height: 30px;
    background: var(--accent-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

.bot-content {
    flex: 1;
    line-height: 1.6;
    font-size: 16px;
    color: var(--text-primary);
    overflow-wrap: break-word;
}

.bot-content p {
    margin-bottom: 1em;
}

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

.bot-content pre {
    background: #000;
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
    overflow-x: auto;
}

.bot-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

/* Input Area */
.input-wrapper {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(180deg, rgba(33, 33, 33, 0), var(--bg-main) 50%);
}

.input-box-container {
    max-width: 768px;
    width: 100%;
    background: var(--bg-input);
    border-radius: 24px;
    padding: 10px 14px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 16px;
    outline: none;
    resize: none;
    max-height: 200px;
    padding: 8px 4px;
    font-family: inherit;
}

#send-btn {
    background: white;
    color: black;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

#send-btn:disabled {
    background: #676767;
    color: #2f2f2f;
    cursor: default;
}

.input-footer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .mobile-nav {
        display: flex;
    }
    .suggestion-grid {
        grid-template-columns: 1fr;
    }
}
