/**
 * Alpha Professional FAQ (سوالات متداول) Stylesheet
 * Compatible with Bootstrap 4 & RTL Layouts
 * Theme Accent: #ef4a23
 */

:root {
	--faq-primary: #ef4a23;
	--faq-primary-hover: #d63c17;
	--faq-primary-light: rgba(239, 74, 35, 0.08);
	--faq-primary-border: rgba(239, 74, 35, 0.2);
	--faq-bg: #ffffff;
	--faq-card-border: #e8ebf0;
	--faq-text-main: #2b303a;
	--faq-text-muted: #64748b;
	--faq-radius: 12px;
	--faq-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
	--faq-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   FAQ Widget Container & Card
   ========================================================================== */

.alpha-faq-widget-root {
	margin: 32px 0;
	clear: both;
}

.alpha-faq-card {
	background: var(--faq-bg);
	border: 1px solid var(--faq-card-border);
	border-radius: var(--faq-radius);
	box-shadow: var(--faq-shadow);
	overflow: hidden;
	transition: var(--faq-transition);
}

.alpha-faq-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	background: #ffffff;
	border-bottom: 1px solid var(--faq-card-border);
	flex-wrap: wrap;
	gap: 12px;
}

.alpha-faq-title-area {
	display: flex;
	align-items: center;
	gap: 12px;
}

.alpha-faq-icon-badge {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--faq-primary-light);
	color: var(--faq-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	flex-shrink: 0;
}

.alpha-faq-title {
	font-size: 17px;
	font-weight: 700;
	color: var(--faq-text-main);
	margin: 0;
}

.alpha-faq-count-badge {
	font-size: 11.5px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 20px;
	background: #f1f5f9;
	color: var(--faq-text-muted);
}

.alpha-faq-actions {
	display: flex;
	align-items: center;
	gap: 8px;
}

.alpha-faq-btn-tool {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	color: var(--faq-text-muted);
	font-size: 12px;
	font-weight: 600;
	padding: 5px 10px;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--faq-transition);
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.alpha-faq-btn-tool:hover {
	background: var(--faq-primary-light);
	color: var(--faq-primary);
	border-color: var(--faq-primary-border);
}

/* FAQ Search Bar */
.alpha-faq-search-wrap {
	padding: 14px 24px;
	background: #f8fafc;
	border-bottom: 1px solid var(--faq-card-border);
}

.alpha-faq-search-input-group {
	position: relative;
	display: flex;
	align-items: center;
}

.alpha-faq-search-input-group i.fa-search {
	position: absolute;
	right: 14px;
	color: #94a3b8;
	font-size: 14px;
	pointer-events: none;
}

.alpha-faq-search-input {
	width: 100%;
	padding: 9px 38px 9px 34px;
	font-size: 13.5px;
	border: 1px solid #dce1e9;
	border-radius: 8px;
	background: #ffffff;
	color: var(--faq-text-main);
	outline: none;
	transition: var(--faq-transition);
}

.alpha-faq-search-input:focus {
	border-color: var(--faq-primary);
	box-shadow: 0 0 0 3px var(--faq-primary-light);
}

.alpha-faq-search-clear {
	position: absolute;
	left: 12px;
	background: none;
	border: none;
	color: #94a3b8;
	cursor: pointer;
	padding: 0;
	display: none;
	font-size: 13px;
}

.alpha-faq-search-clear:hover {
	color: #ef4444;
}

/* FAQ Accordion List */
.alpha-faq-list {
	padding: 16px 24px 20px;
}

.alpha-faq-item {
	border: 1px solid #edf0f5;
	border-radius: 10px;
	margin-bottom: 10px;
	background: #ffffff;
	transition: var(--faq-transition);
	overflow: hidden;
}

.alpha-faq-item:last-child {
	margin-bottom: 0;
}

.alpha-faq-item:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.alpha-faq-item.is-open {
	border-color: var(--faq-primary-border);
	box-shadow: 0 4px 15px rgba(239, 74, 35, 0.06);
}

