/* AG Church virtual assistant — self-contained FAQ chatbot widget */

/* Google auto-injects its reCAPTCHA badge fixed to the bottom-right of
   every page, where it collides with the chat toggle button. Google's
   own docs allow repositioning it via CSS as long as it stays visible
   (only hiding it requires adding the branding text elsewhere), so we
   move it to the bottom-left instead, clear of the toggle button.
   Google normally keeps only its icon on screen by shifting the wider
   "protected by reCAPTCHA" pill off-screen via a negative right offset
   - anchoring from the left instead undoes that trick, so we clip the
   width ourselves to keep just the icon visible, regardless of side. */
.grecaptcha-badge {
	left: 4px !important;
	right: auto !important;
	width: 70px !important;
	overflow: hidden !important;
}

#agc-chat-toggle {
	position: fixed;
	right: 18px;
	bottom: 18px;
	width: 62px;
	height: 62px;
	background: none;
	border: none;
	cursor: pointer;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	filter: drop-shadow(0 5px 12px rgba(0,0,0,0.3));
	transition: transform .15s ease;
}
#agc-chat-toggle:hover { transform: scale(1.06); }
#agc-chat-toggle svg { width: 100%; height: 100%; }
#agc-chat-toggle .agc-close-icon { display: none; width: 42px; height: 42px; }
#agc-chat-toggle.agc-open .agc-chat-icon { display: none; }
#agc-chat-toggle.agc-open .agc-close-icon { display: block; }

#agc-chat-window {
	position: fixed;
	right: 20px;
	bottom: 88px;
	width: 340px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 140px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 35px rgba(0,0,0,0.28);
	z-index: 9999;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: 'Lato', Arial, sans-serif;
}
#agc-chat-window.agc-visible { display: flex; }

#agc-chat-header {
	background: #B01933;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}
#agc-chat-header .agc-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
#agc-chat-header .agc-avatar svg { width: 18px; height: 18px; }
#agc-chat-header .agc-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
}
#agc-chat-header .agc-subtitle {
	font-size: 11px;
	opacity: 0.85;
	line-height: 1.2;
}
#agc-chat-restart {
	margin-left: auto;
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.14);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background .15s ease;
}
#agc-chat-restart:hover { background: rgba(255,255,255,0.28); }
#agc-chat-restart svg { width: 15px; height: 15px; }

#agc-chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f7f4f5;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.agc-msg {
	max-width: 85%;
	font-size: 12.5px;
	line-height: 1.4;
	padding: 8px 11px;
	border-radius: 14px;
	word-wrap: break-word;
	white-space: pre-line;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
