body, * {
	margin: 0;
	padding: 0;
	font-family: 'Menlo', 'Consolas', 'Mono', 'Monospace', 'Ubuntu Mono';
}
*:focus {
	outline: none;
}
body {
	display: flex;
	height: 100vh;
	overflow: hidden;
}
form input {
	display: block;
	margin-bottom: 5px;
}
button {
	width: 100%;
	padding: 10px;
	border: none;
	background-color: #007bff;
	color: white;
	border-radius: 5px;
	cursor: pointer;
	display: block;
}
button:hover {
	background-color: #0056b3;
}
.red-btn {
	background-color: #F23F42;
}
.red-btn:hover {
	background-color: #F54345;
}

#servers {
	width: 75px;
	flex-shrink: 0;
	border-right: 1px solid #dfdfdf;
	height: 100vh;
	text-align: center;
	overflow-y: auto;
}
.server {
	position: relative;
	display: inline-block;
}
.server img {
	width: 50px;
	cursor: pointer;
}
.server .unread {
	position: absolute;
	bottom: 5px;
	right: 5px;
	float: none;
}
#servers hr {
	height: 1px;
	border: none;
	color: #dfdfdf;
	background-color: #dfdfdf;
	margin-top: 3px;
}

#hidden_new_panel {
	visibility: hidden;
	position: absolute;
	bottom: 10px;
	left: 80px;
	font-size: 32px;
	border-radius: 5px;
	width: 250px;
	text-decoration: none;
	display: block;
	text-align: center;
	vertical-align: middle;
	z-index: 2;
	background-color: #1E1F22;
	padding: 10px;
}
#hidden_new_panel button {
	margin-bottom: 10px;
}

#chat_context_menu {
	display: none;
	position: fixed;
	background: white;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
	z-index: 1000;
	min-width: 200px;
}
#chat_context_menu hr {
	margin: 5px 0;
	border: none;
	border-top: 1px solid #ddd;
}
.context_menu_item {
	padding: 8px 15px;
	cursor: pointer;
	font-size: 13px;
}
.context_menu_item:hover {
	background-color: #e8e8e8;
}
.context_menu_item:first-child {
	border-radius: 5px 5px 0 0;
}
.context_menu_item:last-child {
	border-radius: 0 0 5px 5px;
}
.context_menu_danger {
	color: #dc3545;
}
.context_menu_danger:hover {
	background-color: #f8d7da;
}
#user_context_menu {
	display: none;
	position: fixed;
	background: white;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
	z-index: 1000;
	min-width: 200px;
}

#bottom_panel {
	position: absolute;
	bottom: 0;
	left: 0;
	background-color: #f5f5f5;
	width: 75px;
	padding: 5px 0;
}
#new_server {
	font-size: 32px;
	background-color: #c9dcf6;
	color: #536A89;
	cursor: pointer;
	border-radius: 35px;
	width: 50px;
	height: 50px;
	text-decoration: none;
	display: block;
	text-align: center;
	vertical-align: middle;
	margin: auto;
}

#chats, #online_users {
	width: 260px;
	flex-shrink: 0;
	border-right: 1px solid #dfdfdf;
	height: 100vh;
	overflow-y: auto;
	position: relative;
}
.unread {
	float: right;
	background-color: #F23F42;
	border-radius: 10px;
	color: white;
	font-weight: bold;
	width: 17px;
	font-size: 10px;
	line-height: 17px;
	text-align: center;
}
.logged_in {
	position: absolute;
	bottom: 5px;
	width: 260px;
	padding: 5px;
	box-sizing: border-box;
	background: inherit;
}
.logged_in img {
	width: 27px;
}
.logged_in b {
	position: relative;
	top: -7px;
	margin-left: 5px;
}
.user_settings_gear {
	float: right;
}
.user_settings_gear img {
	width: 24px;
}

