/* pX FAQ Builder - Frontend Styles */
/* Alle Klassen verwenden das px-faq- Präfix zur Vermeidung von Theme-Konflikten */

.px-faq {
	--px-faq-bg: #f8fafc;
	--px-faq-surface: #ffffff;
	--px-faq-border: #e2e8f0;
	--px-faq-border-strong: #cbd5f5;
	--px-faq-accent: #2563eb;
	--px-faq-accent-strong: #1d4ed8;
	--px-faq-accent-soft: rgba(37, 99, 235, 0.1);
	--px-faq-accent-hover: rgba(37, 99, 235, 0.08);
	--px-faq-text: #0f172a;
	--px-faq-muted: #475569;
	--px-faq-subtle: #64748b;
	--px-faq-radius: 12px;
	--px-faq-transition: 0.24s cubic-bezier(0.4, 0, 0.2, 1);
	--px-faq-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
	--px-faq-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.1);
	--px-faq-shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.12);
	--px-faq-shadow-xl: 0 20px 40px rgba(15, 23, 42, 0.15);
}

.px-faq {
	position: relative;
	margin: 2rem auto;
	padding: 2.25rem;
	background: var(--px-faq-surface);
	color: var(--px-faq-text);
	max-width: 960px;
	border-radius: var(--px-faq-radius);
	box-shadow: var(--px-faq-shadow-xl);
	border: 1px solid rgba(148, 163, 184, 0.2);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Toolbar */
.px-faq-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 1.25rem;
	margin-bottom: 2rem;
}

/* Filter Buttons */
.px-faq-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem;
	border-radius: 12px;
	background: rgba(37, 99, 235, 0.06);
	border: 1px solid rgba(37, 99, 235, 0.12);
	backdrop-filter: blur(8px);
}

.px-faq-filter-button {
	border: 0;
	background: transparent;
	color: var(--px-faq-subtle);
	font-weight: 600;
	font-size: 0.94rem;
	padding: 0.65rem 1.1rem;
	border-radius: 8px;
	cursor: pointer;
	transition: all var(--px-faq-transition);
	position: relative;
	overflow: hidden;
}

.px-faq-filter-button::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: var(--px-faq-accent);
	opacity: 0;
	transform: scale(0.8);
	transition: all var(--px-faq-transition);
	border-radius: 8px;
}

.px-faq-filter-button > span {
	position: relative;
	z-index: 1;
}

.px-faq-filter-button:is(:hover, :focus-visible) {
	color: var(--px-faq-accent);
	transform: translateY(-1px);
}

.px-faq-filter-button:is(:hover, :focus-visible)::before {
	opacity: 0.1;
	transform: scale(1);
}

.px-faq-filter-button.is-active {
	color: #fff;
	background: var(--px-faq-accent);
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.px-faq-filter-button.is-active::before {
	opacity: 1;
	transform: scale(1);
}

.px-faq-filter-button:focus-visible {
	outline: 2px solid rgba(37, 99, 235, 0.5);
	outline-offset: 2px;
}

/* Search */
.px-faq-search {
	position: relative;
	flex: 1 1 280px;
	min-width: 260px;
}

.px-faq-search-input {
	width: 100%;
	padding: 0.95rem 1.2rem 0.95rem 3.25rem;
	border-radius: 12px;
	border: 1.5px solid var(--px-faq-border);
	background: #f9fafb;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
	font-size: 1rem;
	transition: all var(--px-faq-transition);
	color: var(--px-faq-text);
}

.px-faq-search-input::placeholder {
	color: var(--px-faq-subtle);
	opacity: 0.7;
}

.px-faq-search-input:focus {
	border-color: var(--px-faq-accent);
	background: #fff;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 1px 2px rgba(15, 23, 42, 0.05);
	outline: none;
}

.px-faq-search-icon {
	position: absolute;
	top: 50%;
	left: 1.15rem;
	transform: translateY(-50%);
	color: var(--px-faq-subtle);
	font-size: 1rem;
	pointer-events: none;
	transition: color var(--px-faq-transition);
}

.px-faq-search-input:focus + .px-faq-search-icon,
.px-faq[data-has-query="1"] .px-faq-search-icon {
	color: var(--px-faq-accent);
}

/* Accordion */
.px-faq-accordion {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

/* Group */
.px-faq-group {
	background: var(--px-faq-surface);
	border-radius: 12px;
	border: 1.5px solid var(--px-faq-border);
	overflow: hidden;
	transition: all var(--px-faq-transition);
	box-shadow: var(--px-faq-shadow-sm);
}

.px-faq-group.is-open {
	border-color: var(--px-faq-border-strong);
	box-shadow: var(--px-faq-shadow-lg);
	transform: translateY(-2px);
}

.px-faq-group-toggle {
	width: 100%;
	border: 0;
	background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
	padding: 1.15rem 1.5rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--px-faq-text);
	cursor: pointer;
	transition: all var(--px-faq-transition);
	position: relative;
	margin: 0;
	text-align: left;
	text-decoration: none;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.px-faq-group-toggle::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
	opacity: 0;
	transition: opacity var(--px-faq-transition);
}

.px-faq-group-toggle:is(:hover, :focus-visible) {
	background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
	color: var(--px-faq-accent-strong);
	outline: none;
}

.px-faq-group-toggle:is(:hover, :focus-visible)::after {
	opacity: 1;
}

.px-faq-group.is-open .px-faq-group-toggle {
	background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
	color: var(--px-faq-accent-strong);
}

.px-faq-group.is-open .px-faq-group-toggle::after {
	opacity: 1;
}

.px-faq-group-heading {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	text-align: left;
	position: relative;
	z-index: 1;
}

.px-faq-group-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 8px;
	background: var(--px-faq-accent);
	color: #fff;
	font-size: 1rem;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
	transition: transform var(--px-faq-transition);
}

