:root {
	--messageSize: 0.9em;
}

#chatWrapper {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	gap: 10px;
	background-color: var(--mantle);
	border: solid 1px var(--crust);
	padding: 20px;
	border-radius: 20px;
	box-sizing: border-box;
	position: relative;
}

#titleBar {
	width: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-left: 3.5%;
	font-size: 1.5rem;
}

#chatSettingsButton {
	width: 40px;
	height: 40px;
	padding: 5px;
	cursor: pointer;
	border-radius: 20px;
}
#chatSettingsButton:hover {
	background-color: var(--surface0);
}
#chatSettingsButton > svg {
	width: 100%;
	height: 100%;
}

#inputWrapper {
	display: flex;
	gap: 10px;
}

#sendButton {
	padding-left: 20px;
	padding-right: 20px;
	border-radius: 20px;
	background-color: var(--surface0);
	border: unset;
	color: white;
	display: flex;
	justify-content: center;
	align-items: center;
}

#sendButton:hover {
	background-color: var(--surface1);
	cursor: pointer;
}

#sendButton:active {
	background-color: var(--surface2);
}

.inputBox {
	flex-grow: 1;
	padding-top: 10px;
	padding-bottom: 10px;
	width: 100%;
	border-radius: 20px;
	background-color: var(--surface0);
	border: unset;
	color: white;
	font-size: 1em;
	text-indent: 10px;
	border: 1px solid var(--surface0);
}

.inputBox:focus {
	outline: none;
	border-color: var(--surface2);
}

#messagesWrapper {
	display: flex;
	flex-grow: 1;
	overflow-y: auto;
	overflow-x: hidden;
	flex-direction: column;
	align-items: left;
	gap: 10px;
	box-sizing: border-box;
	min-height: 0;

	border-radius: var(--border-radius);
}

#messagesWrapper::-webkit-scrollbar {
	width: 10px;
  }

  #messagesWrapper::-webkit-scrollbar-thumb {
	background-color: var(--surface1);
	border-radius: 20px;
  }

.chatMessage {
	width: 98%;
	padding-top: 7px;
	padding-bottom: 7px;

	background-color: var(--surface0);
	border-radius: 20px;
	border-top-left-radius: 0px;

	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.username {
	height: 100%;
	max-width: 90%;
	margin-left: 15px;
	margin-right: auto;
	margin-bottom: 3px;
	border-bottom: 2px solid var(--surface2);

	font-weight: bold;
	font-size: var(--messageSize);
	text-overflow: ellipsis;
	white-space: nowrap;
	overflow: hidden;
}

.message {
	height: 100%;
	overflow-wrap: break-word;
	word-wrap: break-word;
	white-space: normal;

	margin-right: 15px;
	margin-left: 15px;
	font-size: var(--messageSize);
}

.timestamp {
	height: 100%;
	min-width: 50px;
	display: flex;
	align-items: center;
	margin-left: auto;
	margin-top: 3px;
	margin-right: 5px;

	color: var(--overlay0);
	font-size: var(--messageSize);
}

#chatSettings {
	position: absolute;
	left: 0;
	top: 4em;
	background-color: var(--crust);
	border-radius: 20px;
	overflow: hidden;

	box-sizing: border-box;
	width: 100%;

	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 20px;

	transition: height 0.1s ease-out, padding 0.1s ease-out;
}

#chatSettingsVisibile {
	display: none;
}

#chatSettingsVisibile:not(:checked) ~ #chatSettings {
	height: 0px;
	padding: 0px;
}

#chatSettingsVisibile:checked ~ #titleBar #chatSettingsButton {
	background-color: var(--crust);
}
#chatSettingsVisibile:checked ~ #titleBar #chatSettingsButton:hover {
	background-color: var(--surface0);
}

.chatSettingsSection {
	display: flex;
	flex-direction: row;
	gap: 5px;
	justify-content: space-between;
	align-items: center;
	-webkit-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

#nameWrapper {
	display: flex;
	flex-direction: row;
	gap: 20px;
	align-items: center;
	background-color: var(--mantle);
	padding-left: 10px;
	border-radius: 10px;
	max-width: 200px;
}

#nameSettings {
	max-width: 70%;
	overflow: hidden;
}

#changeName {
	height: 40px;
	width: 40px;
	min-width: 40px;
	border-radius: 10px;
	background-color: var(--surface0);
	display: flex;
	border: none;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

#changeName > svg {
	color: var(--text);
	width: 90%;
	height: 90%;
}

#chatPopup {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 20px;
}

#acceptChat {
	min-width: 200px;
	min-height: 50px;
	border-radius: 20px;
	background-color: var(--surface0);
	border: unset;
	color: white;
	font-size: 1rem;
}

#acceptChat:hover {
	background-color: var(--surface1);
	cursor: pointer;
}

#acceptChat:active {
	background-color: var(--surface2);
}

#enterName {
	padding-top: 10px;
	padding-bottom: 10px;
	width: 80%;
	border-radius: 20px;
	background-color: var(--surface0);
	border: unset;
	color: white;
	font-size: 1em;
	text-indent: 10px;
	border: 1px solid var(--surface0);
}

#enterNameChatPopup {
	display: flex;
	flex-direction: row;
	height: 20%;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.sendNameButton {
	padding-left: 20px;
	padding-right: 20px;
	padding-top: 10px;
	padding-bottom: 10px;
	border-radius: 20px;
	background-color: var(--surface0);
	border: unset;
	color: white;
	display: flex;
	justify-content: center;
	align-items: center;
}

.sendNameButton:hover {
	background-color: var(--surface1);
	cursor: pointer;
}

.sendNameButton:active {
	background-color: var(--surface2);
}

#chatPopupTitle {
	text-align: center;
}

.adminPanelButtons {
	display: flex;
	flex-direction: column;
	justify-content: space-evenly;
	align-items: center;
	width: 50%;
	gap: 10px;
}

.adminPanelMessageWrapper {
	display: flex;
	flex-direction: column;
	width: 50%;
	gap: 5px;
}

.adminPanelMessage {
	font-size: medium;
}

.adminPanelMessageName {
	text-align: center;
	font-weight: bold;
	border-bottom: 1px solid var(--text);
}

.adminPanelMessageIP {
	font-size: small;
	width: auto;
	background-color: var(--surface0);
	border-radius: var(--border-radius);
}

.adminPanelWrapper {
	display: flex;
	flex-direction: row;
	gap: 10px;
}

.rulesText {
	max-width: 400px;
	font-size: medium;
}

@media (max-width: 400px){
	#nameWrapper {
		max-width: 70%;
	}
}