/*
 * EnergyMaster AI — Guide & FAQ styles.
 * All custom properties are scoped under .ema-guide-wrap so this plugin
 * can never bleed styling onto the rest of a theme, and never depends on
 * the host plugin's own CSS being loaded.
 */

.ema-guide-wrap {
	--emg-bg:          #0a0c10;
	--emg-bg-panel:    #0f1218;
	--emg-bg-card:     #131820;
	--emg-border:      #1e2738;
	--emg-border-soft: #16202e;
	--emg-text:        #c8d4e8;
	--emg-text-dim:    #5a6a82;
	--emg-text-bright: #e8f0fc;
	--emg-amber:       #F59E0B;
	--emg-amber-glow:  rgba(245, 158, 11, 0.12);
	--emg-cyan:        #22D3EE;
	--emg-green:       #34D399;
	--emg-radius:      6px;
	--emg-radius-lg:   10px;
	--emg-font-ui:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--emg-font-mono:   'IBM Plex Mono', 'Courier New', monospace;

	box-sizing: border-box;
	background: var(--emg-bg);
	color: var(--emg-text);
	border: 1px solid var(--emg-border);
	border-radius: var(--emg-radius-lg);
	padding: 24px;
	font-family: var(--emg-font-ui);
	line-height: 1.55;
	max-width: 100%;
}

.ema-guide-wrap.ema-guide-light {
	--emg-bg:          #f5f7fb;
	--emg-bg-panel:    #ffffff;
	--emg-bg-card:     #ffffff;
	--emg-border:      #d7deea;
	--emg-border-soft: #e4e9f2;
	--emg-text:        #1e2d40;
	--emg-text-dim:    #6b7c93;
	--emg-text-bright: #0b1220;
}

.ema-guide-wrap *,
.ema-guide-wrap *::before,
.ema-guide-wrap *::after {
	box-sizing: border-box;
}

.ema-guide-wrap h4 {
	margin: 0 0 8px;
	color: var(--emg-text-bright);
	font-size: 15px;
	font-weight: 600;
}

.ema-guide-wrap p {
	margin: 0 0 10px;
	color: var(--emg-text);
	font-size: 14px;
}

.ema-guide-lede {
	color: var(--emg-text-dim) !important;
	font-size: 13.5px !important;
	margin-bottom: 20px !important;
}

.ema-guide-subhead {
	margin-top: 24px !important;
	font-size: 13px !important;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--emg-amber) !important;
}

/* Tabs */

.ema-guide-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	border-bottom: 1px solid var(--emg-border);
	padding-bottom: 12px;
	margin-bottom: 20px;
}

.ema-guide-tab {
	background: transparent;
	border: 1px solid var(--emg-border);
	color: var(--emg-text-dim);
	padding: 8px 16px;
	border-radius: 999px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 160ms ease;
}

.ema-guide-tab:hover {
	color: var(--emg-text-bright);
	border-color: var(--emg-amber);
}

.ema-guide-tab.is-active {
	background: var(--emg-amber-glow);
	border-color: var(--emg-amber);
	color: var(--emg-amber);
}

.ema-guide-panel {
	display: none;
}

.ema-guide-panel.is-active {
	display: block;
	animation: ema-guide-fade 180ms ease;
}

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

/* Orientation grid ("How to Read It") */

.ema-guide-orient-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
}

.ema-guide-orient-card {
	background: var(--emg-bg-card);
	border: 1px solid var(--emg-border);
	border-radius: var(--emg-radius-lg);
	padding: 14px 16px;
}

.ema-guide-orient-card p {
	font-size: 13px;
	margin-bottom: 8px;
}

.ema-guide-signal {
	font-size: 12px !important;
	color: var(--emg-text-dim) !important;
	border-top: 1px dashed var(--emg-border-soft);
	padding-top: 8px;
	margin-bottom: 0 !important;
}

/* Playbook cards */

.ema-guide-playbook-card {
	background: var(--emg-bg-card);
	border: 1px solid var(--emg-border);
	border-radius: var(--emg-radius-lg);
	padding: 18px 20px;
	margin-bottom: 16px;
}

.ema-guide-playbook-card:last-child {
	margin-bottom: 0;
}

.ema-guide-combo-chain {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
}

