/*!
 * FVTV Chatbot widget styles — WordPress edition
 * FuerteventuraTV — 2026
 */

#fvtv-chatbot-root {
	--fvtv-primary: #d97706;
	--fvtv-secondary: #0891b2;
	--fvtv-bg: #ffffff;
	--fvtv-text: #1f2937;
	--fvtv-muted: #6b7280;
	--fvtv-border: #e5e7eb;
	--fvtv-bubble-user: linear-gradient(135deg, var(--fvtv-primary) 0%, #f59e0b 100%);
	--fvtv-bubble-ai: #f3f4f6;
	--fvtv-shadow: 0 12px 36px rgba(0, 0, 0, .18);
	--fvtv-radius: 18px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--fvtv-text);
	font-size: 14px;
	line-height: 1.45;
}
#fvtv-chatbot-root *,
#fvtv-chatbot-root *::before,
#fvtv-chatbot-root *::after { box-sizing: border-box; }

.fvtv-toggle {
	position: fixed;
	bottom: 28px;
	width: 64px; height: 64px;
	border: 0; border-radius: 50%;
	background: linear-gradient(135deg, var(--fvtv-primary) 0%, #c41a25 100%);
	color: #fff; font-size: 28px; cursor: pointer;
	box-shadow: var(--fvtv-shadow); z-index: 9998;
	display: flex; align-items: center; justify-content: center;
	transition: transform .2s ease;
	padding: 0;
}
.fvtv-toggle:hover { transform: scale(1.08); }
.fvtv-toggle:focus-visible { outline: 3px solid #1e3a8a; outline-offset: 3px; }
.fvtv-toggle.fvtv-pos-right { right: 28px; }
.fvtv-toggle.fvtv-pos-left  { left: 28px; }

.fvtv-chat {
	position: fixed;
	bottom: 100px;
	width: 380px; max-width: calc(100vw - 32px);
	height: 560px; max-height: calc(100vh - 120px);
	background: var(--fvtv-bg);
	border-radius: var(--fvtv-radius);
	box-shadow: var(--fvtv-shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 9999;
	animation: fvtvOpen .28s cubic-bezier(.34, 1.56, .64, 1);
}
#fvtv-chatbot-root.fvtv-pos-right .fvtv-chat { right: 28px; transform-origin: bottom right; }
#fvtv-chatbot-root.fvtv-pos-left  .fvtv-chat { left: 28px;  transform-origin: bottom left; }
.fvtv-chat.open { display: flex; }
@keyframes fvtvOpen { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fvtv-header {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 14px;
	background: linear-gradient(135deg, var(--fvtv-primary) 0%, var(--fvtv-secondary) 100%);
	color: #fff;
}
.fvtv-avatar {
	width: 38px; height: 38px; border-radius: 50%;
	background: rgba(255,255,255,.25);
	display: flex; align-items: center; justify-content: center;
	font-size: 18px;
}
.fvtv-title { flex: 1; min-width: 0; }
.fvtv-title strong { display:block; font-size: 14px; }
.fvtv-title small  { font-size: 11px; opacity: .85; }
.fvtv-lang { display: flex; gap: 4px; }
.fvtv-lang button {
	background: rgba(255,255,255,.18); color: #fff; border: 0;
	padding: 4px 8px; border-radius: 6px; font-size: 11px; cursor: pointer; font-weight: 600;
}
.fvtv-lang button.active { background: #fff; color: var(--fvtv-primary); }
.fvtv-lang button:focus-visible { outline: 2px solid #fff; }
.fvtv-close {
	background: transparent; color: #fff; border: 0; cursor: pointer;
	width: 28px; height: 28px; font-size: 16px;
}
.fvtv-close:hover { background: rgba(255,255,255,.18); border-radius: 6px; }

.fvtv-news {
	background: #fef3c7; color: #92400e;
	font-size: 12px; padding: 8px 14px;
	overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
	border-bottom: 1px solid var(--fvtv-border);
}
.fvtv-news a { color: #92400e; font-weight: 600; }

.fvtv-msgs {
	flex: 1; overflow-y: auto;
	padding: 14px;
	display: flex; flex-direction: column; gap: 8px;
	background: #fafafa;
}
.fvtv-bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	word-wrap: break-word;
	white-space: pre-wrap;
}
.fvtv-bubble a { color: var(--fvtv-secondary); text-decoration: underline; }
.fvtv-user {
	align-self: flex-end;
	background: var(--fvtv-bubble-user);
	color: #fff;
	border-bottom-right-radius: 4px;
}
.fvtv-assistant {
	align-self: flex-start;
	background: var(--fvtv-bubble-ai);
	color: var(--fvtv-text);
	border-bottom-left-radius: 4px;
}
.fvtv-typing { align-self: flex-start; background: var(--fvtv-bubble-ai); display: flex; gap: 4px; padding: 12px 14px; }
.fvtv-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--fvtv-muted);
	animation: fvtvBounce 1.2s infinite ease-in-out;
}
.fvtv-typing span:nth-child(2) { animation-delay: .15s; }
.fvtv-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes fvtvBounce { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.fvtv-quick {
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 8px 14px 0 14px;
	background: #fafafa;
}
.fvtv-chip {
	background: #fff; color: var(--fvtv-secondary);
	border: 1px solid var(--fvtv-border);
	border-radius: 999px;
	padding: 5px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.fvtv-chip:hover { background: var(--fvtv-secondary); color: #fff; border-color: var(--fvtv-secondary); }

.fvtv-input {
	display: flex; gap: 6px;
	padding: 10px 12px; border-top: 1px solid var(--fvtv-border);
	background: #fff;
}
.fvtv-textarea {
	flex: 1; border: 1px solid var(--fvtv-border); border-radius: 18px;
	padding: 8px 14px; font-size: 14px; resize: none; max-height: 96px;
	font-family: inherit; line-height: 1.4; color: var(--fvtv-text);
	background: #fff;
}
.fvtv-textarea:focus { outline: 2px solid var(--fvtv-secondary); outline-offset: 0; }
.fvtv-send {
	background: linear-gradient(135deg, var(--fvtv-primary) 0%, #c41a25 100%);
	color: #fff; border: 0; border-radius: 18px; padding: 0 16px;
	cursor: pointer; font-weight: 600; font-size: 13px;
}
.fvtv-send:hover { filter: brightness(1.08); }
.fvtv-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
	.fvtv-chat {
		width: calc(100vw - 16px);
		height: calc(100vh - 120px);
		bottom: 88px;
	}
	#fvtv-chatbot-root.fvtv-pos-right .fvtv-chat { right: 8px; }
	#fvtv-chatbot-root.fvtv-pos-left  .fvtv-chat { left: 8px; }
	.fvtv-toggle { width: 56px; height: 56px; font-size: 24px; bottom: 16px; }
	.fvtv-toggle.fvtv-pos-right { right: 16px; }
	.fvtv-toggle.fvtv-pos-left  { left: 16px; }
}