.chat {
	font-weight: bold;
}
.chat, .online_user {
	padding: 5px;
	cursor: pointer;
	font-size: 14px;
}
.chat:hover {
	background-color: #eee;
}
.status-indicator {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-right: 6px;
	vertical-align: middle;
}
.status-indicator.online {
	background-color: #3BA55C;
}
.status-indicator.offline {
	background-color: #747F8D;
}

#chat {
	flex: 1;
	min-width: 0;
	border-right: 1px solid #dfdfdf;
	padding: 5px;
	font-size: 14px;
	height: 100vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-sizing: border-box;
	position: relative;
}

#server_title {
	font-size: 13px;
	font-weight: bold;
	border-bottom: 1px solid #dfdfdf;
	line-height: 50px;
	padding-left: 5px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
#server_title span {
	cursor: pointer;
}
#server_title img {
	width: 15px;
	position: relative;
	top: 3px;
}
#forum_toggle {
	cursor: pointer;
	opacity: 0.5;
	margin-right: 10px;
	transition: opacity 0.2s;
}
#forum_toggle:hover {
	opacity: 0.8;
}
#forum_toggle.active {
	opacity: 1;
}

#chat_title {
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: bold;
	flex-shrink: 0;
}
#chat_title_span {
	vertical-align: top;
}
.bridge_img {
	position: relative;
	top: -5px;
	left: -3px;
	width: 30px;
}

#messages {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
}

u {
	text-decoration: none;
	width: 100px;
	display: inline-block;
	text-align: right;
	color: #777;
	overflow-x: hidden;
	position: relative;
	top: 3px;
	word-wrap: normal;
	float: left;
	clear: both;
}
u.tg {
}
u.tg img {
	width: 15px;
	float: left;
}
.tg_msg {
	margin-left: 14px;
}

m {
	position: relative;
	display: block;
	padding-bottom: 5px;
	word-wrap: break-word;
	float: left;
	width: calc(100% - 115px);
	padding-top: 3px;
	padding-left: 5px;
}
m img {
	max-width: 100%;
}
t {
	color: #777;
	position: absolute;
	right: 0;
	bottom: 5px;
	display: none;
}

#new_msg {
	flex-shrink: 0;
	height: 40px;
	width: 100%;
	box-sizing: border-box;
}
.emote_pick_button {
	float: right;
	position: relative;
	top: -30px;
	width: 30px;
	cursor: pointer;
	z-index: 4;
}
#emote_picker {
	width: 300px;
	display: none;
	border: 1px solid #dfdfdf;
	position: absolute;
	bottom: 50px;
	right: 0;
	height: 300px;
	overflow-y: scroll;
	padding: 5px;
	background-color: white;
}
#emote_picker img {
	cursor: pointer;
}

#emote_autocomplete {
	display: none;
	position: absolute;
	bottom: 45px;
	left: 0;
	background: white;
	border: 1px solid #ccc;
	border-radius: 5px;
	box-shadow: 2px 2px 10px rgba(0,0,0,0.2);
	max-height: 200px;
	overflow-y: auto;
	z-index: 100;
	min-width: 200px;
}
#emote_autocomplete .emote_option {
	display: flex;
	align-items: center;
	padding: 5px 10px;
	cursor: pointer;
}
#emote_autocomplete .emote_option:hover,
#emote_autocomplete .emote_option.selected {
	background-color: #e8e8e8;
}
#emote_autocomplete .emote_option img {
	width: 24px;
	height: 24px;
	margin-right: 8px;
}
#emote_autocomplete .emote_option span {
	font-size: 13px;
}

textarea {
	width: 100%;
	height: 100%;
	font-size: 17px;
	padding: 5px;
	border: 0;
	resize: none;
	box-sizing: border-box;
}
textarea:active {
	border: 0;
}

::-webkit-scrollbar {
	-webkit-appearance: none;
	width: 7px;
}
::-webkit-scrollbar-thumb {
	border-radius: 4px;
	background-color: rgba(0, 0, 0, .5);
	box-shadow: 0 0 1px rgba(255, 255, 255, .5);
}

.emote {
	height: 100px;
}
.small-emote {
	height: 30px;
}

