/*
 * Content Gap Analyzer Styles
 * Variables rely on niche-finder.css being loaded.
 */

.nm-cg-app {
	--nm-bg: #0f1117;
	--nm-surface: #1a1d2e;
	--nm-surface2: #222538;
	--nm-border: rgba(255, 255, 255, 0.08);
	--nm-border-hover: rgba(255, 255, 255, 0.16);
	--nm-accent: #6c63ff;
	--nm-accent2: #e74c3c;
	--nm-accent-glow: rgba(108, 99, 255, 0.35);
	--nm-text: #e8eaf6;
	--nm-text-muted: #8b8fa8;
	--nm-text-dim: #5a5e78;
	--nm-radius: 14px;
	--nm-radius-sm: 8px;
	--nm-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
	--nm-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	--nm-transition: 0.2s ease;

	font-family: var(--nm-font);
	color: var(--nm-text);
	max-width: 1000px;
	margin: 0 auto;
}

.nm-cg-hero {
	background: var(--nm-bg);
	border-radius: calc(var(--nm-radius) + 4px);
	padding: 40px 32px;
	position: relative;
	overflow: visible;
	border: 1px solid var(--nm-border);
	box-shadow: var(--nm-shadow);
}

/* ─── Header ────────────────────────────────────────────── */
.nm-cg-header {
	text-align: center;
	margin-bottom: 32px;
}

.nm-cg-title-main {
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	font-weight: 800;
	letter-spacing: -0.5px;
	background: linear-gradient(135deg, #fff 0%, #a8b2ff 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin: 0 0 10px 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.nm-cg-title-icon {
	-webkit-text-fill-color: initial;
	font-size: 1.8rem;
	filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.6));
}

.nm-cg-subtitle {
	color: var(--nm-text-muted);
	font-size: 0.95rem;
	margin: 0;
	line-height: 1.6;
}

/* ─── Tabs ──────────────────────────────────────────────── */
.nm-cg-tabs {
	display: flex;
	gap: 8px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--nm-border);
	border-radius: 50px;
	padding: 4px;
	max-width: 360px;
	margin: 0 auto 32px auto;
}

.nm-cg-tab-btn {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--nm-text-muted);
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 50px;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	text-align: center;
}

.nm-cg-tab-btn.active {
	background: var(--nm-accent);
	color: #fff;
	box-shadow: 0 4px 12px var(--nm-accent-glow);
}

.nm-cg-tab-btn:hover:not(.active) {
	color: #fff;
	background: rgba(255, 255, 255, 0.05);
}

/* ─── Form Elements ─────────────────────────────────────── */
.nm-cg-form {
	max-width: 760px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.nm-cg-input-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.nm-cg-input-group label {
	color: var(--nm-text-muted);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.nm-cg-input-wrap {
	display: flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius-sm);
	padding: 0 12px;
	height: 48px;
	transition: border-color var(--nm-transition);
}

.nm-cg-input-wrap:focus-within {
	border-color: var(--nm-accent);
	box-shadow: 0 0 0 3px var(--nm-accent-glow);
}

.nm-cg-input {
	flex: 1;
	background: transparent;
	border: none;
	color: #fff;
	font-family: var(--nm-font);
	font-size: 14px;
	outline: none;
	height: 100%;
	padding: 0;
	box-shadow: none !important;
}

.nm-cg-input::placeholder {
	color: var(--nm-text-dim);
}

/* Normal Input field styling (Keyword) */
input.nm-cg-input {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius-sm);
	padding: 20px 16px;
	height: 48px;
	color: #fff;
	font-size: 14px;
	outline: none;
	transition: border-color var(--nm-transition);
	width: 100%;
	box-sizing: border-box;
}

input.nm-cg-input:focus {
	border-color: var(--nm-accent);
	box-shadow: 0 0 0 3px var(--nm-accent-glow);
}

.nm-cg-paste-btn {
	background: transparent;
	border: none;
	color: var(--nm-text-muted);
	cursor: pointer;
	padding: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.nm-cg-paste-btn:hover {
	color: #fff;
}

/* Select Dropdown Elements */
.nm-cg-meta-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.nm-cg-select {
	background: #1a1d2e;
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius-sm);
	color: #fff;
	height: 48px;
	padding: 0 16px;
	outline: none;
	font-family: var(--nm-font);
	font-size: 14px;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8fa8' stroke-width='2.5'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 16px;
	transition: border-color var(--nm-transition);
	width: 100%;
	box-sizing: border-box;
}

.nm-cg-select:focus {
	border-color: var(--nm-accent);
	box-shadow: 0 0 0 3px var(--nm-accent-glow);
}

