/**
 * Humanity Badge — Contact
 * Styles for the Contact page (tabs + chatbot).
 *
 * Color palette intentionally matches BuddyBoss defaults (blues, soft greys)
 * so it blends without theme overrides.
 *
 * Tab switching is CSS-only via radio inputs:
 *   #hb-contact-tab-form:checked  → show .hb-contact__panel--form
 *   #hb-contact-tab-chat:checked  → show .hb-contact__panel--chat
 */

/* ----- Wrapper ----- */
.hb-contact {
	max-width: 800px;
	margin: 2em auto;
	font-family: inherit;
}

/* Hide the radio inputs themselves; they only drive state. */
.hb-contact__tab-radio {
	position: absolute;
	left: -9999px;
}

/* ----- Tab buttons ----- */
.hb-contact__tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid #e0e0e0;
	margin-bottom: 1.5em;
}

.hb-contact__tab {
	padding: 0.85em 1.5em;
	cursor: pointer;
	font-weight: 600;
	color: #666;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	transition: color 0.15s, border-color 0.15s, background 0.15s;
	user-select: none;
}

.hb-contact__tab:hover {
	color: #4f46e5;
	background: #f6f7ff;
}

.hb-contact__tab:focus-visible {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

/* Active tab — driven by the radio :checked state, NEXT sibling selectors. */
#hb-contact-tab-form:checked ~ .hb-contact__tabs label[for="hb-contact-tab-form"],
#hb-contact-tab-chat:checked ~ .hb-contact__tabs label[for="hb-contact-tab-chat"] {
	color: #4f46e5;
	border-bottom-color: #4f46e5;
}

/* ----- Panels ----- */
.hb-contact__panels {
	position: relative;
}

.hb-contact__panel {
	display: none;
	animation: hb-fade-in 0.2s ease-out;
}

#hb-contact-tab-form:checked ~ .hb-contact__panels .hb-contact__panel--form {
	display: block;
}

#hb-contact-tab-chat:checked ~ .hb-contact__panels .hb-contact__panel--chat {
	display: block;
}

@keyframes hb-fade-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ----- Admin / unavailable notice ----- */
.hb-contact__notice {
	padding: 1em 1.25em;
	background: #fff7e6;
	border-left: 4px solid #f5a623;
	border-radius: 4px;
}

/* ----- Chat-with-admin button ----- */
.hb-contact__chat-admin {
	margin-top: 2em;
	padding: 1.25em;
	background: #f6f8fa;
	border-radius: 8px;
}

.hb-contact__chat-admin h3 {
	margin-top: 0;
}

.hb-contact__btn {
	display: inline-block;
	padding: 0.7em 1.4em;
	background: #4f46e5;
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	transition: background 0.15s, transform 0.05s;
}

.hb-contact__btn:hover,
.hb-contact__btn:focus {
	background: #3730a3;
	color: #fff;
	text-decoration: none;
}

.hb-contact__btn:active {
	transform: translateY(1px);
}

/* ----- Chatbot widget ----- */
.hb-chatbot {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	overflow: hidden;
}

.hb-chatbot__header {
	padding: 0.85em 1.25em;
	background: linear-gradient(135deg, #4f46e5, #6366f1);
	color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.6em;
}

.hb-chatbot__avatar {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	object-fit: contain;
	flex: 0 0 auto;
}

/* Title takes the remaining space so the status pill stays hard-right. */
.hb-chatbot__header strong {
	flex: 1 1 auto;
}

.hb-chatbot__status {
	font-size: 0.8em;
	background: rgba(255, 255, 255, 0.2);
	padding: 0.15em 0.55em;
	border-radius: 999px;
}

.hb-chatbot__status::before {
	content: "● ";
	color: #4ade80;
}

.hb-chatbot__log {
	padding: 1.25em;
	min-height: 120px;
	max-height: 320px;
	overflow-y: auto;
	background: #fafafa;
}

.hb-chatbot__bubble {
	display: inline-block;
	max-width: 85%;
	padding: 0.65em 1em;
	margin-bottom: 0.5em;
	border-radius: 16px;
	line-height: 1.4;
	clear: both;
	animation: hb-bubble-pop 0.2s ease-out;
}

.hb-chatbot__bubble--bot {
	background: #fff;
	border: 1px solid #e0e0e0;
	float: left;
	border-top-left-radius: 4px;
	position: relative;
	margin-left: 42px;
}

/* Assistant avatar beside every bot bubble (image comes from the
   --hb-bot-avatar CSS variable set on #hb-chatbot). */
.hb-chatbot__bubble--bot::before {
	content: "";
	position: absolute;
	left: -42px;
	top: 0;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #e0e0e0;
	background-color: #eef0ff;
	background-image: var(--hb-bot-avatar);
	background-size: 26px 26px;
	background-repeat: no-repeat;
	background-position: center;
}

.hb-chatbot__bubble--user {
	background: #4f46e5;
	color: #fff;
	float: right;
	border-top-right-radius: 4px;
}

.hb-chatbot__bubble a {
	color: inherit;
	text-decoration: underline;
}

.hb-chatbot__bubble--user a {
	color: #fff;
}

@keyframes hb-bubble-pop {
	from { opacity: 0; transform: scale(0.95); }
	to   { opacity: 1; transform: scale(1); }
}

/* Clearfix after each bubble */
.hb-chatbot__bubble::after {
	content: "";
	display: table;
	clear: both;
}

/* ----- Question choice buttons ----- */
.hb-chatbot__choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
	padding: 1em 1.25em;
	background: #fff;
	border-top: 1px solid #e0e0e0;
}

.hb-chatbot__choice {
	padding: 0.6em 1em;
	background: #f0f1ff;
	color: #4f46e5;
	border: 1px solid #d1d5fa;
	border-radius: 999px;
	cursor: pointer;
	font: inherit;
	font-size: 0.92em;
	transition: background 0.15s, transform 0.05s;
}

.hb-chatbot__choice:hover {
	background: #e0e3ff;
}

.hb-chatbot__choice:active {
	transform: translateY(1px);
}

.hb-chatbot__choice:focus-visible {
	outline: 2px solid #4f46e5;
	outline-offset: 2px;
}

.hb-chatbot__choice--reset {
	background: #fff;
	color: #666;
	border-color: #e0e0e0;
}

.hb-chatbot__hint {
	margin: 0;
	padding: 0 1.25em 1em;
	background: #fff;
	color: #888;
	font-size: 0.82em;
}

/* ----- Inline message form ----- */
.hb-contact__message-form {
	display: flex;
	flex-direction: column;
	gap: 1em;
}

.hb-contact__field {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
}

.hb-contact__field label {
	font-weight: 600;
	font-size: 0.9em;
	color: #444;
}

.hb-contact__field input,
.hb-contact__field textarea {
	padding: 0.6em 0.85em;
	border: 1px solid #d0d0d0;
	border-radius: 6px;
	font: inherit;
	font-size: 0.95em;
	transition: border-color 0.15s;
	resize: vertical;
}

.hb-contact__field input:focus,
.hb-contact__field textarea:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.hb-contact__form-status {
	font-size: 0.9em;
	padding: 0.5em 0;
	min-height: 1.4em;
}

.hb-contact__form-status--ok  { color: #008a20; }
.hb-contact__form-status--err { color: #b32d2e; }

/* ----- Mobile ----- */
@media (max-width: 600px) {
	.hb-contact__tab {
		flex: 1;
		text-align: center;
		padding: 0.85em 0.5em;
	}

	.hb-chatbot__log {
		max-height: 280px;
	}

	.hb-chatbot__bubble {
		max-width: 95%;
	}
}
