/* =====================================================================
   LFSport — Chatbot v1
   ===================================================================== */

:root {
	--lfsc-orange:       #FF6600;
	--lfsc-orange-hover: #E65A00;
	--lfsc-dark:         #1a1a1a;
	--lfsc-bg:           #ffffff;
	--lfsc-bg-soft:      #f7f7f5;
	--lfsc-text:         #1a1a1a;
	--lfsc-text-muted:   #6b6b6b;
	--lfsc-border:       rgba(0, 0, 0, 0.10);
	--lfsc-radius:       14px;
	--lfsc-radius-sm:    8px;
	--lfsc-shadow:       0 12px 32px rgba(0, 0, 0, 0.18);
	--lfsc-shadow-sm:    0 8px 20px rgba(255, 102, 0, 0.4);
	--lfsc-success:      #22a55f;
}

.lfsport-chatbot {
	position: fixed;
	bottom: 20px;
	left: 20px;
	z-index: 9998;
	font-family: inherit;
	color: var(--lfsc-text);
	-webkit-font-smoothing: antialiased;
}

/* =====================================================================
   Launcher (botão flutuante)
   ===================================================================== */
.lfsport-chatbot__launcher {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--lfsc-orange);
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--lfsc-shadow-sm);
	transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
	position: relative;
}

.lfsport-chatbot__launcher:hover {
	background: var(--lfsc-orange-hover);
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(255, 102, 0, 0.5);
}

.lfsport-chatbot__launcher:focus-visible {
	outline: 3px solid rgba(255, 102, 0, 0.4);
	outline-offset: 2px;
}

.lfsport-chatbot__launcher-icon {
	position: absolute;
	transition: opacity 0.15s, transform 0.2s;
}

.lfsport-chatbot__launcher-icon--close {
	opacity: 0;
	transform: scale(0.6) rotate(-45deg);
}

.lfsport-chatbot__launcher--open .lfsport-chatbot__launcher-icon--chat {
	opacity: 0;
	transform: scale(0.6) rotate(45deg);
}

.lfsport-chatbot__launcher--open .lfsport-chatbot__launcher-icon--close {
	opacity: 1;
	transform: scale(1) rotate(0);
}


/* =====================================================================
   Painel
   ===================================================================== */
.lfsport-chatbot__panel {
	position: absolute;
	bottom: 72px;
	left: 0;
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: min(560px, calc(100vh - 100px));
	background: var(--lfsc-bg);
	border-radius: var(--lfsc-radius);
	box-shadow: var(--lfsc-shadow);
	border: 0.5px solid var(--lfsc-border);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: lfsc-pop-in 0.25s ease-out;
}

@keyframes lfsc-pop-in {
	from { opacity: 0; transform: translateY(10px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* =====================================================================
   Header
   ===================================================================== */
.lfsport-chatbot__header {
	background: var(--lfsc-dark);
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.lfsport-chatbot__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--lfsc-orange);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.lfsport-chatbot__title {
	flex: 1;
	min-width: 0;
}

.lfsport-chatbot__name {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	line-height: 1.2;
}

.lfsport-chatbot__status {
	margin: 2px 0 0;
	font-size: 11px;
	color: var(--lfsc-success);
	line-height: 1;
}

.lfsport-chatbot__close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 6px;
	display: flex;
	border-radius: 50%;
	opacity: 0.75;
	transition: opacity 0.1s, background 0.1s;
}

.lfsport-chatbot__close:hover {
	opacity: 1;
	background: rgba(255, 255, 255, 0.1);
}

.lfsport-chatbot__close:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: 1px;
}

/* =====================================================================
   Área de mensagens
   ===================================================================== */
.lfsport-chatbot__messages {
	flex: 1;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 14px;
	background: var(--lfsc-bg-soft);
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 240px;
}

.lfsport-chatbot__messages::-webkit-scrollbar {
	width: 6px;
}
.lfsport-chatbot__messages::-webkit-scrollbar-thumb {
	background: rgba(0, 0, 0, 0.15);
	border-radius: 3px;
}

/* Mensagens */
.lfsport-chatbot__msg {
	display: flex;
	gap: 6px;
	align-items: flex-end;
	animation: lfsc-msg-in 0.3s ease-out;
}

@keyframes lfsc-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.lfsport-chatbot__msg--bot {
	align-self: flex-start;
	max-width: 85%;
}

.lfsport-chatbot__msg--user {
	align-self: flex-end;
	justify-content: flex-end;
	max-width: 80%;
}

.lfsport-chatbot__msg-avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--lfsc-orange);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-bottom: 2px;
}