/* Submit Button */
.nm-cg-btn {
	background: linear-gradient(135deg, #6c63ff 0%, #8b5cf6 100%);
	color: #fff;
	border: none;
	border-radius: var(--nm-radius-sm);
	height: 52px;
	font-family: var(--nm-font);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 10px;
	box-shadow: 0 4px 16px var(--nm-accent-glow);
}

.nm-cg-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px var(--nm-accent-glow);
}

.nm-cg-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Button Spinner */
.nm-cg-btn-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: #fff;
	animation: nm-cg-spin 0.8s linear infinite;
}

@keyframes nm-cg-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Error Message */
.nm-cg-error-msg {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.2);
	color: #ef4444;
	border-radius: var(--nm-radius-sm);
	padding: 16px;
	font-size: 14px;
	text-align: center;
	margin: 24px auto 0 auto;
	max-width: 760px;
}

/* ─── Results Section ───────────────────────────────────── */
.nm-cg-results {
	margin-top: 40px;
	animation: nm-cg-fade-in 0.4s ease;
}

.nm-cg-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--nm-border);
	padding-bottom: 16px;
}

.nm-cg-results-title {
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0;
	color: #fff;
}

.nm-cg-export-btn,
.nm-cg-copy-btn {
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--nm-border);
	color: var(--nm-text-muted);
	border-radius: var(--nm-radius-sm);
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.nm-cg-export-btn:hover,
.nm-cg-copy-btn:hover {
	background: var(--nm-accent);
	color: #fff;
	border-color: var(--nm-accent);
}

.nm-cg-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	margin-bottom: 32px;
}

.nm-cg-card {
	background: var(--nm-surface);
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius);
	padding: 24px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transition: border-color var(--nm-transition);
}

.nm-cg-card:hover {
	border-color: var(--nm-border-hover);
}

.nm-cg-card-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 16px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
	padding-bottom: 10px;
}

/* Summary Card specific styling */
.nm-cg-summary-card {
	grid-column: 1 / -1;
	background: linear-gradient(135deg, #1a1d2e 0%, #111422 100%);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nm-cg-summary-item {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nm-cg-label {
	font-size: 13px;
	text-transform: uppercase;
	font-weight: 700;
	color: var(--nm-text-muted);
	letter-spacing: 0.5px;
}

.nm-cg-badge {
	font-size: 13px;
	font-weight: 800;
	padding: 4px 12px;
	border-radius: 50px;
	text-transform: uppercase;
}

.nm-cg-badge.easy {
	background: rgba(34, 197, 94, 0.15);
	color: #22c55e;
}

.nm-cg-badge.medium {
	background: rgba(234, 179, 8, 0.15);
	color: #eab308;
}

.nm-cg-badge.hard {
	background: rgba(239, 68, 68, 0.15);
	color: #ef4444;
}

.nm-cg-difficulty-reason {
	font-size: 14px;
	line-height: 1.5;
	margin: 0;
	color: var(--nm-text-muted);
}

.nm-cg-text {
	font-size: 14px;
	line-height: 1.6;
	margin: 0;
	color: var(--nm-text);
}

.nm-cg-divider {
	border: 0;
	height: 1px;
	background: rgba(255, 255, 255, 0.06);
	margin: 8px 0;
}

/* Lists styling */
.nm-cg-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.nm-cg-list li {
	position: relative;
	padding-left: 18px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--nm-text-muted);
}

.nm-cg-list li::before {
	content: "•";
	position: absolute;
	left: 0;
	color: var(--nm-accent);
	font-weight: bold;
	font-size: 18px;
	top: -2px;
}

/* Specific List Item Headers */
.nm-cg-list li strong {
	color: #fff;
	display: block;
	margin-bottom: 2px;
}

/* ─── Superior Script Outline ───────────────────────────── */
.nm-cg-outline-section {
	background: #151827;
	border: 1px solid var(--nm-accent);
	box-shadow: 0 8px 32px rgba(108, 99, 255, 0.1);
	border-radius: var(--nm-radius);
	padding: 32px;
	margin-top: 32px;
}

.nm-cg-outline-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	padding-bottom: 16px;
	margin-bottom: 24px;
}

.nm-cg-outline-title {
	font-size: 1.25rem;
	font-weight: 800;
	color: #fff;
	margin: 0;
}

.nm-cg-outline-body {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.nm-cg-outline-node {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius-sm);
	padding: 20px;
	transition: background 0.2s, border-color 0.2s;
}

.nm-cg-outline-node:hover {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.15);
}

