/* ===== Кнопка чата ===== */
#chat-toggle {
	position: fixed;
	bottom: 24px;
	right: 7px; 
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	background: rgba(15, 12, 41, 0.85);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(161, 140, 209, 0.4);
	border-radius: 50px;
	color: #fff;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	z-index: 99999;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	transition: all 0.3s ease;
	user-select: none;
}

#chat-toggle:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 15px rgba(222, 136, 198, 0.7);
}

/* ===== Окно чата ===== */
#chat-box {
	position: fixed;
	bottom: 100px;
	right: 24px;
	width: 340px;
	max-width: calc(100vw - 48px);
	height: 460px;
	background: rgba(15, 12, 41, 0.92);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	z-index: 99998;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	color: #fff;
	animation: chatSlideIn 0.3s ease;
}

#chat-box.open {
	display: flex;
}

@keyframes chatSlideIn {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* ===== Шапка ===== */
.chat-header {
	padding: 18px 22px;
	background: rgba(255, 255, 255, 0.06);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.chat-status {
	display: flex;
	align-items: center;
	gap: 10px;
}

.chat-status span {
	font-weight: 600;
	font-size: 15px;
}

.chat-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #34d399;
	box-shadow: 0 0 12px #34d399;
	animation: blink 2s ease-in-out infinite;
}

@keyframes blink {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.4;
	}
}

#chat-close {
	cursor: pointer;
	font-size: 22px;
	opacity: 0.6;
	transition: opacity 0.2s, transform 0.2s;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 8px;
}

#chat-close:hover {
	opacity: 1;
	transform: rotate(90deg);
}

/* ===== Сообщения ===== */
#chat-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

#chat-messages::-webkit-scrollbar {
	width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
	background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

.chat-message {
	background: rgba(102, 126, 234, 0.25);
	border: 1px solid rgba(102, 126, 234, 0.4);
	padding: 14px 18px;
	border-radius: 18px 18px 18px 4px;
	font-size: 14px;
	line-height: 1.5;
	max-width: 85%;
	color: #fff;
	animation: msgFadeIn 0.4s ease;
}

/* Сообщение от пользователя — справа, другой цвет */
.chat-message.user {
	background: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.2);
	border-radius: 18px 18px 4px 18px;
	align-self: flex-end;
}

/* Сообщение от бота — слева */
.chat-message.bot {
	align-self: flex-start;
}

@keyframes msgFadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ===== Поле ввода ===== */
.chat-input-wrap {
	padding: 14px 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.03);
}

.chat-input-wrap input {
	width: 100%;
	padding: 12px 16px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	color:#fff;/* color: rgba(255, 255, 255, 0.5); */
	font-size: 14px;
	outline: none;
	font-family: inherit;
	cursor:text;/* cursor: not-allowed; */
}

.chat-input-wrap input::placeholder {
	color: rgba(255, 255, 255, 0.4);
}

.chat-input-wrap input:focus {
	border-color: rgba(161, 140, 209, 0.55);
	background: rgba(255, 255, 255, 0.1);
}

/* ===== Адаптив ===== */
@media (max-width: 480px) {
	#chat-box {
		width: calc(100vw - 32px);
		right: 16px;
		bottom: 90px;
	}

	#chat-toggle {
		bottom: 16px;
		right: 16px;
	}
}