/* =============================================================================
   ISCAE Chatbot — Styles  v1.1.0
   Palette : #0B1F4B navy | #DAB115 gold | #FEF9E7 warm light
   ============================================================================= */

#iscae-chatbot-wrapper {
	--iscae-navy      : #0B1F4B;
	--iscae-navy-mid  : #162d6e;
	--iscae-navy-dark : #071538;
	--iscae-gold      : #DAB115;
	--iscae-gold-dark : #b8940f;
	--iscae-warm      : #FEF9E7;
	--iscae-warm-dark : #f0e8c8;
	--iscae-text      : #1a1a1a;
	--iscae-muted     : #6b6349;

	position: fixed !important;
	bottom: 24px !important;
	right: 24px !important;
	top: auto !important;
	left: auto !important;
	z-index: 2147483647 !important;
	font-family: 'Segoe UI', Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	transform: none !important;
	filter: none !important;
	will-change: unset !important;
}

/* --------------------------------------------------------------------------
   Animated hint bubble
   -------------------------------------------------------------------------- */

#iscae-chatbot-bubble {
	position: absolute;
	bottom: 148px;
	right: 10px;
	width: 220px;
	background: #ffffff;
	border: 2px solid var(--iscae-gold);
	border-radius: 14px;
	padding: 12px 15px;
	padding-right: 28px;
	box-shadow: 0 6px 24px rgba(11, 31, 75, 0.18);
	cursor: pointer;
	animation:
		iscae-bubble-in    0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s both,
		iscae-bubble-float 3.2s ease-in-out 2.3s infinite;
	transform-origin: bottom right;
}

#iscae-bubble-close {
	position: absolute;
	top: 6px;
	right: 8px;
	font-size: 11px;
	line-height: 1;
	color: var(--iscae-muted);
	cursor: pointer;
	padding: 2px 5px;
	border-radius: 4px;
	transition: color 0.15s, background 0.15s;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

#iscae-bubble-close:hover {
	color: var(--iscae-navy);
	background: var(--iscae-warm-dark);
}

#iscae-bubble-close:focus-visible {
	outline: 2px solid var(--iscae-gold);
	outline-offset: 2px;
	border-radius: 3px;
}

#iscae-bubble-arrow {
	position: absolute;
	bottom: -14px;
	right: 68px;
	width: 0;
	height: 0;
	border-left: 12px solid transparent;
	border-right: 12px solid transparent;
	border-top: 14px solid var(--iscae-gold);
}

#iscae-bubble-arrow::after {
	content: '';
	position: absolute;
	top: -15px;
	left: -10px;
	width: 0;
	height: 0;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-top: 11px solid #ffffff;
}

#iscae-bubble-text {
	font-size: 13px;
	color: var(--iscae-navy);
	line-height: 1.55;
	display: block;
}

#iscae-bubble-text strong {
	color: var(--iscae-gold);
	font-weight: 700;
}

#iscae-chatbot-bubble::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #22c55e;
	border-radius: 50%;
	margin-right: 6px;
	vertical-align: middle;
	animation: iscae-pulse-dot 1.8s ease-in-out 2.3s infinite;
}

@keyframes iscae-bubble-in {
	from { opacity: 0; transform: scale(0.7) translateY(12px); }
	to   { opacity: 1; transform: scale(1)   translateY(0); }
}

@keyframes iscae-bubble-float {
	0%, 100% { transform: translateY(0); }
	50%       { transform: translateY(-5px); }
}

@keyframes iscae-pulse-dot {
	0%, 100% { opacity: 1;   transform: scale(1); }
	50%       { opacity: 0.5; transform: scale(1.3); }
}

#iscae-chatbot-bubble.iscae-bubble-hidden {
	animation: iscae-bubble-out 0.25s ease forwards;
	pointer-events: none;
}

#iscae-chatbot-bubble.iscae-bubble-chat-open {
	visibility: hidden;
	pointer-events: none;
}

@keyframes iscae-bubble-out {
	to { opacity: 0; transform: scale(0.85) translateY(8px); }
}

/* --------------------------------------------------------------------------
   Floating toggle
   -------------------------------------------------------------------------- */

#iscae-chatbot-toggle {
	width: 150px;
	height: 150px;
	border-radius: 50%;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}

#iscae-chatbot-toggle:hover {
	transform: scale(1.06);
}

#iscae-chatbot-toggle:focus-visible {
	outline: 3px solid var(--iscae-gold);
	outline-offset: 4px;
	border-radius: 50%;
}

#iscae-chatbot-icon {
	width: 150px;
	height: 150px;
	border-radius: 50%;
	object-fit: contain;
	display: block;
	background: transparent !important;
}

/* --------------------------------------------------------------------------
   Chat window
   -------------------------------------------------------------------------- */

#iscae-chatbot-wrapper #iscae-chatbot-window {
	display: none;
	flex-direction: column;
	position: absolute;
	bottom: 165px;
	right: 0;
	width: 420px;
	max-width: calc(100vw - 32px);
	max-height: 600px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 48px rgba(11, 31, 75, 0.28);
	overflow: hidden;
	animation: iscae-slide-up 0.22s ease;
}

#iscae-chatbot-wrapper #iscae-chatbot-window.iscae-open {
	display: flex;
}