/* Question Header */
.alpha-faq-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	cursor: pointer;
	user-select: none;
	gap: 12px;
	background: #ffffff;
	transition: background 0.2s ease;
}

.alpha-faq-item.is-open .alpha-faq-question {
	background: #fafafc;
	border-bottom: 1px solid #edf0f5;
}

.alpha-faq-question-left {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
}

.alpha-faq-q-badge {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	background: var(--faq-primary-light);
	color: var(--faq-primary);
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.alpha-faq-question-text {
	font-size: 14.5px;
	font-weight: 600;
	color: var(--faq-text-main);
	margin: 0;
	line-height: 1.5;
	transition: color 0.2s ease;
}

.alpha-faq-item.is-open .alpha-faq-question-text {
	color: var(--faq-primary);
}

.alpha-faq-question-right {
	display: flex;
	align-items: center;
	gap: 8px;
}

.alpha-faq-link-copy {
	background: none;
	border: none;
	color: #94a3b8;
	font-size: 12px;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	opacity: 0;
	transition: var(--faq-transition);
}

.alpha-faq-item:hover .alpha-faq-link-copy {
	opacity: 1;
}

.alpha-faq-link-copy:hover {
	color: var(--faq-primary);
	background: var(--faq-primary-light);
}

.alpha-faq-chevron {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #f1f5f9;
	color: #64748b;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
}

.alpha-faq-item.is-open .alpha-faq-chevron {
	transform: rotate(180deg);
	background: var(--faq-primary-light);
	color: var(--faq-primary);
}

/* Answer Body */
.alpha-faq-answer {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.25s ease;
	opacity: 0;
	padding: 0 18px;
	background: #ffffff;
}

.alpha-faq-item.is-open .alpha-faq-answer {
	max-height: 800px;
	opacity: 1;
	padding: 16px 18px 18px;
}

.alpha-faq-answer-content {
	font-size: 13.5px;
	line-height: 1.8;
	color: #475569;
	margin: 0;
}

.alpha-faq-answer-content p:last-child {
	margin-bottom: 0;
}

/* Empty Search state */
.alpha-faq-item.search-hidden {
	display: none !important;
}

.alpha-faq-empty-search {
	padding: 24px;
	text-align: center;
	color: var(--faq-text-muted);
	font-size: 13px;
	display: none;
}

/* Admin Empty Notice Card */
.alpha-faq-admin-notice {
	background: #f0fdf4;
	border: 1px dashed #22c55e;
	border-radius: 10px;
	padding: 16px 20px;
	margin: 20px 0;
	font-size: 13px;
	line-height: 1.8;
	color: #166534;
}

/* ==========================================================================
   Admin FAQ Modal Manager
   ========================================================================== */

.alpha-faq-modal-row {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 14px;
	margin-bottom: 12px;
	position: relative;
	transition: var(--faq-transition);
}

.alpha-faq-modal-row:hover {
	border-color: #cbd5e1;
	background: #ffffff;
}

.alpha-faq-modal-row-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.alpha-faq-modal-row-num {
	font-size: 12px;
	font-weight: 700;
	color: var(--faq-primary);
}

.alpha-faq-modal-row-del {
	background: none;
	border: none;
	color: #ef4444;
	cursor: pointer;
	font-size: 13px;
	padding: 2px 6px;
	border-radius: 4px;
	transition: var(--faq-transition);
}

.alpha-faq-modal-row-del:hover {
	background: #fee2e2;
}

/* ==========================================================================
   FAQ Metabox (متاباکس اختصاصی سوالات متداول برای افزودن و ویرایش نوشته و محصول)
   ========================================================================== */

.alpha-faq-metabox-root {
	margin: 35px 0 25px;
	clear: both;
}

.alpha-metabox-card {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	border-top: 4px solid var(--faq-primary);
	border-radius: 12px;
	box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
	overflow: hidden;
	transition: var(--faq-transition);
}

.alpha-metabox-card:hover {
	border-color: #94a3b8;
	box-shadow: 0 14px 30px -5px rgba(15, 23, 42, 0.12);
}

.alpha-metabox-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	flex-wrap: wrap;
	gap: 12px;
}

