@font-face {
	font-family: 'Nunito';
	src: url('../fonts/Nunito-Medium.woff2') format('woff2'), url('../fonts/Nunito-Medium.woff') format('woff'), url('../fonts/Nunito-Medium.ttf') format('truetype');
	font-weight: 500;
}
@font-face {
	font-family: 'Nunito';
	src: url('../fonts/Nunito-Bold.woff2') format('woff2'), url('../fonts/Nunito-Bold.woff') format('woff'), url('../fonts/Nunito-Bold.ttf') format('truetype');
	font-weight: bold;
}

page[ui_page="connecting"] {
	color: #036aff;
	font-weight: bold;
	flex-direction: column;
	row-gap: 20px;
}


.messages_cont {
	height: 100vh;
	width: 100vw;
/*	max-width: 500px;*/
/*	margin: 10vh auto 0;*/
	margin: 0 auto;

	font-family: Nunito;
	
	display: flex;
	flex-direction: column;
	align-items: center;
	row-gap: 10px;

	background-color: #f5f5f5;
	color: #000;

	opacity: 0;
	transition: opacity .25s;

/*	border: 1px #aaa solid;*/
}

.messages_list {
	flex: 1 1;
	width: 100%;
	overflow: hidden;
	overflow-y: auto;
}


.field_cont {
	display: flex;
	align-items: center;
	width: 95%;
	height: 3.5rem;
	border-radius: 1.75em;
	overflow: hidden;
	background-color: #fff;
	box-shadow: 10px 10px 20px rgba(0,0,0,.1);
	padding-right: 1em;
}
.field_cont input {
	flex: 1 1;
	height: 100%;
	width: 100%;
	padding: .5em 1em;
	color: #000;
	border: none;
}
.field_cont input[waiting="true"] {
	pointer-events: none;
	user-select: none;
	opacity: .5;
}

.field_cont_icon {
	flex: 0 0 2.5rem;
	display: inline-block;
	text-align: center;
	line-height: 0;
	cursor: pointer;
	user-select: none;
}
.field_cont_icon > * { pointer-events: none; user-select: none; }

.field_cont_icon[waiting="true"] {
	pointer-events: none;
	cursor: default;
}
.field_cont_icon_upload,
.field_cont_icon_send,
.field_cont_icon_waiting {
	height: 1.5rem;
	cursor: pointer;
	user-select: none;
}

.field_cont_icon_waiting {
	display: none;
	animation: 2s infinite linear rotate;
}
.field_cont_icon[waiting="true"] .field_cont_icon_send { display: none; }
.field_cont_icon[waiting="true"] .field_cont_icon_waiting { display: inline-block; }

page {
	opacity: 0;
	transition: opacity .25s;
}

page[ui_page="connecting"] .field_cont_icon_waiting {
	display:inline-block;
	width: 40px;
	height: 40px;
	opacity: 1 !important;
}

@keyframes rotate {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.footer {
	margin-bottom: 1em;
	font-size: .75rem;
	color: #333;
}

.messages_bubble {
	--border_size: 2em;
	width: 100%;
	margin: 1em 0 2em;
	padding: 0 2.5rem;
	line-height: 1.2em;
	visibility: hidden;
	cursor: pointer;
}
/*.messages_bubble * { pointer-events: none; }*/

.messages_bubble inner {
	padding: 1.5em 1em;
	display: inline-block;
	width: auto;
	max-width: 95%;
	color: #fff;
	background-color: #222;
	border-radius: var(--border_size);
}


.messages_bubble[type="local"] {
	visibility: visible;
	text-align: right;
}
.messages_bubble[type="local"] inner {
	color: #fff;
	background-color: #3369FF;
	text-align: right;
	border-radius: var(--border_size) 0 var(--border_size) var(--border_size);
}

.messages_bubble[type="remote"] {
	visibility: visible;
}
.messages_bubble[type="remote"] inner {
	color: #000;
	background-color: #EEEEEE;
	border-radius: var(--border_size) var(--border_size) var(--border_size) 0;
}
.messages_bubble[type="remote"] inner::after {
	--bubble_icon_size: 1.5em;
	content: " ";
	display: inline-block;
	position: absolute;
	left: -1.75em;
	bottom: calc(var(--bubble_icon_size) * -.5);
	width: var(--bubble_icon_size);
	aspect-ratio: 1;
	border-radius: 50%;
	background-color: #fff;
	background-image: url(../img/icon.png);
	background-position: center;
	background-size: auto 70%;
	background-repeat: no-repeat;
	box-shadow: 2px 2px 5px rgba(0,0,0,.1);
}

.messages_bubble[type="error"],
.messages_bubble[type="message"],
.messages_bubble[type="waiting"] {
	text-align: center;
	margin: auto;
}
.messages_bubble[type="error"] inner,
.messages_bubble[type="message"] inner,
.messages_bubble[type="waiting"] inner {
	visibility: visible;
}
.messages_bubble[type="message"] {
	margin: 1em auto 1em;
}
.messages_bubble[type="message"] inner,
.messages_bubble[type="waiting"] inner {
	font-size: .75em;
	color: #fff;
	background-color: rgb(162, 162, 162);
}
.messages_bubble[type="error"] inner {
	color: #fff;
	background-color: rgb(108,25,25);
}

.messages_bubble_text {
	margin-bottom:.25em;
	font-size: .8125rem;
}

.messages_bubble_text h2 {
	display: inline;
	font-weight: bold;
	margin: .5em 0;
}


.messages_bubble [chat_code="true"] {
	display:inline-block;
	padding-left: 1em;
	font-style: italic;
	color: #555;
}

.messages_bubble_date { font-size:.5em; }
.messages_bubble[type="message"] .messages_bubble_date,
.messages_bubble[type="waiting"] .messages_bubble_date { display: none; }

.messages_header {
	display: flex;
	width: 100%;
	align-items: center;
	column-gap: 1rem;
	padding: .5rem 2rem;
	background-color: #fff;
}
.messages_header_img {
}
.messages_header_info {
	flex: 1 1;
}
.messages_header_title {
	font-weight: bold;
	font-size: 1.25rem;
	color: #3369FF;
}
.messages_header_status {
	display: flex;
	align-items: center;
	font-weight: 500;
}
.messages_header_status::before {
	content: " ";
	display: inline-block;
	width: .5rem;
	margin-right: .25rem;
	aspect-ratio: 1;
	border-radius: 50%;
}
.messages_header_status[state="online"].messages_header_status::before { background-color: #3ABF38; }
.messages_header_status[state="online"] { color: #3ABF38; }
.messages_header_status[state="offline"].messages_header_status::before { background-color: #BF6438; }
.messages_header_status[state="offline"] { color: #BF6438; }