.nm-cg-node-heading {
	font-size: 1.1rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 8px 0;
}

.nm-cg-node-goal {
	font-size: 13px;
	color: var(--nm-accent);
	font-weight: 600;
	margin-bottom: 12px;
}

.nm-cg-node-bullets {
	margin: 0;
	padding-left: 20px;
}

.nm-cg-node-bullets li {
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--nm-text-muted);
	margin-bottom: 6px;
}

.nm-cg-node-bullets li:last-child {
	margin-bottom: 0;
}

/* ─── Credits Modal ─────────────────────────────────────── */
.nm-cg-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: nm-cg-fade-in 0.2s ease;
}

.nm-cg-modal {
	background: var(--nm-surface, #1a1d2e);
	border: 1px solid var(--nm-border, rgba(255, 255, 255, 0.08));
	border-radius: calc(var(--nm-radius, 14px) + 4px);
	padding: 40px 36px;
	max-width: 440px;
	width: 100%;
	text-align: center;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
	animation: nm-cg-slide-up 0.3s ease;
}

.nm-cg-modal-icon {
	font-size: 3rem;
	margin-bottom: 16px;
}

.nm-cg-modal-title {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--nm-text, #fff);
	margin-bottom: 12px;
}

.nm-cg-modal-body {
	color: var(--nm-text-muted, #8b8fa8);
	font-size: 0.95rem;
	line-height: 1.6;
	margin-bottom: 28px;
}

.nm-cg-modal-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nm-cg-modal-btn {
	display: block;
	width: 100%;
	padding: 13px 20px;
	border-radius: var(--nm-radius-sm, 8px);
	font-family: var(--nm-font, inherit);
	font-size: 0.95rem;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: transform var(--nm-transition, 0.2s), box-shadow var(--nm-transition, 0.2s);
	border: none;
}

.nm-cg-modal-btn-primary {
	background: linear-gradient(135deg, var(--nm-accent, #6c63ff) 0%, #8b5cf6 100%);
	color: #fff;
	box-shadow: 0 4px 16px var(--nm-accent-glow, rgba(108, 99, 255, 0.35));
}

.nm-cg-modal-btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 24px var(--nm-accent-glow, rgba(108, 99, 255, 0.35));
}

.nm-cg-modal-btn-secondary {
	background: transparent;
	color: var(--nm-text-muted, #8b8fa8);
	border: 1px solid var(--nm-border, rgba(255, 255, 255, 0.08));
}

.nm-cg-modal-btn-secondary:hover {
	color: var(--nm-text, #fff);
	border-color: var(--nm-border-hover, rgba(255, 255, 255, 0.16));
}

/* Credits Badge Display */
.nm-cg-credits-badge {
	text-align: center;
	font-size: 13px;
	color: var(--nm-text-muted);
	margin-top: 14px;
}

.nm-cg-credits-badge strong {
	color: #fff;
}

.nm-cg-credits-badge.nm-cg-credits-paid {
	color: #62ff8e;
}

.nm-cg-credits-badge.nm-cg-credits-free {
	color: #5cb8ff;
}

.nm-cg-credits-badge.nm-cg-credits-empty {
	color: #ff5c5c;
}

/* ─── Skeleton Loading ──────────────────────────────────── */
@keyframes nm-cg-pulse {

	0%,
	100% {
		opacity: 1;
	}

	50% {
		opacity: 0.5;
	}
}

.nm-cg-skeleton-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
	margin-top: 32px;
	animation: nm-cg-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.nm-cg-skeleton-card {
	background: var(--nm-surface);
	border: 1px solid var(--nm-border);
	border-radius: var(--nm-radius);
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nm-cg-skel-full {
	grid-column: 1 / -1;
	height: 220px;
}

.nm-cg-skeleton-line {
	height: 12px;
	background: rgba(255, 255, 255, 0.05);
	border-radius: 4px;
	width: 100%;
}

.nm-cg-skel-title {
	height: 18px;
	background: rgba(255, 255, 255, 0.08);
	width: 50%;
	margin-bottom: 8px;
}

/* Animations */
@keyframes nm-cg-fade-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes nm-cg-slide-up {
	from {
		opacity: 0;
		transform: translateY(20px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
	.nm-cg-hero {
		padding: 24px 16px;
	}

	.nm-cg-meta-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.nm-cg-grid,
	.nm-cg-skeleton-grid {
		grid-template-columns: 1fr;
	}

	.nm-cg-results-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
	}

	.nm-cg-export-btn {
		width: 100%;
		justify-content: center;
	}

	.nm-cg-outline-section {
		padding: 20px 16px;
	}
}