:root {
    /* Color Palette */
    --primary-color: #4e6bff;
    --primary-dark: #3a56e0;
    --primary-light: rgba(78, 107, 255, 0.1);
    --secondary-color: #6c5ce7;
    --dark-color: #2d3436;
    --light-color: #f5f6fa;
    --success-color: #00b894;
    --success-dark: #00a884;
    --danger-color: #d63031;
    --danger-dark: #c0392b;
    --warning-color: #fdcb6e;
    --warning-dark: #fabd4a;
    --info-color: #0984e3;
    --info-dark: #0873c9;
    --gray-color: #dfe6e9;
    --gray-dark: #b2bec3;
    --dark-gray: #636e72;
    
    /* Light Theme */
    --bg-color: #f5f6fa;
    --text-color: #2d3436;
    --sidebar-bg: #ffffff;
    --message-bg: #ffffff;
    --message-text: #2d3436;
    --input-bg: #ffffff;
    --modal-bg: #ffffff;
    --chat-bg: #f9f9f9;
    --chat-header-bg: #ffffff;
    --message-input-bg: #ffffff;
    --border-color: #dfe6e9;
    --card-bg: #ffffff;
    --mod-menu-bg: #ffffff;
    --mod-menu-text: #2d3436;
    --scrollbar-track: #f1f1f1;
    --scrollbar-thumb: #c1c1c1;
}

/* Dark Theme */
body.dark-mode {
    --bg-color: #1a1a1a;
    --text-color: #f0f0f0;
    --sidebar-bg: #252525;
    --message-bg: #2d2d2d;
    --message-text: #f0f0f0;
    --input-bg: #333333;
    --modal-bg: #2d2d2d;
    --chat-bg: #1e1e1e;
    --chat-header-bg: #252525;
    --message-input-bg: #333333;
    --border-color: #444444;
    --card-bg: #2d2d2d;
    --mod-menu-bg: #333333;
    --mod-menu-text: #f0f0f0;
    --scrollbar-track: #2d2d2d;
    --scrollbar-thumb: #555555;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: var(--sidebar-bg);
    height: 100vh;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 1px 0 5px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 100;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.view {
    display: none;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.view.active {
    display: flex;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sidebar-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.profile-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.profile-info span {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-info small {
    color: var(--dark-gray);
    font-size: 0.8rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#edit-profile-btn {
    background: none;
    border: none;
    color: var(--dark-gray);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    padding: 0.5rem;
    margin: -0.5rem;
    border-radius: 50%;
}

#edit-profile-btn:hover {
    color: var(--primary-color);
    background: var(--primary-light);
    transform: rotate(90deg);
}

/* Search Box */
.search-box {
    padding: 1rem;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-color);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.search-box i {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Channels/Servers */
.channels {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.channels h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--dark-gray);
    margin-bottom: 1rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Server List */
#server-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

#server-list li {
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

#server-list li:hover {
    background: var(--primary-light);
}

#server-list li.active {
    background: rgba(78, 107, 255, 0.2);
    font-weight: 500;
}

#server-list li .server-avatar {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

#server-list li .server-info {
    flex: 1;
    overflow: hidden;
}

#server-list li .server-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* DM List */
#dm-list {
    list-style: none;
}

#dm-list li {
    padding: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 0.25rem;
}

#dm-list li:hover {
    background: var(--primary-light);
}

#dm-list li.active {
    background: rgba(78, 107, 255, 0.2);
    font-weight: 500;
}

#dm-list li .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

#dm-list li .user-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

#dm-list li .user-info .display-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

#dm-list li .user-info .username {
    font-size: 0.8rem;
    color: var(--dark-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .sidebar:not(.active) {
        transform: translateX(-100%);
    }
}

/* User Status Indicator */
.user-status {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    border: 2px solid var(--sidebar-bg);
    bottom: 10px;
    left: 28px;
}

.user-status.offline {
    background: var(--dark-gray);
}

.user-status.idle {
    background: var(--warning-color);
}

.user-status.dnd {
    background: var(--danger-color);
}

/* Chat Header */
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--chat-header-bg);
    display: flex;
    align-items: center;
    min-height: 72px;
}

.chat-header h2 {
    font-size: 1.25rem;
    font-weight: 500;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--chat-bg);
}

