/* Ask ITU AI — floating launcher button + bottom-sheet drawer (vanilla) */

:root {
	--ask-itu-ai-accent: #1ea7e1;
	--ask-itu-ai-duration: 320ms;
	--ask-itu-ai-drawer-radius: 16px;
}

/* ---------------------------------------------------------------- Launcher */

.ask-itu-ai-launcher-wrap {
	position: fixed;
	right: 10px;
	bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 20px;
	max-width: calc(100vw - 20px);
	line-height: 1;
}

/* Round icon button. */
.ask-itu-ai-launcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	padding: 0;
	border: 1px solid var(--ask-itu-ai-accent);
	border-radius: 50%;
    background: radial-gradient(
                circle,
                color-mix(in srgb, var(--ask-itu-ai-accent) 50%, white),  /* center */
                var(--ask-itu-ai-accent)                                  /* edge */
        );
	/* background: var(--ask-itu-ai-accent); */
	box-shadow: 0 4px 10px rgba(30, 167, 225, 0.15);
	cursor: pointer;
	transition: box-shadow 200ms ease, transform 200ms ease;
	-webkit-appearance: none;
	appearance: none;
}

.ask-itu-ai-launcher:hover,
.ask-itu-ai-launcher:focus-visible {
	box-shadow: 0 6px 14px rgba(30, 167, 225, 0.22);
	transform: translateY(-2px);
}

.ask-itu-ai-launcher:focus-visible {
	outline: 3px solid var(--ask-itu-ai-accent);
	outline-offset: 3px;
}

/* Spinning 4-point star. */
.ask-itu-ai-launcher__star {
	position: relative;
	z-index: 1;
	width: 40px;
	height: 40px;
	color: #fff;
	animation: ask-itu-ai-spin180 10s linear infinite;
}

/* Label under the button. Being the widest child it sets the wrap's width
   against the right margin/padding; the button centres over it. */
.ask-itu-ai-launcher__label {
	max-width: 100%;
	font-size: 19px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0.01em;
	text-align: center;
	white-space: nowrap;
}

/* Adaptive colour, toggled from JS based on the background behind the label:
   black over light backgrounds, white over dark or coloured ones. */
.ask-itu-ai-launcher__label,
.ask-itu-ai-launcher__label.is-on-light {
	color: #000;
	text-shadow: none;
}

.ask-itu-ai-launcher__label.is-on-dark {
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Busy/mixed backdrop (e.g. a photo blending pale and dark areas): white
   with a stronger dark halo, subtitle-style, so no pixel behind defeats it. */
.ask-itu-ai-launcher__label.is-on-busy {
	color: #fff;
	text-shadow:
		0 1px 2px rgba(0, 0, 0, 0.6),
		0 0 10px rgba(0, 0, 0, 0.45);
}

@keyframes ask-itu-ai-spin180 {
	0%   { transform: rotate(0deg); }
	5%   { transform: rotate(180deg); }
	50%  { transform: rotate(180deg); }
	55%  { transform: rotate(360deg); }
	100% { transform: rotate(360deg); }
}

/* --------------------------------------------------------- Drawer (sheet) */

.ask-itu-ai-drawer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	height: 80vh;
	height: 80dvh;
	max-height: 80vh;
	max-height: 80dvh;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--ask-itu-ai-drawer-radius) var(--ask-itu-ai-drawer-radius) 0 0;
	background: #fff;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	transform: translateY(100%);
	transition: transform var(--ask-itu-ai-duration) cubic-bezier(0.32, 0.72, 0, 1);
}

.ask-itu-ai-drawer.is-open {
	transform: none;
}

.ask-itu-ai-drawer::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

/* iframe fills everything below the top bar. */
.ask-itu-ai-drawer__body {
	position: relative;
	flex: 1;
	min-height: 0;
}

.ask-itu-ai-drawer__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Top bar with the action icons, above the iframe (no overlap). The
   background mirrors the assistant UI inside the iframe: the sidebar tint
   over the left segment (same width as the iframe's sidebar), the main
   surface colour everywhere else, so the bar reads as part of the app. */
.ask-itu-ai-drawer__actions {
	--ask-itu-ai-sidebar-w: clamp(14rem, 23.8%, 22.75rem);
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	height: 48px;
	padding: 0 12px;
	background-color: rgb(233 244 248);
	background-image: linear-gradient(
		to right,
		#d9edf585 0,
		#d9edf585 var(--ask-itu-ai-sidebar-w),
		transparent var(--ask-itu-ai-sidebar-w)
	);
}

.ask-itu-ai-drawer__newtab,
.ask-itu-ai-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #1a1a1a;
	font-size: 17px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease;
}

.ask-itu-ai-drawer__newtab svg {
	display: block;
	width: 15px;
	height: 15px;
}

.ask-itu-ai-drawer__newtab:hover,
.ask-itu-ai-drawer__newtab:focus-visible,
.ask-itu-ai-drawer__close:hover,
.ask-itu-ai-drawer__close:focus-visible {
	background: rgba(0, 0, 0, 0.08);
	color: #000;
}

.ask-itu-ai-drawer__fallback {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5em;
	background: #fff;
	text-align: center;
	padding: 1em;
}

.ask-itu-ai-drawer__fallback[hidden] {
	display: none;
}

/* Scroll lock while the drawer is open. */
body.ask-itu-ai-open {
	overflow: hidden;
}
@media screen and (max-width: 720px) {
      .ask-itu-ai-launcher {
              max-width: 64px;
              max-height: 64px;
      }
      .ask-itu-ai-launcher__star {
          max-width: 32px;
          max-height: 32px;
      }
}
@media (prefers-reduced-motion: reduce) {
	.ask-itu-ai-launcher,
	.ask-itu-ai-launcher__star,
	.ask-itu-ai-drawer {
		transition: none;
		animation: none;
	}
}