.px-faq-group-toggle:is(:hover, :focus-visible) .px-faq-group-icon {
	transform: scale(1.05);
}

.px-faq-group-title-text {
	font-size: 1.05rem;
	letter-spacing: 0.01em;
	font-weight: 700;
}

.px-faq-group-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	color: var(--px-faq-subtle);
	font-weight: 600;
	font-size: 0.875rem;
	position: relative;
	z-index: 1;
}

.px-faq-group-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.85rem;
	height: 1.85rem;
	border-radius: 10px;
	background: rgba(37, 99, 235, 0.15);
	color: var(--px-faq-accent-strong);
	font-weight: 700;
	padding: 0 0.5rem;
}

.px-faq-group-chevron {
	transition: transform var(--px-faq-transition);
	color: var(--px-faq-accent);
	font-size: 0.875rem;
}

.px-faq-group.is-open .px-faq-group-chevron {
	transform: rotate(180deg);
}

.px-faq-group-panel {
	padding: 1.5rem;
	border-top: 1px solid var(--px-faq-border);
	background: #f9fafb;
	animation: px-faq-slide-down 0.3s ease-out;
}

@keyframes px-faq-slide-down {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.px-faq-group-description {
	margin-bottom: 1.25rem;
	color: var(--px-faq-muted);
	line-height: 1.65;
	font-size: 0.95rem;
	padding: 0.75rem 1rem;
	background: rgba(148, 163, 184, 0.05);
	border-radius: 8px;
	border-left: 3px solid var(--px-faq-accent);
}

.px-faq-group-description p {
	margin: 0.25rem 0;
}

.px-faq-group-description p:first-child {
	margin-top: 0;
}

.px-faq-group-description p:last-child {
	margin-bottom: 0;
}

/* Items */
.px-faq-items {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.px-faq-item {
	border: 1.5px solid var(--px-faq-border);
	border-radius: 10px;
	background: var(--px-faq-surface);
	overflow: hidden;
	transition: all var(--px-faq-transition);
	box-shadow: var(--px-faq-shadow-sm);
}

.px-faq-item:is(:hover, .is-open) {
	border-color: var(--px-faq-border-strong);
	box-shadow: var(--px-faq-shadow-md);
	transform: translateY(-2px);
}

.px-faq-item-toggle {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	border: 0;
	background: transparent;
	padding: 1rem 1.25rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--px-faq-text);
	cursor: pointer;
	transition: all var(--px-faq-transition);
	text-align: left;
}

.px-faq-item-toggle:is(:hover, :focus-visible) {
	background: var(--px-faq-accent-hover);
	color: var(--px-faq-accent-strong);
	outline: none;
}

.px-faq-item-header {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	flex: 1;
}

.px-faq-item-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.1rem;
	height: 2.1rem;
	border-radius: 8px;
	background: rgba(37, 99, 235, 0.12);
	color: var(--px-faq-accent);
	font-size: 0.95rem;
	transition: transform var(--px-faq-transition);
	flex-shrink: 0;
}

.px-faq-item-toggle:is(:hover, :focus-visible) .px-faq-item-icon {
	background: rgba(37, 99, 235, 0.18);
	transform: scale(1.05);
}

.px-faq-item-title {
	flex: 1;
	line-height: 1.5;
	font-weight: 600;
}

.px-faq-item-chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--px-faq-accent);
	font-size: 0.875rem;
	transition: transform var(--px-faq-transition), color var(--px-faq-transition);
	flex-shrink: 0;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 6px;
	background: rgba(37, 99, 235, 0.1);
}

.px-faq-item.is-open .px-faq-item-chevron {
	transform: rotate(45deg);
	background: rgba(37, 99, 235, 0.2);
}

.px-faq-item-panel {
	padding: 0 1.25rem 1.25rem;
	border-top: 1px solid var(--px-faq-border);
	background: #fff;
	animation: px-faq-slide-down 0.25s ease-out;
}

.px-faq-item-excerpt {
	margin: 1rem 0 0.85rem;
	padding: 1rem 1.15rem;
	border-radius: 8px;
	background: var(--px-faq-accent-soft);
	color: var(--px-faq-text);
	font-weight: 500;
	line-height: 1.6;
	border-left: 3px solid var(--px-faq-accent);
}

