/* =========================================================
   GIREMRUS — AI Engineer-Consultant Widget
   Uses --ai-* tokens from girem-design-system.css
   ========================================================= */

/* ---------- Floating trigger button ---------- */
.girem-ai__trigger {
	-webkit-appearance: none !important;
	appearance: none !important;
	position: fixed !important;
	bottom: 20px !important;
	right: 20px !important;
	/* Above the Cookie Notice plugin banner (#cookie-notice, z-index: 100000) so it's never hidden behind it. */
	z-index: 100010 !important;
	display: flex !important;
	align-items: center !important;
	gap: 10px;
	padding: 15px 24px 15px 18px !important;
	margin: 0 !important;
	background: #2563eb !important;
	color: #fff !important;
	border: none !important;
	outline: none !important;
	border-radius: 50px !important;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 8px 28px rgba(37, 99, 235, .55), 0 2px 8px rgba(0, 0, 0, .12) !important;
	transition: transform 0.2s, box-shadow 0.2s;
}
.girem-ai__trigger:hover {
	background: #1d4ed8 !important;
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(37, 99, 235, .6), 0 2px 8px rgba(0, 0, 0, .12) !important;
}
.girem-ai__trigger-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	flex-shrink: 0;
	color: #fff;
}
.girem-ai__trigger-icon svg { display: block; width: 26px; height: 26px; }
.girem-ai__trigger-label { line-height: 1; color: #fff; }
.girem-ai__trigger-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	border: 2px solid #fff;
}
.girem-ai__trigger.is-open .girem-ai__trigger-badge { display: none; }

/* ---------- Backdrop ---------- */
.girem-ai__backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .35);
	z-index: 100011;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s;
}
.girem-ai[aria-hidden="false"] .girem-ai__backdrop {
	opacity: 1;
	pointer-events: auto;
}

/* ---------- Panel ---------- */
.girem-ai__panel {
	position: fixed;
	bottom: 0;
	right: 0;
	z-index: 100012;
	width: 380px;
	max-width: 100vw;
	max-height: 92vh;
	background: #ffffff;
	border-radius: 20px 20px 0 0;
	box-shadow: -4px 0 40px rgba(0, 0, 0, .18);
	display: flex;
	flex-direction: column;
	transform: translateY(105%);
	transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
	overflow: hidden;
}
.girem-ai[aria-hidden="false"] .girem-ai__panel {
	transform: translateY(0);
}

/* ---------- Header ---------- */
.girem-ai__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: #2563eb;
	color: #fff;
	flex-shrink: 0;
}
.girem-ai__avatar {
	position: relative;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
}
.girem-ai__avatar svg { width: 44px; height: 44px; border-radius: 50%; }
.girem-ai__online-dot {
	position: absolute;
	bottom: 2px;
	right: 2px;
	width: 10px;
	height: 10px;
	background: #22c55e;
	border-radius: 50%;
	border: 2px solid #2563eb;
}
.girem-ai__header-info { flex: 1; min-width: 0; }
.girem-ai__name {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}
.girem-ai__status {
	display: block;
	font-size: 12px;
	opacity: .85;
	line-height: 1.3;
}
.girem-ai__close {
	-webkit-appearance: none !important;
	appearance: none !important;
	background: rgba(255, 255, 255, .15) !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	border-radius: 8px !important;
	width: 32px !important;
	height: 32px !important;
	min-height: 32px !important;
	padding: 0 !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer;
	color: #fff !important;
	flex-shrink: 0;
	transition: background 0.15s;
}
.girem-ai__close:hover { background: rgba(255, 255, 255, .30) !important; }
.girem-ai__close svg { display: block; width: 14px; height: 14px; }

/* ---------- Body ---------- */
.girem-ai__body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overscroll-behavior: contain;
}