.lfsport-chatbot__msg-bubble {
	padding: 9px 13px;
	font-size: 13px;
	line-height: 1.45;
	word-wrap: break-word;
}

.lfsport-chatbot__msg--bot .lfsport-chatbot__msg-bubble {
	background: #fff;
	color: var(--lfsc-text);
	border-radius: 14px 14px 14px 4px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lfsport-chatbot__msg--user .lfsport-chatbot__msg-bubble {
	background: var(--lfsc-orange);
	color: #fff;
	border-radius: 14px 14px 4px 14px;
}

.lfsport-chatbot__msg-bubble strong {
	font-weight: 600;
	color: var(--lfsc-dark);
}

.lfsport-chatbot__msg--user .lfsport-chatbot__msg-bubble strong {
	color: #fff;
}

/* Typing indicator */
.lfsport-chatbot__msg--typing .lfsport-chatbot__msg-bubble {
	display: flex;
	gap: 4px;
	padding: 12px 14px;
}

.lfsport-chatbot__dot {
	width: 6px;
	height: 6px;
	background: var(--lfsc-text-muted);
	border-radius: 50%;
	animation: lfsc-dot 1.2s infinite ease-in-out;
}
.lfsport-chatbot__dot:nth-child(2) { animation-delay: 0.15s; }
.lfsport-chatbot__dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes lfsc-dot {
	0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
	30% { opacity: 1; transform: translateY(-3px); }
}

/* =====================================================================
   Botões rápidos (quick replies)
   ===================================================================== */
.lfsport-chatbot__options {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 2px 0 2px 30px;
	animation: lfsc-msg-in 0.3s ease-out;
}

.lfsport-chatbot__option {
	background: #fff;
	border: 1px solid var(--lfsc-orange);
	color: var(--lfsc-orange);
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.1s, color 0.1s, transform 0.08s;
	line-height: 1;
	white-space: nowrap;
}

.lfsport-chatbot__option:hover {
	background: var(--lfsc-orange);
	color: #fff;
}

.lfsport-chatbot__option:active {
	transform: scale(0.97);
}

.lfsport-chatbot__option:focus-visible {
	outline: 2px solid rgba(255, 102, 0, 0.4);
	outline-offset: 2px;
}

.lfsport-chatbot__option:disabled {
	cursor: default;
}

/* Opções antigas ficam esbatidas */
.lfsport-chatbot__options--past .lfsport-chatbot__option {
	opacity: 0.4;
	pointer-events: none;
	border-color: rgba(0, 0, 0, 0.15);
	color: var(--lfsc-text-muted);
}

/* =====================================================================
   Footer
   ===================================================================== */
.lfsport-chatbot__footer {
	padding: 10px 12px;
	background: #fff;
	border-top: 0.5px solid var(--lfsc-border);
	flex-shrink: 0;
}

.lfsport-chatbot__input {
	background: var(--lfsc-bg-soft);
	border-radius: 999px;
	padding: 10px 14px;
	font-size: 12px;
	color: var(--lfsc-text-muted);
	text-align: center;
}


/* =====================================================================
   Mobile
   ===================================================================== */
@media (max-width: 480px) {
	.lfsport-chatbot {
		bottom: 14px;
		left: 14px;
	}
	.lfsport-chatbot__panel {
		width: calc(100vw - 28px);
		max-height: calc(100vh - 120px);
	}
}

/* Em ecrãs muito baixos (landscape mobile) */
@media (max-height: 500px) {
	.lfsport-chatbot__panel {
		max-height: calc(100vh - 90px);
	}
	.lfsport-chatbot__messages {
		min-height: 150px;
	}
}

/* LFSPORT_CHATBOT_WA_OFFSET_v1 */
.lfsport-chatbot { bottom: 95px !important; }
@media (max-width: 480px) { .lfsport-chatbot { bottom: 80px !important; } }