.letter_logo {
	font-size: 30px;
	text-align: center;
	color: #536A89;
	border: 1px solid #5D87BE;
	border-radius: 120px;
	height: 50px;
	width: 50px;
	margin: auto;
	background-color: #c9dcf6;
	text-decoration: none !important;
	line-height: 50px;
}
.letter_logo a {
	text-decoration: none;
}

.hr_date {
	margin-top: 10px;
	width: 100%;
	clear: both;
}
.msg_date, .msg_date_big {
	font-weight: bold;
	text-align: center;
	position: relative;
	top: -11px;
	background-color: white;
	width: 80px;
	margin: 0 auto;
	color: #333;
}
.msg_date_big {
	width: 110px !important;
}

pre {
	background-color: #eee;
	border: 1px solid #dfdfdf;
	padding: 5px;
}

input#search_text {
	padding: 5px;
	width: 96%;
	margin: 5px;
}
#mod_tools {
	margin-top: 30px;
	display: none;
}
#mod_tools button {
	margin-bottom: 10px;
	width: 90%;
	margin-left: 5%;
}

#hamburger_menu {
	display: none;
}

/* Friend Request Banner */
#friend_request_banner {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	background: linear-gradient(135deg, #5865F2 0%, #7289DA 100%);
	color: white;
	padding: 12px 20px;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: space-between;
	box-shadow: 0 2px 10px rgba(0,0,0,0.3);
	font-size: 14px;
}
#friend_request_text {
	flex: 1;
}
#friend_request_text b {
	font-weight: bold;
}
.friend_request_actions {
	display: flex;
	gap: 8px;
}
.friend_request_actions button {
	width: auto;
	padding: 6px 16px;
	font-size: 13px;
	border-radius: 4px;
	cursor: pointer;
}
.fr_accept {
	background-color: #3BA55C;
}
.fr_accept:hover {
	background-color: #2D8B4A;
}
.fr_deny {
	background-color: #ED4245;
}
.fr_deny:hover {
	background-color: #D63A3D;
}
.fr_close {
	background-color: transparent;
	border: 1px solid rgba(255,255,255,0.5);
	padding: 6px 10px;
}
.fr_close:hover {
	background-color: rgba(255,255,255,0.1);
}

/* Forum Mode */
#forum_pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-bottom: 1px solid #dfdfdf;
	background-color: #f9f9f9;
}
#messages + #forum_pagination {
	border-bottom: none;
	border-top: 1px solid #dfdfdf;
}
.pagination_info {
	font-size: 12px;
	color: #666;
	width: 100%;
	text-align: center;
	margin-bottom: 5px;
}
.pagination_controls {
	display: flex;
	align-items: center;
	gap: 3px;
	flex-wrap: wrap;
	justify-content: center;
}
.page_link {
	display: inline-block;
	padding: 4px 8px;
	font-size: 12px;
	color: #007bff;
	text-decoration: none;
	border: 1px solid #ddd;
	border-radius: 3px;
	background: white;
	cursor: pointer;
}
.page_link:hover {
	background-color: #e8e8e8;
}
.page_link.current {
	background-color: #007bff;
	color: white;
	border-color: #007bff;
}
.page_link.disabled {
	color: #999;
	cursor: not-allowed;
	background-color: #f5f5f5;
}
.page_ellipsis {
	padding: 4px 6px;
	color: #666;
}
.pagination_goto {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-left: 10px;
}
.pagination_goto input {
	width: 60px;
	padding: 4px;
	font-size: 12px;
	border: 1px solid #ddd;
	border-radius: 3px;
}
.pagination_goto button {
	width: auto;
	padding: 4px 10px;
	font-size: 12px;
}
/* Forum message styles */
.forum_msg {
	padding: 10px 5px;
	border-bottom: 1px solid #eee;
	clear: both;
}
.forum_msg:last-child {
	border-bottom: none;
}
.forum_msg_header {
	display: flex;
	justify-content: space-between;
	margin-bottom: 5px;
}
.forum_msg_user {
	font-weight: bold;
}
.forum_msg_time {
	color: #888;
	font-size: 12px;
}
.forum_msg_text {
	padding-left: 0;
	word-wrap: break-word;
}

