:root {
    --bg: #1e1e2e;
    --chat-bg: #252535;
    --accent: #6c5ce7;
    --text: #ffffff;
    --other-msg: #333;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    background: #2b2b3b;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.login-status {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
}

.user-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    flex: 1;
}

.user-item {
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.user-item:hover {
    background: #3a3a4a;
}

.user-item.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00ff88;
    margin-right: 10px;
}

.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--chat-bg);
}

.chat-header {
    padding: 16px 20px;
    background: #2b2b3b;
    font-weight: 600;
    border-bottom: 1px solid #333;
}

#messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    position: relative;
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
}

.msg-header {
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.msg-sender {
    color: #fff;
}

.msg-time {
    font-size: 0.75em;
    opacity: 0.7;
}

.msg-reply-to {
    font-size: 0.85em;
    color: #bbb;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.message.own {
    background: var(--accent);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.message.other {
    background: var(--other-msg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.replying-to {
    border-left: 3px solid var(--accent) !important;
}

.typing-indicator {
    font-size: 0.8em;
    color: #888;
    padding-left: 20px;
    margin-bottom: 5px;
    display: none;
}

.reply-indicator {
    padding: 8px 15px;
    background: #333;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    display: none;
    font-size: 0.9em;
}

.reply-indicator strong {
    color: var(--accent);
}

.reply-indicator .cancel-reply {
    float: right;
    cursor: pointer;
    font-size: 1.1em;
}

.input-area {
    padding: 15px 20px;
    background: #2b2b3b;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    gap: 10px;
}

textarea#message-input {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 20px;
    outline: none;
    background: #333;
    color: white;
    font-size: 1rem;
    resize: none;
    max-height: 100px;
}

textarea#message-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button {
    padding: 12px 24px;
    border: none;
    border-radius: 20px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    font-weight: bold;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.reply-menu {
    position: absolute;
    background: #2b2b3b;
    border: 1px solid #444;
    padding: 5px 0;
    min-width: 150px;
    z-index: 1000;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    min-width: 140px;
}

.reply-menu-item {
    padding: 8px 15px;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
}

.reply-menu-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.edit-option {
    color: #ff5252 !important;
}

.edit-option:hover {
    background: rgba(255, 82, 82, 0.2) !important;
}

.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: 100;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    color: black;
    width: 300px;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.conference-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    list-style: none;
}
.conference-item:hover {
    background: rgba(255,255,255,0.05);
}
.conference-item.active {
    background: rgba(74,144,226,0.2);
}

.delete-option {
    color: #ff4d4d !important;
}
.delete-option:hover {
    background: #4a1d1d !important;
    color: #fff !important;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #ccc;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f0f0f0;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    border-radius: 0;
    transition: 0.2s;
}

.auth-tab.active {
    background: #6c5ce7;
    color: #fff;
}

.auth-error {
    background: #ffe0e0;
    color: #c00;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.9em;
    text-align: center;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sidebar-header h3 {
    margin: 0;
}

#logout-btn {
    padding: 6px 14px;
    font-size: 13px;
    background: #e74c3c;
    border-radius: 6px;
    display: none;
}