/**
 * OLA — Help Bot Widget
 *
 * Floating FAQ widget: button, panel, search, category pills,
 * accordion, feedback, and responsive styles.
 *
 * z-index: 9989 (below notification bell at 9990).
 *
 * @package OLA_Vault
 * @since   1.4.3
 */

/* ================================================================
   1. FLOATING BUTTON
   ================================================================ */

.ola-helpbot-btn {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ola-color-secondary, #E8636A);
	color: #fff;
	border: none;
	cursor: pointer;
	z-index: 9989;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font-size: 0;
	line-height: 1;
	padding: 0;
}

.ola-helpbot-btn:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24);
}

.ola-helpbot-btn:focus-visible {
	outline: 3px solid var(--ola-color-primary, #6C63FF);
	outline-offset: 2px;
}

.ola-helpbot-btn svg {
	width: 26px;
	height: 26px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.ola-helpbot-btn .ola-helpbot-icon-close {
	display: none;
}

.ola-helpbot-btn.ola-helpbot-open .ola-helpbot-icon-help {
	display: none;
}

.ola-helpbot-btn.ola-helpbot-open .ola-helpbot-icon-close {
	display: block;
}

/* ================================================================
   2. PANEL
   ================================================================ */

.ola-helpbot-panel {
	position: fixed;
	bottom: 92px;
	right: 24px;
	width: 380px;
	max-height: 520px;
	background: var(--ola-color-surface, #fff);
	border-radius: var(--ola-border-radius, 12px);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
	z-index: 9989;
	display: none;
	flex-direction: column;
	overflow: hidden;
	font-family: var(--ola-font-family, 'Poppins', sans-serif);
	animation: olaHelpbotSlideUp 0.25s ease-out;
}

.ola-helpbot-panel.ola-helpbot-visible {
	display: flex;
}

@keyframes olaHelpbotSlideUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ================================================================
   3. HEADER
   ================================================================ */

.ola-helpbot-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 12px;
	border-bottom: 1px solid var(--ola-color-border, #e9ecef);
	flex-shrink: 0;
}

.ola-helpbot-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--ola-color-text-primary, #212529);
}

.ola-helpbot-close {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	line-height: 1;
	color: var(--ola-color-text-secondary, #6C757D);
	font-size: 18px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background 0.15s;
}

.ola-helpbot-close:hover {
	background: var(--ola-color-background, #f8f9fa);
}

.ola-helpbot-close:focus-visible {
	outline: 2px solid var(--ola-color-primary, #6C63FF);
	outline-offset: 1px;
}

/* ================================================================
   4. SEARCH
   ================================================================ */

.ola-helpbot-search {
	padding: 12px 20px 8px;
	flex-shrink: 0;
}

.ola-helpbot-search input {
	width: 100%;
	padding: 8px 12px 8px 36px;
	border: 1px solid var(--ola-color-border, #dee2e6);
	border-radius: 8px;
	font-size: 13px;
	font-family: inherit;
	color: var(--ola-color-text-primary, #212529);
	background: var(--ola-color-background, #f8f9fa);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236C757D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 10px center;
	background-size: 16px;
}

.ola-helpbot-search input:focus {
	border-color: var(--ola-color-primary, #6C63FF);
	box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.1);
	background-color: #fff;
}

.ola-helpbot-search input::placeholder {
	color: var(--ola-color-text-secondary, #6C757D);
}

/* ================================================================
   5. CATEGORY PILLS
   ================================================================ */

.ola-helpbot-categories {
	padding: 4px 20px 8px;
	display: flex;
	gap: 6px;
	overflow-x: auto;
	flex-shrink: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ola-helpbot-categories::-webkit-scrollbar {
	display: none;
}

.ola-helpbot-pill {
	flex-shrink: 0;
	padding: 5px 12px;
	border-radius: 20px;
	border: 1px solid var(--ola-color-border, #dee2e6);
	background: var(--ola-color-surface, #fff);
	color: var(--ola-color-text-secondary, #6C757D);
	font-size: 12px;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s;
	line-height: 1.3;
}

.ola-helpbot-pill:hover {
	border-color: var(--ola-color-primary, #6C63FF);
	color: var(--ola-color-primary, #6C63FF);
}

.ola-helpbot-pill.active {
	background: var(--ola-color-primary, #6C63FF);
	color: #fff;
	border-color: var(--ola-color-primary, #6C63FF);
}

.ola-helpbot-pill:focus-visible {
	outline: 2px solid var(--ola-color-primary, #6C63FF);
	outline-offset: 1px;
}

/* ================================================================
   6. FAQ LIST / ACCORDION
   ================================================================ */

.ola-helpbot-body {
	flex: 1;
	overflow-y: auto;
	padding: 0;
	scrollbar-width: thin;
}

.ola-helpbot-body::-webkit-scrollbar {
	width: 4px;
}

.ola-helpbot-body::-webkit-scrollbar-track {
	background: transparent;
}

.ola-helpbot-body::-webkit-scrollbar-thumb {
	background: var(--ola-color-border, #dee2e6);
	border-radius: 4px;
}

.ola-helpbot-category-group {
	border-bottom: 1px solid var(--ola-color-border, #e9ecef);
}

.ola-helpbot-category-label {
	padding: 10px 20px 4px;
	font-size: 10px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ola-color-text-secondary, #6C757D);
}

.ola-helpbot-item {
	border-top: 1px solid var(--ola-color-border, #f0f0f0);
}

.ola-helpbot-item:first-child {
	border-top: none;
}

.ola-helpbot-question {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	padding: 12px 20px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 13px;
	font-family: inherit;
	font-weight: 500;
	color: var(--ola-color-text-primary, #212529);
	text-align: left;
	line-height: 1.4;
	transition: background 0.15s;
}

.ola-helpbot-question:hover {
	background: var(--ola-color-background, #f8f9fa);
}

.ola-helpbot-question:focus-visible {
	outline: 2px solid var(--ola-color-primary, #6C63FF);
	outline-offset: -2px;
}

.ola-helpbot-chevron {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin-top: 2px;
	transition: transform 0.2s ease;
	stroke: var(--ola-color-text-secondary, #6C757D);
}

.ola-helpbot-item.open .ola-helpbot-chevron {
	transform: rotate(180deg);
}

.ola-helpbot-answer {
	display: none;
	padding: 0 20px 14px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--ola-color-text-secondary, #495057);
}

.ola-helpbot-item.open .ola-helpbot-answer {
	display: block;
}

.ola-helpbot-answer a {
	color: var(--ola-color-primary, #6C63FF);
	text-decoration: none;
}

.ola-helpbot-answer a:hover {
	text-decoration: underline;
}

/* Search highlight */
.ola-helpbot-highlight {
	background: rgba(255, 193, 7, 0.3);
	border-radius: 2px;
	padding: 0 1px;
}

/* ================================================================
   7. FEEDBACK (Was this helpful?)
   ================================================================ */

.ola-helpbot-feedback {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--ola-color-border, #f0f0f0);
	font-size: 12px;
	color: var(--ola-color-text-secondary, #6C757D);
}

.ola-helpbot-feedback-label {
	font-size: 12px;
}

.ola-helpbot-feedback-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	border: 1px solid var(--ola-color-border, #dee2e6);
	background: var(--ola-color-surface, #fff);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: all 0.15s;
	padding: 0;
}

.ola-helpbot-feedback-btn:hover {
	border-color: var(--ola-color-primary, #6C63FF);
	background: rgba(108, 99, 255, 0.05);
}

.ola-helpbot-feedback-btn.voted {
	border-color: var(--ola-color-primary, #6C63FF);
	background: rgba(108, 99, 255, 0.1);
}

.ola-helpbot-feedback-btn:focus-visible {
	outline: 2px solid var(--ola-color-primary, #6C63FF);
	outline-offset: 1px;
}

.ola-helpbot-feedback-thanks {
	font-size: 12px;
	color: var(--ola-color-success, #28A745);
	font-weight: 500;
}

/* ================================================================
   8. EMPTY STATE / NO RESULTS
   ================================================================ */

.ola-helpbot-empty {
	padding: 32px 20px;
	text-align: center;
	color: var(--ola-color-text-secondary, #6C757D);
	font-size: 13px;
}

.ola-helpbot-empty a {
	color: var(--ola-color-primary, #6C63FF);
	text-decoration: none;
}

.ola-helpbot-empty a:hover {
	text-decoration: underline;
}

.ola-helpbot-loading {
	padding: 40px 20px;
	text-align: center;
	color: var(--ola-color-text-secondary, #6C757D);
	font-size: 13px;
}

/* ================================================================
   9. FOOTER
   ================================================================ */

.ola-helpbot-footer {
	padding: 10px 20px;
	border-top: 1px solid var(--ola-color-border, #e9ecef);
	text-align: center;
	flex-shrink: 0;
	font-size: 12px;
}

.ola-helpbot-footer a {
	color: var(--ola-color-primary, #6C63FF);
	text-decoration: none;
	font-weight: 500;
}

.ola-helpbot-footer a:hover {
	text-decoration: underline;
}

/* ================================================================
   10. MOBILE RESPONSIVE
   ================================================================ */

@media (max-width: 480px) {
	.ola-helpbot-btn {
		bottom: 16px;
		right: 16px;
	}

	.ola-helpbot-panel {
		bottom: 80px;
		right: 12px;
		left: 12px;
		width: auto;
		max-height: calc(100vh - 120px);
	}
}

@media (max-width: 400px) {
	.ola-helpbot-panel {
		right: 8px;
		left: 8px;
		bottom: 76px;
	}
}