.loading-messages {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    color: var(--text-color);
    font-size: 0.9rem;
    gap: 0.5rem;
}

.loading-messages::after {
    content: "...";
    animation: dots 1.5s infinite steps(4, end);
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Add to your CSS file */
.message {
    transition: all 0.3s ease;
    position: relative;
}

.message.deleting {
    opacity: 0.5;
    background-color: rgba(255, 0, 0, 0.05);
    transform: translateX(-10px);
}

.message.deleted {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: all 0.5s ease;
}

.delete-message-btn {
  position: absolute;
  right: 15px;
  top: 5px;
  background: none;
  border: none;
  color: var(--dark-gray);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  padding: 10px;
  border-radius: 4px;
}


.message:hover .delete-message-btn {
    opacity: 1;
}

.deleted-message-notice {
    font-style: italic;
    color: var(--dark-gray);
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    margin-left: 2.25rem;
    font-size: 0.9rem;
}

.my-message .deleted-message-notice {
    margin-left: 0;
    margin-right: 2.25rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.message .message-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.message .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: bold;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.message .display-name {
    font-weight: 500;
    margin-right: 0.5rem;
    font-size: 0.95rem;
}

.message .timestamp {
    font-size: 0.75rem;
    color: var(--dark-gray);
    opacity: 0.8;
}

.message .message-content {
    margin-left: 2.25rem;
    padding: 0.75rem 1rem;
    background: var(--message-bg);
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: inline-block;
    max-width: 70%;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.my-message {
    text-align: right;
}

.message.my-message .message-header {
    justify-content: flex-end;
}

.message.my-message .message-content {
    background: var(--primary-color);
    color: white;
    border-radius: 12px 0 12px 12px;
    margin-left: 0;
    margin-right: 2.25rem;
    text-align: left;
}

/* Message Input */
.message-input {
    padding: 1rem;
    background: var(--message-input-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.message-input input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.message-input input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.emoji-picker-btn {
    color: var(--dark-gray);
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    padding: 0.5rem;
    border-radius: 50%;
    background: none;
    border: none;
}

.emoji-picker-btn:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

#send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

#send-btn i {
    font-size: 1.1rem;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 300px;
    background: var(--modal-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
    animation: fadeInUp 0.2s ease;
    border: 1px solid var(--border-color);
}

.emoji-picker.active {
    display: block;
}

.emoji-categories {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem;
    background: var(--card-bg);
    border-radius: 12px 12px 0 0;
}

.emoji-categories button {
    flex: 1;
    background: none;
    border: none;
    padding: 0.5rem;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    border-radius: 6px;
}

.emoji-categories button:hover, 
.emoji-categories button.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

.emoji-container {
    height: 250px;
    overflow-y: auto;
    padding: 0.75rem;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
}

.emoji-container span {
    font-size: 1.5rem;
    cursor: pointer;
    text-align: center;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1/1;
}

.emoji-container span:hover {
    background: var(--primary-light);
    transform: scale(1.2);
}

/* Moderation Panel */
.mod-menu {
    position: absolute;
    background: var(--mod-menu-bg);
    color: var(--mod-menu-text);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem;
    z-index: 1000;
    min-width: 250px;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.15s ease;
}

.mod-menu h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mod-menu h3 i {
    font-size: 1.1rem;
}

.mod-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    margin: 0.25rem 0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    gap: 0.75rem;
}

.mod-btn i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.mod-btn.ban-btn {
    background: var(--danger-color);
    color: white;
}

.mod-btn.ban-btn:hover {
    background: var(--danger-dark);
    transform: translateY(-2px);
}

.mod-btn.mute-btn {
    background: var(--warning-color);
    color: var(--dark-color);
}

.mod-btn.mute-btn:hover {
    background: var(--warning-dark);
    transform: translateY(-2px);
}

.mod-btn.delete-msg-btn {
    background: var(--info-color);
    color: white;
}

.mod-btn.delete-msg-btn:hover {
    background: var(--info-dark);
    transform: translateY(-2px);
}

.mod-duration-picker {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.mod-duration-picker label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
}

.mod-duration-picker input {
    width: 100%;
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 0.9rem;
}

.mod-duration-picker input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.mod-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.mod-actions button {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.mod-actions .confirm-btn {
    background: var(--success-color);
    color: white;
}

.mod-actions .confirm-btn:hover {
    background: var(--success-dark);
    transform: translateY(-2px);
}

.mod-actions .cancel-btn {
    background: var(--gray-color);
    color: var(--text-color);
}

.mod-actions .cancel-btn:hover {
    background: var(--gray-dark);
    transform: translateY(-2px);
}

/* User Badges */
.user-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    gap: 0.25rem;
    line-height: 1;
}
/* Add these to your CSS */
.beta-badge {
    color: #3498db;
    font-size: 0.8em;
    margin-left: 5px;
    background-color: rgba(52, 152, 219, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
}

.owner-badge {
    color: #f1c40f;
    font-size: 0.8em;
    margin-left: 5px;
    background-color: rgba(241, 196, 15, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
}

.message .beta-badge,
.message .owner-badge {
    font-size: 0.7em;
}
.user-badge.mod {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.6rem;
}

.user-badge.banned {
    background: var(--danger-color);
    color: white;
}

.user-badge.muted {
    background: var(--warning-color);
    color: var(--dark-color);
}

.mod-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(78, 107, 255, 0.15);
    color: var(--primary-color);
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-left: 0.5rem;
    gap: 0.25rem;
}

body.dark-mode .mod-badge {
    background: rgba(78, 107, 255, 0.3);
}

/* Auth View */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding: 2rem;
    background: var(--modal-bg);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.5s ease;
}

.auth-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.auth-form {
    display: none;
    animation: fadeIn 0.3s ease;
}

.auth-form.active {
    display: block;
}

.auth-form h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-color);
    font-weight: 500;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.btn-primary {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(78, 107, 255, 0.3);
}

/* Profile Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    animation: modalIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal h2 {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--dark-gray);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: none;
    border: none;
}

.close-modal:hover {
    color: var(--danger-color);
    background: rgba(214, 48, 49, 0.1);
}

.profile-form .form-group {
    margin-bottom: 1.5rem;
}

.profile-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.profile-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--input-bg);
    color: var(--text-color);
}

.profile-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.5rem;
    border: 1px solid var(--border-color);
}

/* Security Modal */
.security-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
}

.security-modal.active {
    display: flex;
}

.security-modal-content {
    background: var(--modal-bg);
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

.security-modal h2 {
    margin-bottom: 1rem;
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-modal p {
    margin-bottom: 1.5rem;
    color: var(--text-color);
    line-height: 1.5;
}

.password-change-form {
    margin-top: 1.5rem;
}

.password-change-form .form-group {
    margin-bottom: 1rem;
}

.password-change-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.password-change-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.password-change-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 107, 255, 0.2);
}

.password-change-btns {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.password-change-btns button {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.password-change-btns .btn-secondary {
    background: var(--gray-color);
    color: var(--text-color);
}

.password-change-btns .btn-secondary:hover {
    background: var(--gray-dark);
    transform: translateY(-2px);
}

.password-change-btns .btn-primary {
    background: var(--primary-color);
    color: white;
}

.password-change-btns .btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Settings */
.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-option:last-child {
    border-bottom: none;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
}

.theme-toggle-label {
    margin-right: 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
}

.theme-toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.theme-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-color);
    transition: .4s;
    border-radius: 34px;
}

.theme-toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .theme-toggle-slider {
    background-color: var(--primary-color);
}

input:checked + .theme-toggle-slider:before {
    transform: translateX(30px);
}

.logout-btn {
    background-color: var(--danger-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    justify-content: center;
}

.logout-btn:hover {
    background-color: var(--danger-dark);
    transform: translateY(-2px);
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    z-index: 101;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: none;
}

.mobile-menu-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        position: fixed;
        left: -280px;
        top: 0;
        height: 100vh;
        z-index: 100;
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(280px);
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .chat-header {
        padding-left: 4rem;
    }
    
    .message .message-content {
        max-width: 85%;
    }
    
    .emoji-picker {
        width: calc(100% - 2rem);
        left: 1rem;
        bottom: 70px;
    }
    
    .mod-menu {
        right: 1rem;
        left: auto;
        min-width: 200px;
    }
    
    #dm-list li .user-status {
        left: 24px;
        bottom: 8px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1.5rem;
        max-width: 90%;
    }
    
    .modal-content,
    .security-modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    
    .password-change-btns {
        flex-direction: column;
    }
    
    .password-change-btns button {
        width: 100%;
    }
}