@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

:root {
	--dark-color-a: #667aff;
	--dark-color-b: #7386ff;
	--light-color: #e6e9ff;
	--success-color: #5cb85c;
	--error-color: #d9534f;
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: 'Roboto', sans-serif;
	font-size: 16px;
	background: var(--light-color);
	margin: 20px;
}

ul {
	list-style: none;
}

a {
	text-decoration: none;
}

.btn {
	cursor: pointer;
	padding: 5px 15px;
	background: var(--light-color);
	color: var(--dark-color-a);
	border: 0;
	font-size: 17px;
}

/* Chat Page */

.chat-container {
	max-width: 1100px;
	background: #fff;
	margin: 30px auto;
	overflow: hidden;
}

.chat-header {
	background: var(--dark-color-a);
	color: #fff;
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
	padding: 15px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.chat-main {
	display: grid;
	grid-template-columns: 1fr 3fr;
}

.chat-sidebar {
	background: var(--dark-color-b);
	color: #fff;
	padding: 20px 20px 60px;
	overflow-y: scroll;
}

.chat-sidebar h2 {
	font-size: 20px;
	background: rgba(0, 0, 0, 0.1);
	padding: 10px;
	margin-bottom: 20px;
}

.chat-sidebar h3 {
	margin-bottom: 15px;
}

.chat-sidebar ul li {
	padding: 10px 0;
}

.chat-messages {
	padding: 30px;
	max-height: 500px;
	overflow-y: scroll;
}

.chat-messages .message {
	padding: 10px;
	margin-bottom: 15px;
	background-color: var(--light-color);
	border-radius: 5px;
	overflow-wrap: break-word;
}

.chat-messages .message .meta {
	font-size: 15px;
	font-weight: bold;
	color: var(--dark-color-b);
	opacity: 0.7;
	margin-bottom: 7px;
}

.chat-messages .message .meta span {
	color: #777;
}

.chat-form-container {
	padding: 20px 30px;
	background-color: var(--dark-color-a);
}

.chat-form-container form {
	display: flex;
}

.chat-form-container input[type='text'] {
	font-size: 16px;
	padding: 5px;
	height: 40px;
	flex: 1;
}

/* Join Page */
.join-container {
	max-width: 500px;
	margin: 80px auto;
	color: #fff;
}

.join-header {
	text-align: center;
	padding: 20px;
	background: var(--dark-color-a);
	border-top-left-radius: 5px;
	border-top-right-radius: 5px;
}

.join-main {
	padding: 30px 40px;
	background: var(--dark-color-b);
}

.join-main p {
	margin-bottom: 20px;
}

.join-main .form-control {
	margin-bottom: 20px;
}

.join-main label {
	display: block;
	margin-bottom: 5px;
}

.join-main input[type='text'] {
	font-size: 16px;
	padding: 5px;
	height: 40px;
	width: 100%;
}

.join-main select {
	font-size: 16px;
	padding: 5px;
	height: 40px;
	width: 100%;
}

.join-main .btn {
	margin-top: 20px;
	width: 100%;
}

@media (max-width: 700px) {
	.chat-main {
		display: block;
	}

	.chat-sidebar {
		display: none;
	}
}

.typing-indicator {
	padding: 10px;
	margin: 10px 0;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 5px;
	font-style: italic;
	color: #666;
}

.typing-indicator p {
	margin: 0;
	font-size: 0.9em;
}

/* Online Status Styles */
.status-indicator {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	margin-left: 5px;
	vertical-align: middle;
	cursor: pointer;
}

.status-indicator.online {
	background-color: #5cb85c;
}

.status-indicator.away {
	background-color: #f0ad4e;
}

.status-indicator.offline {
	background-color: #d9534f;
}

#users li {
	display: flex;
	align-items: center;
	margin-bottom: 5px;
}

/* Tooltip Styles */
.tooltip {
	position: fixed;
	background-color: rgba(0, 0, 0, 0.8);
	color: white;
	padding: 0;
	border-radius: 4px;
	font-size: 12px;
	z-index: 1000;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	min-width: 150px;
}

.tooltip-header {
	background-color: rgba(0, 0, 0, 0.9);
	padding: 5px 10px;
	font-weight: bold;
	border-top-left-radius: 4px;
	border-top-right-radius: 4px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-content {
	padding: 8px 10px;
}

.tooltip-content div {
	margin-bottom: 3px;
}

.tooltip::after {
	content: '';
	position: absolute;
	bottom: -5px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid rgba(0, 0, 0, 0.8);
}

.status-online {
	color: #5cb85c;
	font-weight: bold;
}

.status-away {
	color: #f0ad4e;
	font-weight: bold;
}

.status-offline {
	color: #d9534f;
	font-weight: bold;
}

/* Offline Notification Styles */
.offline-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	background-color: #d9534f;
	color: white;
	padding: 15px;
	border-radius: 5px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
	z-index: 1000;
	max-width: 300px;
	animation: slideIn 0.3s ease-out;
}

.notification-content {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.notification-content p {
	margin: 0;
}

#reconnect-btn {
	background-color: white;
	color: #d9534f;
	border: none;
	padding: 5px 10px;
	border-radius: 3px;
	cursor: pointer;
	font-weight: bold;
	align-self: flex-end;
}

#reconnect-btn:hover {
	background-color: #f8f8f8;
}

@keyframes slideIn {
	from {
		transform: translateX(100%);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Toast Notification Styles */
.toast-notification {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background-color: #333;
	color: white;
	padding: 12px 20px;
	border-radius: 5px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-width: 300px;
	max-width: 400px;
	animation: slideIn 0.3s ease-out;
}

.toast-notification.fade-out {
	animation: fadeOut 0.5s ease-out forwards;
}

.toast-content {
	display: flex;
	align-items: center;
	gap: 10px;
}

.toast-content i {
	color: #ff6b6b;
	font-size: 18px;
}

.toast-btn {
	background-color: transparent;
	color: white;
	border: 1px solid white;
	padding: 5px 10px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 12px;
	margin-left: 15px;
	transition: all 0.2s;
}

.toast-btn:hover {
	background-color: white;
	color: #333;
}

.toast-error {
	color: #ff6b6b;
	font-size: 12px;
	margin-top: 5px;
	font-style: italic;
}

@keyframes fadeOut {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}
