/* --- General --- */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: #121212;
    color: #e0e0e0;
}

/* --- Login page --- */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-btn {
    display: inline-block;
    padding: 15px 30px;
    margin-top: 20px;
    font-size: 1.2em;
    text-decoration: none;
    color: #fff;
    background: #4285f4;
    border-radius: 5px;
    transition: background 0.3s;

}
.login-btn:hover { background: #357ae8; }

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: #1f1f1f;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: #2a2a2a;
    color: #fff;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    position: relative;
}

.dm-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 12px;
    height: 12px;
    background: #ff3b3b;
    border-radius: 50%;
    display: inline-block;
    z-index: 2;
    box-shadow: 0 0 4px #ff3b3b;
}

/* --- Online Users Dropdown --- */
.online-users-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.online-users-dropdown {
    position: relative;
    display: inline-block;
    background: #222;
    color: #fff;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 1.05em;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: background 0.2s;
    z-index: 10;
}
.online-users-dropdown:hover { background: #2a2a2a; }
.online-users-list {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 110%;
    min-width: 220px;
    max-width: 320px;
    max-height: 260px;
    background: #1f1f1f;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    overflow-y: auto;
    padding: 8px 0;
    z-index: 20;
}
.online-users-dropdown:hover .online-users-list { display: block; }
.online-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 18px;
    font-size: 1em;
    color: #fff;
    cursor: default;
    border-bottom: 1px solid #222;
}
.online-user-item:last-child { border-bottom: none; }
.online-user-pfp {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    background: #333;
}
.online-user-name { font-weight: 500; color: #fff; }

/* Profile dropdown */
.profile-dropdown { position: relative; display: inline-block; cursor: pointer; }
.profile-pfp {
    width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid #fff;
}
.dropdown-content {
    display: none; position: absolute; right: 0; background-color: #1f1f1f; min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3); border-radius: 5px; z-index: 1; flex-direction: column; overflow: hidden;
}
.dropdown-content a, .dropdown-content button {
    color: #fff; padding: 10px 15px; text-decoration: none; display: block; width: 100%;
    text-align: left; background: none; border: none; cursor: pointer; font-size: 0.95em;
}
.dropdown-content a:hover, .dropdown-content button:hover { background-color: #2a2a2a; }
.profile-dropdown:hover .dropdown-content { display: flex; }

/* --- Messages --- */
.messages {
    border: 1px solid #333;
    margin: 20px auto;
    padding: 10px;
    width: 80%;
    height: 60vh;
    overflow-y: auto;
    background: #1e1e1e;
    color: #e0e0e0;
    border-radius: 8px;
}

/* --- Message form --- */
.message-form {
    display: flex; justify-content: center; margin: 0 auto 20px; width: 80%;
}
.message-form input {
    flex: 1; padding: 10px; font-size: 1em; border: 1px solid #444; border-radius: 6px 0 0 6px;
    background: #222; color: #e0e0e0;
}
.message-form textarea {
    flex: 1;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #444;
    border-radius: 6px 0 0 6px;
    background: #222;
    color: #e0e0e0;
    min-height: 38px;
    max-height: 120px;
    resize: none;
    box-sizing: border-box;
    overflow-y: auto;
}

.message-form button {
    padding: 10px 20px;
    font-size: 1em;
    background: #4285f4;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 0 6px 6px 0;
    font-weight: 500;
    transition: background 0.2s;
}
#message-send-btn {
    background: #4285f4;
    color: #fff;
}
#message-send-btn:hover {
    background: #357ae8;
}

.message-card {
    display: flex; align-items: flex-start; gap: 10px; background: #2a2a2a; border-radius: 10px;
    padding: 10px; margin-bottom: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.message-pfp { width: 50px; height: 50px; border-radius: 12px; object-fit: cover; }
.message-content { flex: 1; }
.message-header { display: flex; justify-content: space-between; font-weight: bold; color: #fff; }
.message-user { font-size: 1.1em; }
.message-time { font-size: 0.8em; color: #aaa; }
.message-text { margin-top: 5px; font-size: 1em; color: #e0e0e0; }

/* --- DM Sidebar --- */
.dm-sidebar {
    position: fixed;
    top: 56px; /* header height-ish */
    left: 0;
    width: 280px;
    height: calc(100vh - 56px);
    background: #181818;
    border-right: 1px solid #2a2a2a;
    padding: 10px;
    overflow-y: auto;
    z-index: 99;
}
.hidden { display: none; }
.dm-search-wrap { position: relative; }
.dm-search-wrap input {
    width: 90%;
    max-width: 220px;
    margin: 18px auto 0 auto;
    display: block;
    padding: 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: #222;
    color: #eee;
}
.dm-search-results {
    position: absolute; top: 38px; left: 0; right: 0; background: #1f1f1f; border: 1px solid #333;
    border-radius: 6px; max-height: 240px; overflow-y: auto; display: none; z-index: 3;
}
.dm-search-results.show { display: block; }
.dm-search-results div { padding: 8px 10px; cursor: pointer; }
.dm-search-results div:hover { background: #2a2a2a; }

.dm-list-title { margin: 12px 4px; font-size: 0.95em; color: #bbb; }
.dm-threads { display: flex; flex-direction: column; gap: 4px; }
.dm-thread {
    display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; background: #202020; cursor: pointer;
}
.dm-thread:hover { background: #262626; }
.dm-thread img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.dm-thread .dm-name { font-weight: 600; }
.dm-thread .dm-unread { margin-left: auto; color: #ffeb3b; font-weight: 700; }

/* --- DM Panel --- */
.dm-panel { width: 80%; margin: 0 auto 20px; }
.dm-panel.hidden { display: none; }
.dm-panel-header { display: flex; align-items: center; gap: 8px; }
.dm-header { margin: 0; }
.dm-close {
    background: #2a2a2a; color: #fff; border: 1px solid #333; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}

/* --- Admin Panel --- */
.admin-container {
    margin: 40px auto;
    width: 90%;
    background: #181818;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #222;
    color: #eee;
}
.admin-table th, .admin-table td {
    padding: 10px 14px;
    border: 1px solid #333;
}
.admin-table th {
    background: #333;
    color: #fff;
}
.admin-table tr:nth-child(even) {
    background: #252525;
}
.admin-table button {
    background: #f44336;
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
}
.admin-table button:hover {
    background: #c62828;
}

