* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
		Oxygen, Ubuntu, Cantarell, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	color: #333;
	line-height: 1.6;
}

.container {
	max-width: 600px;
	margin: 0 auto;
	padding: 16px;
	min-height: 100vh;
}

.header {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 12px;
	padding: 20px 24px;
	margin-bottom: 20px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}

.header-left {
	display: flex;
	align-items: center;
}

.header-right {
	display: flex;
	align-items: center;
	gap: 16px;
}

.title {
	font-size: 24px;
	font-weight: 700;
	color: #2d3748;
	display: flex;
	align-items: center;
	gap: 10px;
}

.icon {
	font-size: 28px;
}

.logout-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: rgba(220, 38, 38, 0.1);
	color: #dc2626;
	border: 1px solid rgba(220, 38, 38, 0.2);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: inherit;
}

.logout-btn:hover {
	background: rgba(220, 38, 38, 0.15);
	border-color: rgba(220, 38, 38, 0.3);
	transform: translateY(-1px);
}

.logout-btn:active {
	transform: translateY(0);
}

.logout-btn svg {
	flex-shrink: 0;
}

.status-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 500;
}

.status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ef4444;
	animation: pulse 2s infinite;
}

.status-dot.connected {
	background: #10b981;
}

.status-dot.loading {
	background: #f59e0b;
}

@keyframes pulse {
	0% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
	}

	70% {
		transform: scale(1);
		box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
	}

	100% {
		transform: scale(0.95);
		box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
	}
}

.messages-container {
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 12px;
	padding: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
	max-height: calc(100vh - 180px);
	overflow-y: auto;
}

.loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px;
	color: #6b7280;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e7eb;
	border-top: 3px solid #667eea;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin-bottom: 16px;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.message {
	background: #ffffff;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	padding: 16px;
	margin-bottom: 16px;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.message:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
	border-color: #9ca3af;
}

.message::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 3px;
	height: 100%;
	background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Compact message layout improvements */
.message:last-child {
	margin-bottom: 0;
}

.message-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 10px;
	flex-wrap: wrap;
	gap: 8px;
}

.message-from {
	font-weight: 600;
	color: #2d3748;
	font-size: 15px;
	flex: 1;
	min-width: 0; /* Allow text truncation */
	overflow: hidden;
	text-overflow: ellipsis;
}

.message-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.message-time {
	color: #6b7280;
	font-size: 12px;
	font-weight: 400;
	white-space: nowrap;
}

.delete-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	color: #dc2626;
	transition: all 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.delete-btn:hover {
	background: #fee2e2;
	color: #b91c1c;
	transform: scale(1.1);
}

.delete-btn:active {
	transform: scale(0.95);
}

.message-body {
	color: #4a5568;
	font-size: 14px;
	line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
	margin-bottom: 8px;
}

.message-body .number-highlight {
	font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
	font-weight: 700;
	color: #2563eb;
	background: rgba(37, 99, 235, 0.1);
	padding: 2px 4px;
	border-radius: 3px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.message-body .number-highlight:hover {
	background: rgba(37, 99, 235, 0.2);
	transform: translateY(-1px);
}

.message-body .number-highlight.copied {
	background: rgba(16, 185, 129, 0.2);
	color: #059669;
	animation: copyFlash 0.3s ease;
}

@keyframes copyFlash {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
	100% {
		transform: scale(1);
	}
}

.message-metadata {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #e2e8f0;
	font-size: 12px;
	color: #6b7280;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.metadata-item {
	display: flex;
	align-items: center;
	gap: 4px;
	white-space: nowrap;
	font-size: 11px;
}

.metadata-label {
	font-weight: 500;
	font-size: 11px;
}

.no-messages {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(10px);
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.no-messages-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.no-messages h3 {
	margin-bottom: 8px;
	color: #4a5568;
	font-weight: 600;
}

.no-messages p {
	color: #6b7280;
}

/* Scrollbar styling */
.messages-container::-webkit-scrollbar {
	width: 8px;
}

.messages-container::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.1);
	border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.2);
	border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb:hover {
	background: rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
	.container {
		padding: 12px;
	}

	.header {
		padding: 16px;
		flex-direction: column;
		text-align: center;
	}

	.title {
		font-size: 20px;
	}

	.messages-container {
		padding: 12px;
		max-height: calc(100vh - 160px);
	}

	.message {
		padding: 12px;
	}

	.message-metadata {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.metadata-item {
		font-size: 10px;
	}

	.message-from {
		font-size: 14px;
	}

	.message-body {
		font-size: 13px;
	}
}

/* Animation for new messages */
@keyframes slideInFromTop {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.message.new {
	animation: slideInFromTop 0.5s ease-out;
}

/* Notification styles */
.notification {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 12px 20px;
	border-radius: 8px;
	color: white;
	font-weight: 500;
	font-size: 14px;
	z-index: 1000;
	transform: translateX(400px);
	transition: transform 0.3s ease;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	max-width: 300px;
}

.notification.show {
	transform: translateX(0);
}

.notification-success {
	background: #10b981;
}

.notification-error {
	background: #ef4444;
}

.notification-info {
	background: #3b82f6;
}

@media (max-width: 768px) {
	.header {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.header-right {
		justify-content: space-between;
		width: 100%;
	}

	.logout-btn {
		padding: 6px 10px;
		font-size: 13px;
	}

	.notification {
		top: 10px;
		right: 10px;
		left: 10px;
		max-width: none;
		transform: translateY(-100px);
	}

	.notification.show {
		transform: translateY(0);
	}

	.message-actions {
		flex-wrap: wrap;
		gap: 8px;
	}
}
