/* ==========================================================================
   CodeDesign Premium FAQ Accordion
   ========================================================================== */

.cdfaq-wrapper {
	--cdfaq-accent: #8B5CF6;
	--cdfaq-speed: 350ms;
	--cdfaq-ease: cubic-bezier(.4, 0, .2, 1);
	width: 100%;
	box-sizing: border-box;
}

.cdfaq-wrapper *,
.cdfaq-wrapper *::before,
.cdfaq-wrapper *::after {
	box-sizing: border-box;
}

/* ---------- Header ---------- */
.cdfaq-header {
	margin-bottom: 32px;
}

.cdfaq-eyebrow {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--cdfaq-accent);
	margin-bottom: 12px;
}

.cdfaq-title {
	margin: 0 0 12px;
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 700;
	color: #ffffff;
	line-height: 1.2;
}

.cdfaq-description {
	margin: 0 auto;
	max-width: 620px;
	color: #9497a6;
	font-size: 16px;
	line-height: 1.7;
}

/* ---------- Toolbar (search / categories / expand-all) ---------- */
.cdfaq-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 24px;
}

.cdfaq-search {
	position: relative;
	flex: 1 1 240px;
	min-width: 200px;
}

.cdfaq-search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #83869c;
	pointer-events: none;
}

.cdfaq-search-input {
	width: 100%;
	padding: 11px 14px 11px 38px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, .1);
	background: rgba(255, 255, 255, .03);
	color: #fff;
	font-size: 14px;
	outline: none;
	transition: border-color var(--cdfaq-speed) var(--cdfaq-ease), box-shadow var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-search-input::placeholder {
	color: #75778a;
}

.cdfaq-search-input:focus {
	border-color: var(--cdfaq-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cdfaq-accent) 22%, transparent);
}

