/* Chatbot Variables */
:root {
	--rankolab-dark: #0a0e17;
	--rankolab-neon-blue: #00d2ff;
	--rankolab-neon-green: #3aedb2;
	--rankolab-glass-bg: rgba(10, 14, 23, 0.85);
	--rankolab-glass-border: rgba(255, 255, 255, 0.08);
	--rankolab-text-main: #f0f4f8;
	--rankolab-text-muted: #9ab3c9;
}

/* Toggle Button */
#rankolab-chatbot-toggle {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--rankolab-neon-blue), var(--rankolab-neon-green));
	border: none;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 20px rgba(0, 210, 255, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#rankolab-chatbot-toggle:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 25px rgba(0, 210, 255, 0.6);
}

/* Chat Container (Glassmorphism) */
#rankolab-chatbot-container {
	position: fixed;
	bottom: 100px;
	right: 24px;
	width: 380px;
	height: 600px;
	max-height: calc(100vh - 120px);
	background: var(--rankolab-glass-bg);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid var(--rankolab-glass-border);
	border-radius: 20px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
	display: flex;
	flex-direction: column;
	z-index: 9998;
	overflow: hidden;
	transition: opacity 0.3s ease, transform 0.3s ease;
	font-family: 'Inter', -apple-system, sans-serif;
}

.rankolab-chatbot-hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateY(20px);
}

/* Header */
.rankolab-chatbot-header {
	padding: 20px;
	border-bottom: 1px solid var(--rankolab-glass-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: rgba(0, 0, 0, 0.2);
}

.rankolab-chatbot-header .header-info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.rankolab-chatbot-header .avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--rankolab-neon-blue), var(--rankolab-neon-green));
	position: relative;
}

.rankolab-chatbot-header .avatar::after {
	content: '';
	position: absolute;
	bottom: 0;
	right: 0;
	width: 10px;
	height: 10px;
	background: var(--rankolab-neon-green);
	border: 2px solid var(--rankolab-dark);
	border-radius: 50%;
}

.rankolab-chatbot-header strong {
	display: block;
	color: var(--rankolab-text-main);
	font-size: 16px;
	font-weight: 600;
}

.rankolab-chatbot-header span {
	color: var(--rankolab-text-muted);
	font-size: 13px;
}

#rankolab-chatbot-close {
	background: transparent;
	border: none;
	color: var(--rankolab-text-muted);
	font-size: 24px;
	cursor: pointer;
	line-height: 1;
}

/* Messages Area */
.rankolab-chatbot-messages {
	flex: 1;
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

/* Scrollbar styling */
.rankolab-chatbot-messages::-webkit-scrollbar {
	width: 6px;
}
.rankolab-chatbot-messages::-webkit-scrollbar-track {
	background: transparent;
}
.rankolab-chatbot-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 3px;
}

.message {
	max-width: 85%;
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.5;
	animation: fadeIn 0.3s ease forwards;
}

.message.ai {
	background: rgba(255, 255, 255, 0.05);
	color: var(--rankolab-text-main);
	align-self: flex-start;
	border-bottom-left-radius: 4px;
}

.message.user {
	background: linear-gradient(135deg, rgba(0, 210, 255, 0.2), rgba(58, 237, 178, 0.2));
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
	border: 1px solid rgba(0, 210, 255, 0.3);
}

/* Input Area */
.rankolab-chatbot-input {
	padding: 16px;
	border-top: 1px solid var(--rankolab-glass-border);
	display: flex;
	gap: 8px;
	background: rgba(0, 0, 0, 0.3);
}

#rankolab-chatbot-text {
	flex: 1;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	padding: 12px 16px;
	color: #fff;
	font-size: 14px;
	outline: none;
	transition: border-color 0.3s;
}

#rankolab-chatbot-text:focus {
	border-color: var(--rankolab-neon-blue);
}

#rankolab-chatbot-send {
	width: 44px;
	height: 44px;
	border-radius: 8px;
	background: var(--rankolab-neon-blue);
	border: none;
	color: #000;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s;
}

#rankolab-chatbot-send:hover {
	background: var(--rankolab-neon-green);
}

/* Typing Indicator */
.typing-indicator {
	display: flex;
	gap: 4px;
	padding: 14px 16px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 12px;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
	width: fit-content;
}

.typing-dot {
	width: 6px;
	height: 6px;
	background: var(--rankolab-neon-blue);
	border-radius: 50%;
	animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
	0%, 80%, 100% { transform: scale(0); }
	40% { transform: scale(1); }
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
	#rankolab-chatbot-container {
		width: calc(100% - 32px);
		right: 16px;
		height: calc(100vh - 100px);
	}
}
