* {
	box-sizing: border-box;
}

body {
	font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
	margin: 0;
	padding: 0;
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	min-height: 100vh;
	color: #e0e0e0;
}

nav {
	background: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(10px);
	padding: 1rem 2rem;
	color: #e0e0e0;
	font-size: 1.4rem;
	font-weight: bold;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-container {
	display: grid;
	grid-template-columns: 300px 1fr 300px;
	grid-template-rows: 1fr;
	gap: 1rem;
	padding: 1rem;
	height: calc(100vh - 100px);
	max-width: 1400px;
	margin: 0 auto;
}

@media (max-width: 1024px) {
	.chat-container {
		grid-template-columns: 1fr;
		grid-template-rows: auto auto 1fr;
	}
	
	.info-panel {
		order: -1;
	}
}

.connection-panel,
.chat-panel,
.info-panel {
	background: rgba(30, 30, 45, 0.9);
	border-radius: 12px;
	padding: 1.5rem;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-panel {
	display: flex;
	flex-direction: column;
}

h3 {
	margin: 0 0 1rem 0;
	color: #e0e0e0;
	font-size: 1.2rem;
}

.connection-status {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	padding: 0.75rem;
	background: rgba(0, 0, 0, 0.3);
	border-radius: 8px;
	color: #e0e0e0;
}

.status-indicator {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #dc3545;
	transition: background-color 0.3s ease;
}

.status-indicator.connected {
	background: #28a745;
}

.status-indicator.connecting {
	background: #ffc107;
	animation: pulse 1s infinite;
}

@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.connection-controls {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.room-info {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.room-info > div {
	display: flex;
	gap: 0.5rem;
	align-items: center;
}

.join-room {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.join-room > div {
	display: flex;
	gap: 0.5rem;
}

.btn {
	padding: 0.75rem 1rem;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
	transition: all 0.2s ease;
	font-size: 0.9rem;
}

.btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.btn-primary {
	background: #0d6efd;
	color: white;
}

.btn-primary:hover:not(:disabled) {
	background: #0b5ed7;
	transform: translateY(-1px);
}

.btn-secondary {
	background: #495057;
	color: white;
}

.btn-secondary:hover:not(:disabled) {
	background: #343a40;
	transform: translateY(-1px);
}

.btn-small {
	padding: 0.5rem 0.75rem;
	font-size: 0.8rem;
}

input[type="text"] {
	padding: 0.75rem;
	border: 2px solid #495057;
	border-radius: 6px;
	font-size: 0.9rem;
	transition: border-color 0.2s ease;
	background: #343a40;
	color: #e0e0e0;
}

input[type="text"]:focus {
	outline: none;
	border-color: #0d6efd;
}

input[type="text"]:disabled {
	background: #495057;
	color: #adb5bd;
}

label {
	font-weight: 600;
	color: #adb5bd;
	font-size: 0.9rem;
}

.messages {
	flex: 1;
	overflow-y: auto;
	border: 2px solid #495057;
	border-radius: 8px;
	padding: 1rem;
	background: #212529;
	margin-bottom: 1rem;
	max-height: 400px;
}

.message {
	margin-bottom: 0.75rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	max-width: 80%;
	word-wrap: break-word;
}

.message.own {
	background: #0d6efd;
	color: white;
	margin-left: auto;
	text-align: right;
}

.message.peer {
	background: #495057;
	color: #e0e0e0;
}

.message.system {
	background: #664d03;
	color: #ffda6a;
	text-align: center;
	max-width: 100%;
	font-style: italic;
}

.system-message {
	color: #adb5bd;
	font-style: italic;
	text-align: center;
	padding: 1rem;
}

.chat-input-container {
	display: flex;
	gap: 0.5rem;
}

.chat-input-container input {
	flex: 1;
}

.info-content {
	font-size: 0.9rem;
	line-height: 1.5;
	color: #e0e0e0;
}

.info-content ul,
.info-content ol {
	margin: 0.5rem 0;
	padding-left: 1.5rem;
}

.info-content li {
	margin-bottom: 0.25rem;
}

.info-content p {
	margin: 0.75rem 0;
}

footer {
	text-align: center;
	padding: 1rem;
	color: rgba(224, 224, 224, 0.8);
	font-size: 0.9rem;
}

.tech-info {
	background: rgba(0, 0, 0, 0.3);
	display: inline-block;
	padding: 0.5rem 1rem;
	border-radius: 20px;
	backdrop-filter: blur(5px);
}