.cdfaq-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cdfaq-category-btn {
	appearance: none;
	cursor: pointer;
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .01em;
	background: transparent;
	color: #a7aab8;
	border: 1px solid rgba(255, 255, 255, .12);
	transition: all var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-category-btn:hover {
	border-color: var(--cdfaq-accent);
	color: #fff;
}

.cdfaq-category-btn.is-active {
	background: var(--cdfaq-accent);
	border-color: var(--cdfaq-accent);
	color: #fff;
}

.cdfaq-expand-controls {
	display: flex;
	gap: 10px;
}

.cdfaq-expand-all,
.cdfaq-collapse-all {
	appearance: none;
	cursor: pointer;
	background: transparent;
	border: none;
	color: #9497a6;
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-expand-all:hover,
.cdfaq-collapse-all:hover {
	color: var(--cdfaq-accent);
}

.cdfaq-empty-state {
	text-align: center;
	color: #75778a;
	font-size: 14px;
	padding: 24px 0;
}

/* ---------- List / Grid ---------- */
.cdfaq-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

/* ---------- Card ---------- */
.cdfaq-item {
	position: relative;
	background: rgba(255, 255, 255, .03);
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 18px;
	overflow: hidden;
	transition:
		transform var(--cdfaq-speed) var(--cdfaq-ease),
		border-color var(--cdfaq-speed) var(--cdfaq-ease),
		box-shadow var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-wrapper[data-hover-lift="1"] .cdfaq-item:hover,
.cdfaq-item.cdfaq-hover-lift:hover {
	transform: translateY(-3px);
	border-color: var(--cdfaq-accent);
	box-shadow: 0 15px 40px color-mix(in srgb, var(--cdfaq-accent) 18%, transparent);
}

/* Left accent line for the active/open item — cleaner than a full purple fill */
.cdfaq-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(180deg, var(--cdfaq-accent), color-mix(in srgb, var(--cdfaq-accent) 40%, #4338CA));
	transform: scaleY(0);
	transform-origin: top;
	transition: transform var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-item.is-open::before {
	transform: scaleY(1);
}

.cdfaq-item.cdfaq-search-hidden {
	display: none;
}

/* ---------- Question row ---------- */
.cdfaq-question {
	margin: 0;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 28px 32px;
	cursor: pointer;
	user-select: none;
	list-style: none;
}

.cdfaq-question-text {
	flex: 1 1 auto;
	font-size: 20px;
	font-weight: 600;
	color: #ffffff;
	line-height: 1.4;
}

.cdfaq-badge {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 12px;
	border-radius: 999px;
	color: var(--cdfaq-accent);
	border: 1px solid color-mix(in srgb, var(--cdfaq-accent) 55%, transparent);
	background: color-mix(in srgb, var(--cdfaq-accent) 10%, transparent);
	white-space: nowrap;
}

/* ---------- Copy link button ---------- */
.cdfaq-copy-link {
	flex: 0 0 auto;
	appearance: none;
	border: none;
	background: transparent;
	color: #83869c;
	cursor: pointer;
	width: 28px;
	height: 28px;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity var(--cdfaq-speed) var(--cdfaq-ease), color var(--cdfaq-speed) var(--cdfaq-ease), background var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-item:hover .cdfaq-copy-link,
.cdfaq-item:focus-within .cdfaq-copy-link {
	opacity: 1;
}

.cdfaq-copy-link:hover {
	color: var(--cdfaq-accent);
	background: color-mix(in srgb, var(--cdfaq-accent) 12%, transparent);
}

.cdfaq-copy-link.is-copied {
	color: #22c55e;
	opacity: 1;
}

/* ---------- Expand icon (Linear-style plus -> rotate) ---------- */
.cdfaq-icon {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	color: var(--cdfaq-accent);
	transition: transform var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-icon-line {
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	border-radius: 2px;
	transform: translate(-50%, -50%);
	transition: transform var(--cdfaq-speed) var(--cdfaq-ease), opacity var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-icon-line--h {
	width: 14px;
	height: 2px;
}

.cdfaq-icon-line--v {
	width: 2px;
	height: 14px;
}

/* Plus -> rotate 45deg into an X (default / Linear style) */
.cdfaq-item.is-open .cdfaq-icon--plus {
	transform: rotate(45deg);
}

/* Plus -> cross: vertical bar fades out entirely */
.cdfaq-item.is-open .cdfaq-icon--cross .cdfaq-icon-line--v {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(90deg) scaleY(0);
}

/* Chevron style */
.cdfaq-icon--arrow .cdfaq-icon-line--v {
	display: none;
}

.cdfaq-icon--arrow .cdfaq-icon-line--h {
	width: 10px;
	height: 2px;
}

.cdfaq-icon--arrow::before,
.cdfaq-icon--arrow::after {
	content: '';
	position: absolute;
	top: 50%;
	width: 8px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-icon--arrow::before {
	left: 4px;
	transform: translateY(-50%) rotate(45deg);
	transform-origin: right center;
}

.cdfaq-icon--arrow::after {
	right: 4px;
	transform: translateY(-50%) rotate(-45deg);
	transform-origin: left center;
}

.cdfaq-item.is-open .cdfaq-icon--arrow {
	transform: rotate(180deg);
}

/* ---------- Answer panel ----------
   CSS-only smooth height animation using the grid-template-rows 0fr -> 1fr
   technique (no JS height calculation, no jQuery slideDown). */
.cdfaq-answer {
	display: grid;
	grid-template-rows: 0fr;
	opacity: 0;
	transform: translateY(-4px);
	transition:
		grid-template-rows var(--cdfaq-speed) var(--cdfaq-ease),
		opacity var(--cdfaq-speed) var(--cdfaq-ease),
		transform var(--cdfaq-speed) var(--cdfaq-ease);
}

.cdfaq-item.is-open .cdfaq-answer {
	grid-template-rows: 1fr;
	opacity: 1;
	transform: translateY(0);
}

.cdfaq-answer-inner {
	min-height: 0;
	overflow: hidden;
	padding: 0 32px 28px;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.8;
	color: #B5B7C2;
}

.cdfaq-answer-inner p {
	margin: 0 0 12px;
}

.cdfaq-answer-inner p:last-child {
	margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.cdfaq-list {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 767px) {
	.cdfaq-question {
		padding: 20px 20px;
		gap: 10px;
	}

	.cdfaq-question-text {
		font-size: 17px;
	}

	.cdfaq-answer-inner {
		padding: 0 20px 20px;
		font-size: 15px;
	}

	.cdfaq-badge {
		display: none;
	}

	.cdfaq-toolbar {
		flex-direction: column;
		align-items: stretch;
	}
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.cdfaq-item,
	.cdfaq-answer,
	.cdfaq-icon,
	.cdfaq-icon-line,
	.cdfaq-copy-link {
		transition: none !important;
	}
}