/* ---------- Bubbles ---------- */
.girem-ai__bubble {
	max-width: 85%;
	padding: 12px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.5;
}
.girem-ai__bubble p { margin: 0 0 6px; }
.girem-ai__bubble p:last-child { margin-bottom: 0; }
.girem-ai__bubble--bot {
	background: #f1f5f9;
	color: #0f172a;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}
.girem-ai__bubble--user {
	background: #2563eb;
	color: #fff;
	border-bottom-right-radius: 4px;
	align-self: flex-end;
}
.girem-ai__bubble--success {
	background: #d1fae5;
	color: #065f46;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}
.girem-ai__bubble--error {
	background: #fee2e2;
	color: #991b1b;
	border-bottom-left-radius: 4px;
	align-self: flex-start;
}

/* ---------- Quick prompts ---------- */
.girem-ai__quick-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.girem-ai__quick {
	text-align: left;
	background: #ffffff;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	padding: 8px 12px;
	font-size: 13px;
	color: #475569;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
	font-family: inherit;
}
.girem-ai__quick:hover {
	border-color: #2563eb;
	background: #ede9ff;
	color: #2563eb;
}

/* ---------- Messages stream ---------- */
.girem-ai__messages {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ---------- Form ---------- */
.girem-ai__form {
	flex-shrink: 0;
	padding: 12px 16px 16px;
	border-top: 1px solid #e2e8f0;
	background: #ffffff;
}
.girem-ai__form-row {
	display: flex;
	align-items: flex-end;
	gap: 8px;
}
.girem-ai__upload {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f1f5f9;
	border-radius: 8px;
	cursor: pointer;
	color: #64748b;
	transition: background 0.15s, color 0.15s;
	margin-bottom: 2px;
}
.girem-ai__upload:hover {
	background: #ede9ff;
	color: #2563eb;
}
.girem-ai__upload svg { width: 18px; height: 18px; }
.girem-ai__file-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.girem-ai__textarea {
	flex: 1;
	min-height: 40px;
	max-height: 120px;
	padding: 9px 12px;
	border: 1.5px solid #cbd5e1;
	border-radius: 12px;
	font-size: 14px;
	font-family: inherit;
	resize: none;
	outline: none;
	overflow-y: auto;
	line-height: 1.45;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.girem-ai__textarea:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.girem-ai__send {
	-webkit-appearance: none !important;
	appearance: none !important;
	flex-shrink: 0;
	width: 40px !important;
	height: 40px !important;
	min-height: 40px !important;
	padding: 0 !important;
	margin: 0 0 2px !important;
	background: #2563eb !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	border-radius: 10px !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer;
	color: #fff !important;
	transition: background 0.15s, transform 0.1s;
}
.girem-ai__send svg { display: block; width: 18px; height: 18px; }
.girem-ai__send:hover { background: #1d4ed8 !important; }
.girem-ai__send:active { transform: scale(0.92); }
.girem-ai__send:disabled { opacity: .5; cursor: not-allowed; }

/* File preview */
.girem-ai__file-preview {
	margin-top: 8px;
	display: flex;
	gap: 8px;
	align-items: center;
	font-size: 12px;
	color: #64748b;
}
.girem-ai__file-preview img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e2e8f0;
}

/* Disclaimer */
.girem-ai__disclaimer {
	margin: 8px 0 0;
	font-size: 11px;
	color: #94a3b8;
	line-height: 1.4;
}
.girem-ai__disclaimer a { color: #64748b; text-decoration: underline; }

/* ---------- Loading dots ---------- */
.girem-ai__typing {
	display: flex;
	gap: 4px;
	align-items: center;
	padding: 10px 14px;
	background: #f1f5f9;
	border-radius: 16px;
	border-bottom-left-radius: 4px;
	width: fit-content;
}
.girem-ai__typing span {
	display: block;
	width: 6px;
	height: 6px;
	background: #94a3b8;
	border-radius: 50%;
	animation: girem-ai-bounce 1.2s infinite;
}
.girem-ai__typing span:nth-child(2) { animation-delay: .2s; }
.girem-ai__typing span:nth-child(3) { animation-delay: .4s; }
@keyframes girem-ai-bounce {
	0%, 80%, 100% { transform: translateY(0); opacity: .5; }
	40% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.girem-ai__panel {
		width: 100vw;
		border-radius: 20px 20px 0 0;
	}
	.girem-ai__trigger {
		bottom: 16px;
		right: 16px;
		padding: 10px 16px 10px 12px;
	}
}