.px-faq-item-excerpt p {
	margin: 0.4rem 0;
}

.px-faq-item-excerpt p:first-child {
	margin-top: 0;
}

.px-faq-item-excerpt p:last-child {
	margin-bottom: 0;
}

.px-faq-item-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.px-faq-readmore {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.65rem 1.3rem;
	border-radius: 8px;
	background: var(--px-faq-accent);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: none;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
	transition: all var(--px-faq-transition);
	border: none;
	cursor: pointer;
	position: relative;
	overflow: hidden;
}

.px-faq-readmore::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s ease;
}

.px-faq-readmore:hover::before {
	left: 100%;
}

.px-faq-readmore .fa-arrow-right {
	font-size: 0.875rem;
	transition: transform var(--px-faq-transition);
}

.px-faq-readmore:is(:hover, :focus-visible) {
	background: var(--px-faq-accent-strong);
	box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
	transform: translateY(-2px);
}

.px-faq-readmore:is(:hover, :focus-visible) .fa-arrow-right {
	transform: translateX(3px);
}

.px-faq-readmore:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 2px;
}

.px-faq-readmore-text {
	position: relative;
	z-index: 1;
}

/* Empty State */
.px-faq-empty {
	margin-top: 1.5rem;
	padding: 2rem 1.5rem;
	border-radius: 12px;
	background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
	border: 2px dashed rgba(148, 163, 184, 0.6);
	text-align: center;
	color: var(--px-faq-muted);
	font-weight: 600;
	font-size: 1rem;
}

/* States */
.px-faq[data-active-group]:not([data-active-group="all"]) .px-faq-filter {
	border-color: rgba(37, 99, 235, 0.25);
	background: rgba(37, 99, 235, 0.08);
}

.px-faq[data-has-query="1"] .px-faq-search-input {
	border-color: var(--px-faq-accent);
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 1px 2px rgba(15, 23, 42, 0.05);
}

.px-faq[data-has-query="1"] .px-faq-item-panel {
	padding-bottom: 1rem;
}

.px-faq[data-has-query="1"] .px-faq-item {
	border-color: var(--px-faq-border-strong);
}

.px-faq-group[hidden],
.px-faq-item[hidden] {
	display: none !important;
}

.px-faq-empty[hidden] {
	display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
	.px-faq {
		padding: 1.75rem;
		margin: 1.5rem auto;
	}

	.px-faq-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.px-faq-filter {
		justify-content: flex-start;
		padding: 0.3rem;
	}

	.px-faq-group-toggle {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
		padding: 1rem 1.25rem;
	}

	.px-faq-group-meta {
		width: 100%;
		justify-content: space-between;
	}

	.px-faq-group-panel {
		padding: 1.25rem;
	}

	.px-faq-item-toggle {
		padding: 0.95rem 1.1rem;
	}

	.px-faq-item-panel {
		padding: 0 1.1rem 1.1rem;
	}
}

@media (max-width: 480px) {
	.px-faq {
		padding: 1.25rem;
		margin: 1rem auto;
		border-radius: 10px;
	}

	.px-faq-filter {
		width: 100%;
		justify-content: flex-start;
	}

	.px-faq-filter-button {
		flex: 1 1 auto;
		text-align: center;
		padding: 0.6rem 0.9rem;
		font-size: 0.875rem;
	}

	.px-faq-search {
		min-width: 100%;
	}

	.px-faq-search-input {
		padding: 0.85rem 1rem 0.85rem 2.75rem;
		font-size: 0.95rem;
	}

	.px-faq-group-toggle {
		font-size: 0.95rem;
		padding: 0.95rem 1.1rem;
	}

	.px-faq-group-icon {
		width: 2rem;
		height: 2rem;
		font-size: 0.9rem;
	}

	.px-faq-item-toggle {
		font-size: 0.95rem;
		padding: 0.85rem 1rem;
		gap: 0.85rem;
	}

	.px-faq-item-icon {
		width: 1.9rem;
		height: 1.9rem;
		font-size: 0.875rem;
	}

	.px-faq-item-actions {
		flex-wrap: wrap;
		gap: 0.5rem;
	}

	.px-faq-readmore {
		width: 100%;
		justify-content: center;
		padding: 0.7rem 1.2rem;
	}

	.px-faq-empty {
		padding: 1.5rem 1.25rem;
		font-size: 0.95rem;
	}
}

/* Print Styles */
@media print {
	.px-faq {
		box-shadow: none;
		border: 1px solid #ccc;
	}

	.px-faq-toolbar {
		display: none;
	}

	.px-faq-group-toggle {
		cursor: default;
	}

	.px-faq-item-toggle {
		cursor: default;
	}

	.px-faq-readmore {
		display: none;
	}

	.px-faq-group-panel,
	.px-faq-item-panel {
		display: block !important;
		hidden: false !important;
	}
}