/************************** MOBILE ********************/
@media screen and (max-width: 1000px) {

#dev_info {
	display: none !important;
}

#servers {
	width: 10%;
	max-width: 75px;
	min-width: 50px;
	height: 100vh;
}

#chats {
	width: 20%;
	height: 100vh;
}

#chat {
	flex: 1;
}

m {
	width: calc(100% - 115px);
}

#online_users {
	display: none;
}

#emote_picker {
	width: 300px;
	display: none;
	border: 1px solid #dfdfdf;
	position: absolute;
	bottom: 50px;
	height: 300px;
	right: 0;
	left: auto;
	overflow-y: scroll;
	padding: 5px;
}

/* Full mobile view - hide sidebars */
#chat {
	width: 100vw;
	height: 100vh;
	box-sizing: border-box;
	font-size: 1rem;
}

u {
	width: 4rem;
}

m {
	width: calc(100% - 5rem);
}

m img {
	max-width: 100%;
}

#msg_text {
	height: 5rem;
}

#new_msg {
	height: 5rem;
}

#servers, #chats, #bottom_panel {
	display: none;
}

#servers {
	width: 5rem;
}

#chats {
	width: calc(100vw - 5rem);
}

.chat {
	font-size: 1.2rem;
	line-height: 1.8rem;
}

#online_users {
	display: none;
}

#new_msg {
	width: 100%;
	box-sizing: border-box;
}

#new_msg textarea {
	width: 100%;
}

#chat_title {
	position: relative;
	background-color: #1E1F22;
	width: 100%;
	height: 40px;
	z-index: 1;
	font-size: 1.5rem;
	padding-left: 50px;
	padding-top: 9px;
	box-sizing: border-box;
	flex-shrink: 0;
}

#hamburger_menu {
	display: block;
	position: absolute;
	top: 0;
	left: 10px;
	color: white;
	z-index: 2;
	font-size: 2rem;
}

.emote_pick_button {
	position: absolute;
	right: 10px;
	float: none;
}

#emote_picker {
	width: 300px;
	border: 1px solid #dfdfdf;
	position: absolute;
	bottom: 80px;
	height: 300px;
	right: 10px;
}

#emote_autocomplete {
	bottom: 85px;
	left: 0;
	max-width: calc(100vw - 10px);
}

#friend_request_banner {
	flex-direction: column;
	gap: 10px;
	text-align: center;
}
.friend_request_actions {
	width: 100%;
	justify-content: center;
}

}

/* Voice call UI */
#call_overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.85);
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
}
#call_overlay_content {
	text-align: center;
	color: white;
}
#call_status_text {
	font-size: 24px;
	margin-bottom: 10px;
}
#call_timer {
	font-size: 18px;
	color: #aaa;
	margin-bottom: 30px;
	min-height: 24px;
}
#call_buttons {
	display: flex;
	gap: 15px;
	justify-content: center;
}
.call_btn {
	padding: 12px 28px;
	border: none;
	border-radius: 30px;
	font-size: 16px;
	cursor: pointer;
	color: white;
}
.call_hangup, .call_reject {
	background: #dc3545;
}
.call_hangup:hover, .call_reject:hover {
	background: #c82333;
}
.call_accept {
	background: #28a745;
}
.call_accept:hover {
	background: #218838;
}
.call_mute {
	background: #6c757d;
}
.call_mute:hover {
	background: #5a6268;
}
.call_mute.muted {
	background: #ffc107;
	color: #333;
}
#call_btn_header {
	position: absolute;
	right: 10px;
	top: 8px;
	cursor: pointer;
	opacity: 0.7;
	z-index: 2;
}
#call_btn_header:hover {
	opacity: 1;
}
/************************** MOBILE ********************/
