/*body {
	background-color: black;
	color: aliceblue;
}*/
#chat-box {
	background-color: black;
	display: flex;
	width: 600px;
	height: 600px;
	border: 1px solid #0c4af5;
	position: fixed;
	bottom: 25px;
	right: 5px;

	font-size: 16px;
	color: aliceblue;
	z-index: 5;
}

.fa-envelope {
	position: fixed;
	bottom: 2px;
	right: 5px;
	font-size: 24px;
}

.fa-envelope:hover {
	cursor: pointer;
}

.fa-envelope-open {
	position: fixed;
	bottom: 4px;
	right: 5px;
	font-size: 24px;
}

#message-section {
	width: 70%;
	border-left: 1px solid #0c4af5;
}

#chats-section {
	width: 30%;
}

#new-message-box {
	display: flex;
	height: 10%;
	align-items: center;
	justify-content: center;
	border-top: 1px solid #0c4af5;
}

#chat-search {
	height: 10%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-bottom: 1px solid #0c4af5;
}

#current-chats {
	height: 90%;
	/*overflow-y: scroll;*/
	overflow-y: overlay;
	scrollbar-color: grey #212121;
}

#chat-user-search {
	height: 10%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #0c4af5;

}

#messages {
	height: 80%;
	display: flex;
	flex-direction: column;
	overflow-y: scroll;
	scrollbar-color: grey black;
	position: relative;
}

input[name="chat-search"] {
	text-align: center;
	border: 1px solid #3471eb;
	background-color: black;
	height: 50%;
	border-radius: 15px;
	color: aliceblue;
	margin: 5px;
	width: 70%;
	height: 25px;
}

input[name="chat-search"]:focus, input[name="chat-user-search"]:focus, input[name="new-message-box"]:focus {
	outline: none;
}

input[name="chat-user-search"] {
	text-align: center;
	border-bottom: 1px solid #44D62C;
	border-right: 0px;
	border-left: 0px;
	border-top: 0px;
	background-color: black;
	height: 35%;
	/*border-radius: 15px;*/
	margin-right: 5px;
	color: aliceblue;
}

input[name="new-message-box"] {
	border: 1px solid #44D62C;
	background-color: black;
	height: 50%;
	border-radius: 15px;
	color: aliceblue;
	width: 82%;
	margin-left: 1%;
	margin-right: 1%;
	padding-left: 14px;
}

#send-message-button {
	background-color: #3471eb;
	height: 50%;
	/*border-radius: 15px;*/
	color: aliceblue;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	width: 15%;
	margin-right: 1%;
}

.current-chat {
	height: 15%;
	border-bottom: 1px solid #0c4af5;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	color: #c7c5c5;
	font-size: 12px;
	position: relative;
}
.current-chat:hover {
	cursor: pointer;
	color: aliceblue;
}

.message {
	/*color: #c7c5c5;
	border: 1px solid #34c3eb;*/
	border-radius: 15px;
	padding: 5px 10px;
	/*margin: 5px;*/
	display: inline-block;
	width: fit-content;
	max-width: 80%;
	word-wrap: break-word;
}

.full-message {
	margin: 12px;
	display: flex;
	flex-direction: column;
}

.time-sent, .sender {
	font-size: 12px;
	display: inline-block;
	width: fit-content;
}

.sent {
	margin-left: auto;
}

.message.sent {
	background-color: #2CFF05;
	color: black;
}

.received {
	margin-right: auto;
}

.message.received {
	background-color: #3b3a3a;
	color: white;
}

#chat-name {
	margin: 5px;
	height: 2em;
	line-height: 1;
	display: flex;
	align-items: center;
	overflow-y: overlay;
	scrollbar-color: grey black;
}

#create-new-chat {
	margin-right: 5px;
	/*width: 23px;
	height: 23px;
	border: 1px solid #44D62C;*/
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	line-height: 1;
	/*font-size: 16px;
	color: grey;*/
	font-size: 18px;
	color: black;
	background-color: #21d35d;
	height: 21.5px;
	width: 21.5px;
}

#create-new-chat:hover {
	cursor: pointer;
	color: aliceblue;
}

#user-search-wrapper {
	position: relative;
}

#chat-search-results {
	position: absolute;
	margin-right: 5px;
	width: calc(100% - 5px);
	z-index: 990;
}

#chat-search-results div {
	background-color: black;
	height: 20px;
	font-size: 16px;
	padding: 3px;
}

#chat-search-results div:hover {
	background-color: #34c3eb;
	color: aliceblue;
	cursor: pointer;
}

.selected-chat {
	background-color: #2d488a;
	color: aliceblue;
}

a.user-in-chat {
	text-decoration: underline;
}

.show {
	visibility: visible;
	/*display: block;*/
}

.hide {
	visibility: hidden;
	/*display: none;*/
}

.leave-chat-button {
	position: absolute; 
	left: 5px; 
	top: 5px; 
	color: grey; 
	font-size: 14px;
}

.leave-chat-button:hover {
	/*color: red;*/
	color:red;
	/*transform: scale(1.5);*/
}

.chat-content {
	width: 70%;
}

.latest-message-sender {
	font-style: italic;
}

.latest-message-content, .latest-message-sender, .latest-message-timestamp {
	overflow: hidden;
	height: 1em;
	line-height: 1;
	text-overflow: ellipsis;
	white-space: nowrap;
	width: 100%;
}

/*
#new-message-content {
    flex-grow: 1;
    margin-right: 10px;
    padding: 5px;
    border: 1px solid #0c4af5;
    border-radius: 5px;
    background-color: #1a1a1a;
    color: aliceblue;
}

#send-message-button {
    padding: 5px 10px;
    background-color: #0c4af5;
    color: aliceblue;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
*/

#send-message-button:hover {
    background-color: #0c4af5;
}

#confirm-add-user-button {
	position: absolute;
	left: -30px;
	top: 50%;
	transform: translateY(-50%);
	background-color: #21d35d;
	/*color: aliceblue;*/
	border: none;
	border-radius: 50%;
	width: 21.5px;
	height: 21.5px;
	font-size: 11px;
	cursor: pointer;
	display: none;
	padding-left: 0px;
	padding-right: 0px;
}

#confirm-add-user-button:hover {
	background-color: #00bb3f;
}

.confirm-leave-chat-button {
	padding: 10px 20px;
	background-color: #ff4d4d;
	color: white;
	border: none;
	border-radius: 5px;
	cursor: pointer;
	font-size: 12px;
}

.confirm-leave-chat-button:hover {
	background-color: rgb(219,0, 0);
}

div#chat-alert {
	position: absolute;
	z-index: 1000;
	font-size: 12px;
}

@media screen and (max-width: 768px) {
	#chat-box {	
		width: 95% !important;
		height: 95% !important;
	}

	.fa-envelope {
		z-index: 5 !important;
	}

	#send-message-button {
		font-size: 11px;
	}

	#user-search-wrapper {
		width: 40%;
	}

	#chat-user-input {
		width: 80%;
	}

	input[name="chat-search"] {
		font-size: 10px;
	}

	div#chat-alert {
		font-size: 12px;
	}
}