.ema-guide-combo-chip {
	background: var(--emg-amber-glow);
	border: 1px solid var(--emg-amber);
	color: var(--emg-amber);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.ema-guide-combo-arrow {
	flex: 0 0 auto;
	width: 16px;
	height: 2px;
	background: var(--emg-border);
	position: relative;
}

.ema-guide-combo-arrow::after {
	content: '';
	position: absolute;
	right: -1px;
	top: -3px;
	width: 6px;
	height: 6px;
	border-top: 2px solid var(--emg-text-dim);
	border-right: 2px solid var(--emg-text-dim);
	transform: rotate(45deg);
}

.ema-guide-combo-steps {
	margin: 0 0 14px;
	padding-left: 20px;
}

.ema-guide-combo-steps li {
	font-size: 13.5px;
	color: var(--emg-text);
	margin-bottom: 8px;
}

.ema-guide-combo-steps li:last-child {
	margin-bottom: 0;
}

.ema-guide-payoff,
.ema-guide-reality {
	font-size: 13px !important;
	padding: 10px 12px;
	border-radius: var(--emg-radius);
	margin-bottom: 8px !important;
}

.ema-guide-payoff {
	background: rgba(52, 211, 153, 0.08);
	border-left: 3px solid var(--emg-green);
	color: var(--emg-text) !important;
}

.ema-guide-payoff strong {
	color: var(--emg-green);
}

.ema-guide-reality {
	background: var(--emg-bg-panel);
	border-left: 3px solid var(--emg-text-dim);
	color: var(--emg-text-dim) !important;
	margin-bottom: 0 !important;
}

.ema-guide-reality strong {
	color: var(--emg-cyan);
}

/* Analysis Hub flow */

.ema-guide-hub-flow {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0;
	margin-bottom: 18px;
}

.ema-guide-hub-step {
	display: flex;
	gap: 16px;
	position: relative;
	padding-bottom: 22px;
}

.ema-guide-hub-step:not(:last-child)::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 32px;
	bottom: 0;
	width: 1px;
	background: var(--emg-border);
}

.ema-guide-hub-num {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--emg-amber-glow);
	border: 1px solid var(--emg-amber);
	color: var(--emg-amber);
	font-family: var(--emg-font-mono);
	font-weight: 700;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1;
}

.ema-guide-hub-body p {
	margin-bottom: 0;
}

.ema-guide-hub-combos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
	margin-bottom: 18px;
}

.ema-guide-hub-combo-card {
	background: var(--emg-bg-card);
	border: 1px solid var(--emg-border);
	border-radius: var(--emg-radius);
	padding: 12px 14px;
}

.ema-guide-hub-combo-goal {
	font-size: 12px;
	font-weight: 700;
	color: var(--emg-cyan);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-bottom: 6px;
}

.ema-guide-hub-combo-text {
	font-size: 13px;
	color: var(--emg-text);
}

.ema-guide-callout {
	background: var(--emg-bg-card);
	border: 1px solid var(--emg-border);
	border-left: 3px solid var(--emg-cyan);
	border-radius: var(--emg-radius);
	padding: 12px 16px;
	font-size: 13px;
	color: var(--emg-text-dim);
}

.ema-guide-callout strong {
	color: var(--emg-cyan);
}

/* FAQ accordion */

.ema-guide-faq-cat {
	margin-top: 22px;
	padding-bottom: 6px;
	border-bottom: 1px solid var(--emg-border-soft);
	color: var(--emg-amber);
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.ema-guide-faq-cat:first-of-type {
	margin-top: 0;
}

.ema-guide-accordion {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 8px;
}

.ema-guide-faq-item {
	background: var(--emg-bg-card);
	border: 1px solid var(--emg-border);
	border-radius: var(--emg-radius);
	overflow: hidden;
}

.ema-guide-faq-q {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: transparent;
	border: none;
	color: var(--emg-text-bright);
	text-align: left;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 600;
	padding: 13px 16px;
	cursor: pointer;
}

.ema-guide-faq-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	position: relative;
}

.ema-guide-faq-icon::before,
.ema-guide-faq-icon::after {
	content: '';
	position: absolute;
	background: var(--emg-amber);
	transition: transform 160ms ease;
}

.ema-guide-faq-icon::before {
	top: 8px; left: 2px; width: 14px; height: 2px;
}

.ema-guide-faq-icon::after {
	top: 2px; left: 8px; width: 2px; height: 14px;
}

.ema-guide-faq-q[aria-expanded="true"] .ema-guide-faq-icon::after {
	transform: rotate(90deg);
	opacity: 0;
}

.ema-guide-faq-a {
	max-height: 0;
	overflow: hidden;
	transition: max-height 200ms ease;
	padding: 0 16px;
}

.ema-guide-faq-a p {
	color: var(--emg-text-dim);
	font-size: 13px;
	padding-bottom: 14px;
	margin: 0;
}

.ema-guide-faq-item.is-open .ema-guide-faq-a {
	max-height: 400px;
}

/* Admin wrap spacing (wp-admin body already has its own padding) */

.ema-guide-admin-wrap .ema-guide-wrap {
	margin-top: 16px;
}

@media (max-width: 600px) {
	.ema-guide-wrap {
		padding: 16px;
	}
	.ema-guide-combo-chain {
		gap: 4px;
	}
}
