:root {
    --bg-color: #1a1b26;
    --chat-bg: #24283b;
    --sidebar-bg: #1f2335;
    --text-color: #a9b1d6;
    --accent-color: #ffb366;
    --user-msg-bg: #414868;
    --troll-msg-bg: #292e42;
    --border-color: #565f89;
    --error-color: #f7768e;
}

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

body {
    font-family: 'JetBrains Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--chat-bg);
    padding: 30px;
    border-radius: 8px;
    width: 350px;
    border: 1px solid var(--accent-color);
    text-align: center;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
}

.tabs button {
    flex: 1;
    background: transparent;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
}

.tabs button.active {
    border-bottom-color: var(--accent-color);
    color: var(--accent-color);
}

.error-msg {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 10px;
}

/* Forms */
input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 4px;
}

/* Layout */
.main-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.user-stats p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.tasks-section ul {
    list-style: none;
    margin-top: 10px;
}

.tasks-section li {
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tasks-section li.completed {
    text-decoration: line-through;
    opacity: 0.5;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: none;
    border: none;
    border-radius: 0;
    height: 100%;
}

/* Chat styles reuse */
header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

h1 {
    color: var(--accent-color);
    margin-bottom: 5px;
}

#chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

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

.bubble {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.message.user .bubble {
    background-color: var(--user-msg-bg);
    color: #fff;
    border-bottom-right-radius: 0;
}

.message.troll .bubble {
    background-color: var(--troll-msg-bg);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-top-left-radius: 0;
}

.input-area {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

textarea {
    flex: 1;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    resize: none;
    height: 60px;
}

textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

button {
    background-color: var(--accent-color);
    color: var(--bg-color);
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background-color: #ff9933;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mobile responsiveness */
.mobile-menu-btn {
    display: none;
    position: absolute;
    left: 20px;
    top: 30px;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .main-layout {
        position: relative;
    }

    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        width: 80%;
        max-width: 320px;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }
}