@keyframes iscae-slide-up {
	from { opacity: 0; transform: translateY(14px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

#iscae-chatbot-header {
	background: linear-gradient(135deg, var(--iscae-navy) 0%, var(--iscae-navy-mid) 100%);
	padding: 16px 16px 16px 18px;
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
	border-bottom: 3px solid var(--iscae-gold);
	position: relative;
}

#iscae-header-icon {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: transparent !important;
	border: 2.5px solid var(--iscae-gold);
	box-shadow: 0 2px 10px rgba(218, 177, 21, 0.35);
}

#iscae-header-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}

#iscae-header-sub {
	font-size: 12px;
	font-weight: 400;
	color: rgba(254, 249, 231, 0.75);
	letter-spacing: 0.3px;
	line-height: 1.3;
}

#iscae-header-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--iscae-warm);
	letter-spacing: 0.2px;
	line-height: 1.2;
}

#iscae-chatbot-close {
	color: var(--iscae-warm);
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
	padding: 4px 8px;
	opacity: 0.7;
	transition: opacity 0.15s, color 0.15s;
	outline: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	flex-shrink: 0;
}

#iscae-chatbot-close:hover {
	opacity: 1;
	color: var(--iscae-gold);
}

#iscae-chatbot-close:focus-visible {
	outline: 2px solid var(--iscae-gold);
	border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Chat body — always visible inside an open window
   -------------------------------------------------------------------------- */

#iscae-chatbot-wrapper #iscae-chatbot-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	overflow: hidden;
}

/* Messages scroll area */
#iscae-chatbot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: var(--iscae-warm);
	min-height: 220px;
	max-height: 400px;
	scroll-behavior: smooth;
}

#iscae-chatbot-messages::-webkit-scrollbar {
	width: 5px;
}
#iscae-chatbot-messages::-webkit-scrollbar-thumb {
	background: var(--iscae-gold-dark);
	border-radius: 4px;
	opacity: 0.5;
}

/* Message bubbles */
#iscae-chatbot-wrapper .iscae-msg {
	max-width: 82%;
	padding: 11px 15px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.6;
	word-break: break-word;
}

#iscae-chatbot-wrapper .iscae-msg-bot {
	background: #ffffff;
	color: var(--iscae-navy);
	border: 1px solid var(--iscae-warm-dark);
	align-self: flex-start;
	border-bottom-left-radius: 3px;
	box-shadow: 0 1px 4px rgba(11, 31, 75, 0.07);
}

#iscae-chatbot-wrapper .iscae-msg-user {
	background: var(--iscae-navy);
	color: var(--iscae-warm);
	align-self: flex-end;
	border-bottom-right-radius: 3px;
	box-shadow: 0 1px 5px rgba(11, 31, 75, 0.2);
}

#iscae-chatbot-wrapper .iscae-msg-typing {
	background: var(--iscae-warm-dark);
	color: var(--iscae-muted);
	align-self: flex-start;
	border-bottom-left-radius: 3px;
	font-style: italic;
	letter-spacing: 3px;
}

/* --------------------------------------------------------------------------
   Input area
   -------------------------------------------------------------------------- */

#iscae-chatbot-input-area {
	display: flex;
	align-items: flex-end;
	padding: 12px 14px;
	background: #ffffff;
	border-top: 2px solid var(--iscae-warm-dark);
	gap: 10px;
	flex-shrink: 0;
}

#iscae-chatbot-input {
	flex: 1;
	border: 1.5px solid var(--iscae-warm-dark);
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	outline: none;
	max-height: 100px;
	overflow-y: auto;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	line-height: 1.45;
	color: var(--iscae-navy);
	background: var(--iscae-warm);
}

#iscae-chatbot-input:focus {
	border-color: var(--iscae-gold);
	box-shadow: 0 0 0 3px rgba(218, 177, 21, 0.18);
}

#iscae-chatbot-input:disabled {
	background: var(--iscae-warm-dark);
	color: var(--iscae-muted);
	cursor: not-allowed;
}

/* Send button — gold circle with navy arrow */
#iscae-chatbot-send {
	width: 42px;
	height: 42px;
	background: var(--iscae-gold);
	color: var(--iscae-navy);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.1s ease;
	flex-shrink: 0;
	outline: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	box-shadow: 0 3px 8px rgba(218, 177, 21, 0.4);
}

#iscae-chatbot-send:hover {
	background: var(--iscae-gold-dark);
}

#iscae-chatbot-send:active {
	transform: scale(0.93);
}

#iscae-chatbot-send.iscae-disabled {
	background: var(--iscae-warm-dark);
	color: var(--iscae-muted);
	cursor: not-allowed;
	pointer-events: none;
	box-shadow: none;
}

#iscae-chatbot-send:focus-visible {
	outline: 3px solid var(--iscae-navy);
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Responsive — mobile
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
	#iscae-chatbot-wrapper {
		bottom: 12px !important;
		right: 12px !important;
	}

	#iscae-chatbot-toggle {
		width: 100px;
		height: 100px;
	}

	#iscae-chatbot-icon {
		width: 100px;
		height: 100px;
	}

	#iscae-chatbot-window {
		width: calc(100vw - 24px);
		right: 0;
		bottom: 118px;
		max-height: 55vh;
	}

	#iscae-chatbot-messages {
		max-height: calc(55vh - 160px);
		min-height: 120px;
	}

	#iscae-chatbot-bubble {
		width: 180px;
		font-size: 12px;
	}
}
