.messages-container {
	width: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
	height: 100%;
}
.messages-content {
	display: flex;

	overflow-y: auto;
	flex-direction: column;
	/* gap: 30px; */
	scroll-behavior: smooth;
	height: calc(100vh - 150px);
	padding-bottom: 80px;
}
.messages-content::-webkit-scrollbar {
	width: 6px;
}
.messages-content::-webkit-scrollbar-track {
	background: transparent;
}
.messages-content::-webkit-scrollbar-thumb {
	background-color: var(--border);
	border-radius: 6px;
}
.message {
	display: flex;
	flex-direction: column;
	max-width: 100%;
	animation: fadeIn 0.3s ease-out;
	position: relative;
	padding: 5px 35px 5px 25px;
}
.message .message {
	margin: 0;
	width: 100%;
	padding: 5px 0 5px 15px;
}
.message .message:nth-child(3):before {
	position: absolute;
	top: -32px;
	left: 27px;
	content: '';
	width: 12px;
	height: 32px;
	mask: url('../icons/messages-thread-reply-arrow.svg') top left / 12px 32px no-repeat;
	background: var(--color-medium-light-gray);
}
/* .message:not(.message .message) {
	margin-top: 20px;
	}	 */
.message:not(.message .message):first-child {
	margin-top: 0;
}
@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
.message:after {
	position: absolute;
	bottom: -10px;
	left: 0;
	width: 100%;
	height: 1px;
	content: '';
	border-bottom: 1px solid var(--color-background-black-trans-15);
	display: none;
}
.message .message:after {
	display: none;
}
.message .message:nth-child(even) {
	align-self: flex-end;
}
.message:nth-child(even),
.message .message:nth-child(odd) {
	align-self: flex-start;
}
.message-header {
	display: grid;
	align-items: center;
	gap: 10px;
}
.message:nth-child(even) .message-header,
.message:nth-child(odd) .message-header,
.message .message:nth-child(odd) .message-header {
	grid-template-columns: min-content min-content min-content;
	white-space: nowrap;
}
.message .message:nth-child(even) .message-header {
	grid-template-columns: min-content min-content min-content;
	justify-content: flex-end;
	white-space: nowrap;
}
.message .message:nth-child(even) .message-header .avatar {
	order: 3;
}
.message .message:nth-child(even) .message-header .sender-name {
	order: 2;
}
.messages-content .avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 0.8rem;
	color: var(--color-white);
	background-color: var(--color-light-gray);
	line-height: unset;
}
.messages-content .avatar img {
	border-radius: 50%;
	width: 32px;
	height: 32px;
}
.messages-content .sender-name {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--color-black);
}
.timestamp {
	font-size: 0.65rem;
	color: var(--color-light-gray);
}
.message-bubble {
	padding: 14px 20px;
	border-radius: var(--border-radius-10);
	font-size: 0.8rem;
	line-height: 135%;
	position: relative;
	transition: var(--transition);
	color: var(--color-black);
	font-weight: 300;
	position: relative;
}
.message .message:nth-child(even) .message-bubble {
	background-color: var(--color-chat-bubble-primary);
	border-top-right-radius: var(--border-radius-5);
	margin-right: 45px;
}
.message-bubble button.message-reply-button {
	width: 25px;
	height: 25px;
	background: url('../icons/reply-arrow-button.svg') var(--color-chat-bubble-primary) center
		center / 12px 8px no-repeat;
	position: absolute;
	top: 0;
	right: 0;
	border-top-right-radius: var(--border-radius-10);
	border-bottom-left-radius: var(--border-radius-5);
}

.message.attachment .message-bubble {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}
.message .message:nth-child(even) .message-bubble {
	margin-left: 0;
}
.message:nth-child(even) .message-bubble,
.message:nth-child(odd) .message-bubble,
.message .message:nth-child(odd) .message-bubble {
	background-color: var(--color-white);
	border-top-left-radius: var(--border-radius-5);
	margin-left: 45px;
}
.message:nth-child(odd) .message-bubble,
.message:nth-child(even) .message-bubble {
	padding-right: 35px;
}
.message .message:nth-child(odd) .message-bubble,
.message .message:nth-child(even) .message-bubble {
	padding-right: 20px;
}
.message-bubble:hover {
	transform: translateY(-2px);
	box-shadow: 0 3px 10px var(--color-background-black-trans-05);
}
.date-divider {
	display: flex;
	align-items: center;
	margin: 10px 0;
	opacity: 0.7;
}
.divider-line {
	flex: 1;
	height: 1px;
	background-color: var(--color-light-gray);
}
.divider-text {
	font-size: 0.75rem;
	color: var(--text-light);
	white-space: nowrap;
	padding: 0 10px;
}
.typing-indicator {
	display: grid;
	align-items: center;
	gap: 10px;
	justify-content: flex-start;
	grid-template-columns: min-content auto auto auto auto;
}
.typing-dot {
	width: 5px;
	height: 5px;
	background-color: var(--color-light-gray);
	border-radius: 50%;
	animation: typingAnimation 1.4s infinite ease-in-out;
	display: inline-flex;
}
.typing-dot:nth-child(1) {
	animation-delay: 0s;
}
.typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}
.typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typingAnimation {
	0%,
	100% {
		transform: translateY(0);
		opacity: 0.5;
	}
	50% {
		transform: translateY(-4px);
		opacity: 1;
	}
}
.attachment {
	display: flex;
	align-items: center;
	cursor: pointer;
	transition: var(--transition);
	text-decoration: none;
	color: var(--color-black);
	border-top: 1px solid var(--color-background-black-trans-15);
	padding: 12px 15px 8px 20px;
	margin: 8px 0 0 0;
	position: relative;
}
.attachment:before {
	position: absolute;
	left: 0;
	top: 50%;
	mask: url('../icons/document.svg') left center / 15px 16px no-repeat;
	background: var(--color-black);
	content: '';
	width: 15px;
	height: 16px;
	transform: translateY(-50%);
}
.attachment-title {
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--color-black);
}

/* Animation for new messages */
@keyframes popIn {
	0% {
		transform: scale(0.8);
		opacity: 0;
	}
	50% {
		transform: scale(1.05);
	}
	100% {
		transform: scale(1);
		opacity: 1;
	}
}

.pop-in {
	animation: popIn 0.3s forwards;
}

/* COMPOSE AREA */

.compose-container {
	position: absolute;
	bottom: 120px;
	width: 100%;
	left: 0;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	padding: 20px;
	grid-column-gap: 10px;
}
.compose-container textarea.input-send-message {
	width: 100%;
	margin: 0 10px 0 0;
	background: var(--color-background-white-trans-50);
	border: 1px solid var(--color-xxlight-gray);
	padding: 10px;
	overflow: hidden;
	color: black;
	display: block;
	line-height: 140%;
	backdrop-filter: blur(20px);
	box-shadow: none;
	height: 80px;
	font-size: var(--font-size-medium);
}
.compose-container textarea.input-send-message::placeholder {
	color: black;
	font-size: var(--font-size-medium);
}
.compose-container textarea.input-send-message:focus {
	background: white;
	border: 1px solid var(--color-primary);
	box-shadow: 0 0 10px var(--color-background-black-trans-20);
}
.compose-container button {
	padding: 12px 22px;
	border-radius: var(--border-radius-8);
	background: var(--color-button-primary-gradient-bg);
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--color-white);
	height: fit-content;
}