.alpha-metabox-header-title {
	display: flex;
	align-items: center;
	gap: 12px;
}

.alpha-metabox-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	background: rgba(239, 74, 35, 0.1);
	color: var(--faq-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 19px;
	flex-shrink: 0;
}

.alpha-metabox-heading {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 2px 0;
}

.alpha-metabox-subheading {
	font-size: 12px;
	color: #64748b;
}

.alpha-metabox-header-actions {
	display: flex;
	align-items: center;
	gap: 14px;
}

/* Switch */
.alpha-metabox-switch {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	margin: 0;
	user-select: none;
	gap: 8px;
}

.alpha-metabox-switch input {
	display: none;
}

.alpha-metabox-slider {
	position: relative;
	width: 40px;
	height: 22px;
	background-color: #cbd5e1;
	border-radius: 22px;
	transition: var(--faq-transition);
	display: inline-block;
}

.alpha-metabox-slider::before {
	content: "";
	position: absolute;
	height: 16px;
	width: 16px;
	right: 3px;
	bottom: 3px;
	background-color: white;
	border-radius: 50%;
	transition: var(--faq-transition);
	box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.alpha-metabox-switch input:checked + .alpha-metabox-slider {
	background-color: #10b981;
}

.alpha-metabox-switch input:checked + .alpha-metabox-slider::before {
	transform: translateX(-18px);
}

.alpha-metabox-switch-label {
	font-size: 12px;
	font-weight: 600;
	color: #334155;
}

.alpha-metabox-toggle-collapse {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: #64748b;
	width: 32px;
	height: 32px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: var(--faq-transition);
}

.alpha-metabox-toggle-collapse:hover {
	background: #f1f5f9;
	color: #0f172a;
}

.alpha-metabox-card.is-collapsed .alpha-metabox-body,
.alpha-metabox-card.is-collapsed .alpha-metabox-footer {
	display: none !important;
}

.alpha-metabox-card.is-collapsed .alpha-metabox-toggle-collapse i {
	transform: rotate(180deg);
}

/* Body */
.alpha-metabox-body {
	padding: 22px;
	background: #ffffff;
}

.alpha-metabox-alert {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.alpha-metabox-alert-text {
	font-size: 13px;
	color: #166534;
	line-height: 1.6;
}

.alpha-metabox-badge-count {
	font-size: 12px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	background: #dcfce7;
	color: #15803d;
	white-space: nowrap;
}

/* Items list */
.alpha-metabox-items-wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 20px;
}

.alpha-metabox-empty-notice {
	text-align: center;
	padding: 30px 20px;
	background: #f8fafc;
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	color: #64748b;
	font-size: 13.5px;
}

.alpha-metabox-empty-notice i {
	font-size: 32px;
	color: #94a3b8;
	display: block;
	margin-bottom: 8px;
}

.alpha-metabox-item-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
	transition: var(--faq-transition);
	position: relative;
}

.alpha-metabox-item-card:hover {
	border-color: #cbd5e1;
	background: #ffffff;
	box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.alpha-metabox-item-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid #eef2f6;
}

.alpha-metabox-item-badge {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--faq-primary);
	display: flex;
	align-items: center;
	gap: 6px;
}

.alpha-metabox-item-badge span {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--faq-primary-light);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11.5px;
}

.alpha-metabox-item-actions {
	display: flex;
	align-items: center;
	gap: 4px;
}

.alpha-metabox-btn-tool {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: #64748b;
	width: 28px;
	height: 28px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	cursor: pointer;
	font-size: 12px;
	transition: var(--faq-transition);
}

.alpha-metabox-btn-tool:hover {
	background: #f1f5f9;
	color: #0f172a;
	border-color: #94a3b8;
}