.agc-msg-bot {
	align-self: flex-start;
	background: #fff;
	color: #333;
	border: 1px solid #eadfe1;
	border-bottom-left-radius: 3px;
}
.agc-msg-user {
	align-self: flex-end;
	background: #B01933;
	color: #fff;
	border-bottom-right-radius: 3px;
}
.agc-msg ul { margin: 0 0 8px; padding-left: 18px; }
.agc-msg li { margin-bottom: 3px; }
.agc-cite {
	border-left: 3px solid #B01933;
	background: #faf3f4;
	padding: 6px 10px;
	margin-top: 6px;
	font-size: 11.5px;
	color: #7a6265;
	border-radius: 0 6px 6px 0;
}
.agc-cite strong { color: #B01933; }

.agc-sermon {
	display: block;
	text-decoration: none;
	border: 1px solid #eadfe1;
	border-radius: 10px;
	overflow: hidden;
	margin-top: 6px;
}
.agc-sermon img { width: 100%; height: 100px; object-fit: cover; display: block; }
.agc-sermon span {
	display: block;
	padding: 8px 10px;
	font-size: 12.5px;
	font-weight: 700;
	color: #2b2224;
	line-height: 1.35;
}
.agc-sermon:hover span { color: #B01933; }

.agc-locate-btn {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 700;
	color: #B01933;
	background: #fff;
	border: 1px solid #B01933;
	border-radius: 20px;
	padding: 5px 12px;
	cursor: pointer;
}
.agc-locate-btn:hover { background: #B01933; color: #fff; }
.agc-locate-btn:disabled { opacity: .6; cursor: default; }

.agc-msg-link {
	display: inline-block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 700;
	color: #B01933;
	text-decoration: none;
	border: 1px solid #B01933;
	border-radius: 20px;
	padding: 5px 12px;
}

.agc-svc { display: flex; flex-direction: column; }
.agc-svc-day {
	font-size: 11px;
	font-weight: 700;
	color: #B01933;
	text-transform: uppercase;
	letter-spacing: .05em;
	margin: 10px 0 3px;
}
.agc-svc-day:first-child { margin-top: 0; }
.agc-svc-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 3px 0;
	border-bottom: 1px dashed #ecdfe1;
	font-size: 12.5px;
}
.agc-svc-row:last-of-type { border-bottom: none; }
.agc-svc-lang { color: #7a6a6d; }
.agc-svc-time { font-weight: 700; color: #2b2224; white-space: nowrap; }

.agc-msg p { margin: 0 0 8px; }
.agc-msg p:last-child { margin-bottom: 0; }
.agc-info { display: flex; flex-direction: column; gap: 10px; }
.agc-info-row { display: flex; align-items: flex-start; gap: 9px; }
.agc-info-icon {
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	margin-top: 2px;
	color: #B01933;
}
.agc-info-icon svg { width: 100%; height: 100%; display: block; }
.agc-info-label {
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #9a8285;
	margin-bottom: 1px;
}
.agc-info-value { font-size: 13px; color: #2b2224; line-height: 1.4; }
.agc-info-link { color: #2b2224; text-decoration: none; }
.agc-info-link:hover { color: #B01933; text-decoration: underline; }

.agc-actions { display: flex; gap: 6px; margin-top: 8px; }
.agc-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11.5px;
	font-weight: 700;
	color: #B01933;
	background: #fff;
	border: 1px solid #B01933;
	border-radius: 20px;
	padding: 5px 11px;
	cursor: pointer;
}
.agc-action-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.agc-action-btn:hover { background: #B01933; color: #fff; }

.agc-msg-link:hover { background: #B01933; color: #fff; }

.agc-form { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.agc-form-input {
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 12.5px;
	outline: none;
	font-family: inherit;
	color: #2b2224;
	width: 100%;
	box-sizing: border-box;
}
.agc-form-input:focus { border-color: #B01933; }
.agc-form-input.agc-form-invalid { border-color: #B01933; background: #fdf3f4; }
.agc-form-submit {
	background: #B01933;
	color: #fff;
	border: none;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	margin-top: 2px;
}
.agc-form-submit:hover { background: #8f1429; }
.agc-form-submit:disabled { opacity: .6; cursor: default; }
.agc-form-error { color: #B01933; font-size: 11.5px; margin-top: 1px; }
.agc-form-note { font-size: 10.5px; color: #9a8285; margin-top: 1px; }
.agc-form-success { font-size: 12.5px; color: #2b2224; }

.agc-quick-replies {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 14px 12px;
	flex-shrink: 0;
	background: #f7f4f5;
}
.agc-chip {
	background: #fff;
	border: 1px solid #d9c3c8;
	color: #B01933;
	font-size: 12px;
	border-radius: 16px;
	padding: 6px 12px;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.agc-chip:hover { background: #B01933; color: #fff; border-color: #B01933; }

#agc-chat-input-wrap { position: relative; flex-shrink: 0; }
.agc-suggest {
	display: none;
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 100%;
	margin-bottom: 4px;
	background: #fff;
	border: 1px solid #eadfe1;
	border-radius: 10px;
	box-shadow: 0 -6px 18px rgba(0,0,0,0.14);
	overflow: hidden;
	z-index: 10;
}
.agc-suggest.agc-suggest-visible { display: block; }
.agc-suggest-item {
	padding: 8px 12px;
	font-size: 12.5px;
	color: #2b2224;
	cursor: pointer;
	border-bottom: 1px solid #f3ecec;
}
.agc-suggest-item:last-child { border-bottom: none; }
.agc-suggest-item:hover { background: #f7f0f1; }

#agc-chat-input-row {
	display: flex;
	border-top: 1px solid #eee;
	padding: 8px;
	gap: 8px;
	flex-shrink: 0;
	background: #fff;
}
#agc-chat-input {
	flex: 1;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 9px 14px;
	font-size: 13px;
	outline: none;
	color: #B01933;
}
#agc-chat-input:focus { border-color: #B01933; }
#agc-chat-send {
	background: #B01933;
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
#agc-chat-send svg { width: 16px; height: 16px; }
#agc-chat-send:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
	#agc-chat-window {
		right: 16px;
		left: 16px;
		width: auto;
		bottom: 80px;
		height: calc(100vh - 110px);
		max-height: calc(100vh - 110px);
	}
	#agc-chat-toggle { right: 16px; }
}
