* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--bg-primary: #0a0a0a;
	--bg-secondary: #1a1a1a;
	--text-primary: #ffffff;
	--text-secondary: #a0a0a0;
	--accent: #00d9ff;
	--accent-dark: #0095b3;
	--border: #2a2a2a;
	--message-user: #1a2a3a;
	--message-other: #1a1a1a;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
	background: var(--bg-primary);
	color: var(--text-primary);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 20px;
}

.container {
	display: flex;
	flex-direction: column;
	height: 90vh;
	width: calc(100% - 40px);
	max-width: 1200px;
	background: linear-gradient(135deg, #0a0a0a 0%, #0f0f0f 100%);
	border-radius: 12px;
	border: 1px solid var(--border);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
	overflow: hidden;
}

.header {
	padding: 16px 24px;
	border-bottom: 1px solid var(--border);
	background: var(--bg-secondary);
	display: flex;
	justify-content: space-between;
	align-items: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
	animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.header-title {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.5px;
}

.status {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: var(--text-secondary);
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
	animation: pulse 2s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.messages-container {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
	width: 8px;
}

.messages-container::-webkit-scrollbar-track {
	background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
	background: var(--border);
	border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
	background: var(--text-secondary);
}

.message {
	display: flex;
	gap: 8px;
	animation: fadeIn 0.3s ease-out;
	width: 100%;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.message.user {
	justify-content: flex-end;
}

.message-wrapper {
	display: flex;
	flex-direction: column;
	max-width: 70%;
}

.message.user .message-wrapper {
	align-items: flex-end;
}

.message-content {
	padding: 10px 14px;
	border-radius: 8px;
	word-wrap: break-word;
	word-break: break-word;
	overflow-wrap: break-word;
	font-size: 14px;
	line-height: 1.4;
	animation: messageSlide 0.3s ease-out;
	white-space: pre-wrap;
}

@keyframes messageSlide {
	from {
		opacity: 0;
		transform: scaleX(0.95);
	}
	to {
		opacity: 1;
		transform: scaleX(1);
	}
}

.message.user .message-content {
	background: var(--accent);
	color: var(--bg-primary);
	border-radius: 12px 4px 12px 12px;
	font-weight: 500;
}

.message.other .message-content {
	background: var(--message-other);
	color: var(--text-primary);
	border: 1px solid var(--border);
	border-radius: 4px 12px 12px 12px;
}

.message-timestamp {
	font-size: 12px;
	color: var(--text-secondary);
	margin-top: 4px;
	padding: 0 4px;
}

.input-section {
	padding: 20px 24px;
	border-top: 1px solid var(--border);
	background: var(--bg-secondary);
	display: flex;
	flex-direction: column;
	gap: 12px;
	animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.input-row {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.username-input {
	flex: 0 0 150px;
	background: var(--bg-primary);
	border: 1px solid var(--border);
	color: var(--text-primary);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	transition: all 0.2s ease;
	height: 40px;
}

.username-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.message-input {
	flex: 1;
	background: var(--bg-primary);
	border: 1px solid var(--border);
	color: var(--text-primary);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-family: inherit;
	resize: none;
	height: 40px;
	min-height: 40px;
	max-height: 120px;
	transition: all 0.2s ease;
}

.message-input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.send-btn {
	flex: 0 0 auto;
	height: 40px;
	padding: 0 28px;
	background: var(--accent);
	color: var(--bg-primary);
	border: none;
	border-radius: 6px;
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.send-btn:hover:not(:disabled) {
	background: var(--accent-dark);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 217, 255, 0.2);
}

.send-btn:active:not(:disabled) {
	transform: translateY(0);
}

.send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	gap: 16px;
	color: var(--text-secondary);
	text-align: center;
	padding: 40px;
}

.empty-state-icon {
	font-size: 48px;
	opacity: 0.3;
}

.empty-state-text {
	font-size: 14px;
	max-width: 280px;
	line-height: 1.6;
}

.error {
	padding: 12px 16px;
	background: rgba(255, 71, 87, 0.1);
	border: 1px solid rgba(255, 71, 87, 0.3);
	border-radius: 6px;
	color: #ff4757;
	font-size: 13px;
	margin: 0 24px;
}

.loading {
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--accent);
	animation: dot-flashing 1.4s infinite;
}

@keyframes dot-flashing {
	0%, 60%, 100% { opacity: 0.3; }
	30% { opacity: 1; }
}

@media (max-width: 768px) {
	.message-content {
		max-width: 90%;
	}

	.header-title {
		font-size: 16px;
	}

	.container {
		height: 100vh;
		width: 100%;
		max-width: 100%;
		border-radius: 0;
		border: none;
	}

	.input-section {
		flex-shrink: 0;
	}

	.messages-container {
		min-height: 0;
	}

	.input-row {
		flex-direction: row;
		align-items: flex-end;
	}

	.username-input {
		flex: 0 0 90px;
	}

	.send-btn {
		flex: 0 0 auto;
	}
}