.alpha-metabox-btn-del {
	background: #ffffff;
	border: 1px solid #fecaca;
	color: #ef4444;
	font-size: 12px;
	padding: 3px 8px;
	border-radius: 6px;
	cursor: pointer;
	transition: var(--faq-transition);
}

.alpha-metabox-btn-del:hover {
	background: #fee2e2;
	border-color: #f87171;
}

.alpha-metabox-field-group {
	margin-bottom: 10px;
}

.alpha-metabox-field-group:last-child {
	margin-bottom: 0;
}

.alpha-metabox-field-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #475569;
	margin-bottom: 4px;
}

.alpha-metabox-input-q,
.alpha-metabox-input-a {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	padding: 8px 12px;
	font-size: 13px;
	color: #1e293b;
	background: #ffffff;
	transition: var(--faq-transition);
}

.alpha-metabox-input-q:focus,
.alpha-metabox-input-a:focus {
	outline: none;
	border-color: var(--faq-primary);
	box-shadow: 0 0 0 3px rgba(239, 74, 35, 0.12);
}

/* Tools Bar */
.alpha-metabox-tools-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 10px;
	margin-bottom: 22px;
}

.alpha-metabox-btn-add {
	font-weight: 600;
	padding: 7px 16px;
	border-radius: 8px;
}

/* Integration & Shortcode Box */
.alpha-metabox-integration-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px;
}

.alpha-metabox-integration-title {
	font-size: 13px;
	font-weight: 700;
	color: #334155;
	margin-bottom: 6px;
}

.alpha-metabox-integration-desc {
	font-size: 12px;
	color: #64748b;
	margin-bottom: 10px;
	line-height: 1.6;
}

.alpha-metabox-shortcode-preview {
	background: #1e293b;
	color: #38bdf8;
	font-family: monospace;
	font-size: 12px;
	direction: ltr;
	text-align: left;
	padding: 10px 14px;
	border-radius: 8px;
	max-height: 120px;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-all;
	margin-bottom: 12px;
}

.alpha-metabox-integration-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* Footer */
.alpha-metabox-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	flex-wrap: wrap;
	gap: 12px;
}

.alpha-metabox-status {
	font-size: 12.5px;
	color: #475569;
}

.alpha-metabox-footer-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.alpha-metabox-save-btn {
	background: var(--faq-primary);
	border-color: var(--faq-primary);
	color: #ffffff;
	font-weight: 600;
	padding: 7px 18px;
	border-radius: 8px;
	transition: var(--faq-transition);
}

.alpha-metabox-save-btn:hover {
	background: var(--faq-primary-hover);
	border-color: var(--faq-primary-hover);
	color: #ffffff;
}

/* Floating Quick Button for Admin */
.alpha-metabox-floating-btn {
	position: fixed;
	bottom: 25px;
	left: 25px;
	z-index: 999;
	background: #1e293b;
	color: #ffffff;
	border: none;
	border-radius: 30px;
	padding: 10px 18px;
	font-size: 12.5px;
	font-weight: 600;
	box-shadow: 0 4px 18px rgba(0,0,0,0.25);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: var(--faq-transition);
}

.alpha-metabox-floating-btn:hover {
	background: var(--faq-primary);
	transform: translateY(-2px);
	box-shadow: 0 6px 22px rgba(239, 74, 35, 0.4);
}

.alpha-metabox-floating-btn i {
	font-size: 15px;
	color: #facc15;
}

/* Print Styles */
@media print {
	.alpha-faq-actions,
	.alpha-faq-search-wrap,
	.alpha-faq-link-copy,
	.alpha-faq-chevron {
		display: none !important;
	}

	.alpha-faq-card {
		box-shadow: none !important;
		border: 1px solid #ccc !important;
		page-break-inside: avoid;
	}

	.alpha-faq-answer {
		max-height: none !important;
		opacity: 1 !important;
		display: block !important;
		padding: 10px 18px !important;
	}
}
