body {
    background-color: #111b21;
    color: #e9edef;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 30%;
    min-width: 300px;
    max-width: 400px;
    background-color: #111b21;
    border-right: 1px solid #222d34;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    background-color: #202c33;
    padding: 10px 16px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    color: #e9edef;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#add-chat-btn {
    background: transparent;
    border: 1px solid #3e4c59;
    color: #aebac1;
    cursor: pointer;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 5px;
}

#add-chat-btn:hover {
    background-color: #2a3942;
    color: #e9edef;
}

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

.chat-list-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #222d34;
    display: flex;
    flex-direction: column;
}

.chat-list-item:hover {
    background-color: #202c33;
}

.chat-list-item.active {
    background-color: #2a3942;
}

.chat-list-title {
    font-size: 16px;
    margin-bottom: 4px;
    color: #e9edef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-meta {
    font-size: 13px;
    color: #8696a0;
}

/* Main Workspace */
.main-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #222d34;
}

.no-chat {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8696a0;
    font-size: 15px;
}

.chat-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    background-color: #202c33;
    padding: 10px 16px;
    height: 59px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    border-left: 1px solid #222d34;
}

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #e9edef;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

#btn-edit-title:hover {
    background-color: #2a3942;
    border-radius: 4px;
}

#btn-delete:hover, #btn-copy:hover {
    opacity: 0.8;
}

.chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: #2a3942;
    border-radius: 8px;
    padding-right: 8px;
    overflow: hidden;
}

.search-container input {
    background-color: transparent;
    border: none;
    color: #d1d7db;
    padding: 6px 12px;
    outline: none;
    font-size: 14px;
    width: 250px;
}

.search-badge {
    color: #8696a0;
    font-size: 12px;
    margin-right: 8px;
    min-width: 30px;
    text-align: center;
}

.search-arrows button {
    background: transparent;
    border: none;
    color: #8696a0;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
}

.search-arrows button:hover {
    color: #e9edef;
}

.chat-controls select {
    background-color: #2a3942;
    border: none;
    color: #d1d7db;
    padding: 6px 12px;
    border-radius: 8px;
    outline: none;
}

#btn-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

/* Chat Wall */
.chat-wall {
    flex: 1;
    background-color: #0b141a;
    background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.05) 1px, transparent 0);
    background-size: 20px 20px;
    padding: 20px 10%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Message Bubbles */
.system-message {
    background-color: #182229;
    color: #ffd279;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
    text-align: center;
    margin: 10px auto;
    max-width: 80%;
}

.msg-row {
    display: flex;
    width: 100%;
    margin-bottom: 8px;
}

.msg-left {
    justify-content: flex-start;
}

.msg-right {
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 65%;
    padding: 6px 7px 8px 9px;
    border-radius: 7.5px;
    position: relative;
    box-shadow: 0 1px 0.5px rgba(11,20,26,.13);
    font-size: 14.2px;
    line-height: 19px;
    color: #e9edef;
    display: flex;
    flex-direction: column;
}

.msg-left .msg-bubble {
    background-color: #202c33;
    border-top-left-radius: 0;
}

.msg-right .msg-bubble {
    background-color: #005c4b;
    border-top-right-radius: 0;
}

.msg-author {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.msg-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-meta {
    font-size: 11px;
    color: #8696a0;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
    margin-left: 20px;
}

.msg-right .msg-meta {
    color: rgba(255, 255, 255, 0.6);
}

/* Scrollbar tweaks */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

mark.highlight {
    background-color: #ffe600;
    color: #000;
    border-radius: 2px;
    padding: 0 2px;
}

mark.highlight.active {
    background-color: #ff9900;
    color: #fff;
}
