
/* ─────────────────────────────────────────────────────────────────────────
   MOAT MAP SECTION
   ───────────────────────────────────────────────────────────────────── */

/* ─── Header Section ─── */
.moat-map-header {
	display: grid;
	gap: 1rem;
}

.moat-header-top {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 1.5rem;
	align-items: start;
}

@media (max-width: 991.98px) {
	.moat-header-top {
		grid-template-columns: 1fr;
		gap: 1.25rem;
	}
}

/* Section Badge */
.moat-section-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.375rem 0.75rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: #22c55e;
	background: color-mix(in oklch, #22c55e 12%, var(--bg-light));
	border: 1px solid color-mix(in oklch, #22c55e 25%, transparent);
	border-radius: 0.5rem;
}

.moat-section-badge i {
	font-size: 0.875rem;
}

.moat-template-label {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.625rem;
	font-size: 0.75rem;
	font-weight: 500;
	color: var(--text-muted);
	background: var(--bg-light);
	border: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
	border-radius: 0.375rem;
}

/* Title Group */
.moat-header-title-group {
	flex: 1;
	min-width: 0;
}

.moat-section-title {
	font-family: 'Cabin', system-ui, -apple-system, sans-serif;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--text);
	margin: 0;
}

.moat-section-description {
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--text-muted);
}

/* Overall Score Card */
.moat-overall-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 1rem 1.25rem;
	background: var(--bg-light);
	border: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
	border-radius: 0.875rem;
	box-shadow: var(--shadow-s);
	min-width: 140px;
	text-align: center;
}

.moat-overall-label {
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
}

.moat-overall-score-display {
	display: flex;
	align-items: baseline;
	gap: 0.25rem;
	margin-bottom: 0.375rem;
}

.moat-overall-score-value {
	font-family: 'Cabin', system-ui, -apple-system, sans-serif;
	font-size: 2rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	line-height: 1;
	color: var(--text);
}

.moat-overall-score-max {
	font-size: 1rem;
	font-weight: 500;
	color: var(--text-muted);
	line-height: 1;
}

.moat-overall-rating {
	font-size: 0.8125rem;
	font-weight: 600;
	padding: 0.25rem 0.625rem;
	border-radius: 0.375rem;
}

.moat-overall-rating.moat-rating-strong {
	color: #22c55e;
	background: color-mix(in oklch, #22c55e 12%, var(--bg));
}

.moat-overall-rating.moat-rating-moderate {
	color: #3b82f6;
	background: color-mix(in oklch, #3b82f6 12%, var(--bg));
}

.moat-overall-rating.moat-rating-developing {
	color: #f59e0b;
	background: color-mix(in oklch, #f59e0b 12%, var(--bg));
}

.moat-overall-rating.moat-rating-weak {
	color: #ef4444;
	background: color-mix(in oklch, #ef4444 12%, var(--bg));
}

/* Actions Row */
.moat-header-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: color-mix(in oklch, var(--bg-light) 50%, var(--bg));
	border: 1px solid color-mix(in oklch, var(--border) 30%, transparent);
	border-radius: 0.75rem;
}

@media (max-width: 767.98px) {
	.moat-header-actions {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}
}

.moat-actions-left,
.moat-actions-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

@media (max-width: 767.98px) {
	.moat-actions-left,
	.moat-actions-right {
		width: 100%;
	}
	
	.moat-actions-right {
		justify-content: flex-end;
	}
}

.moat-info-text {
	font-size: 0.8125rem;
	color: var(--text-muted);
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.moat-info-text i {
	font-size: 0.875rem;
	opacity: 0.8;
}

.moat-action-btn {
	border-radius: 0.5rem;
	font-weight: 500;
	white-space: nowrap;
}

/* Legacy Overall Score Badge (keep for compatibility) */
.moat-overall-score {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	font-size: 1.125rem;
	font-weight: 700;
	color: #22c55e;
	background: color-mix(in oklch, #22c55e 12%, var(--bg));
	border: 2px solid #22c55e;
	border-radius: 50%;
}

/* Main container - two column layout */
.moat-map-container {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
}

@media (min-width: 992px) {
	.moat-map-container {
		grid-template-columns: 55fr 45fr;
		gap: 1.5rem;
	}
}

/* Radar chart wrapper */
.moat-radar-wrapper {
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.moat-radar-card {
	background: var(--bg-light);
	border: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
	border-radius: 1rem;
	padding: 1.5rem;
	box-shadow: var(--shadow-s);
	width: 100%;
	position: relative;
}

.moat-radar-card canvas {
	cursor: pointer;
}

.moat-radar-hint {
	font-size: 0.8125rem;
}

#moatRadarChart {
	max-width: 100%;
	height: auto !important;
}

.moat-radar-locked {
	position: absolute;
	inset: 0;
	background: color-mix(in oklch, var(--bg) 55%, transparent);
	border-radius: 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1.5rem;
	backdrop-filter: blur(1px);
}

.moat-locked-content {
	display: grid;
	gap: 0.35rem;
	justify-items: center;
}

.moat-locked-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 0.75rem;
	background: color-mix(in oklch, var(--primary) 10%, var(--bg-light));
	color: var(--primary);
	font-size: 1.1rem;
}

/* Dimensions container */
.moat-dimensions {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

/* Individual dimension card */
.moat-dimension-card {
	background: var(--bg-light);
	border: 1px solid color-mix(in oklch, var(--border) 40%, transparent);
	border-radius: 1rem;
	overflow: hidden;
	transition: all 0.3s ease;
	box-shadow: var(--shadow-s);
}

.moat-upgrade-card {
	border: 1px solid color-mix(in oklch, var(--primary) 30%, var(--border));
	background:
		linear-gradient(120deg, color-mix(in oklch, var(--primary) 10%, transparent), transparent 55%),
		var(--bg-light);
	box-shadow: var(--shadow-s);
}

.moat-upgrade-body {
	padding: 1.15rem 1.25rem 1.25rem;
	display: grid;
	gap: 0.6rem;
}

.moat-upgrade-title {
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 0.35rem;
	color: var(--text);
}

.moat-upgrade-subtitle {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-muted);
}

.moat-upgrade-meta {
	font-size: 0.85rem;
	color: var(--text-muted);
}

.moat-upgrade-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.65rem;
}

.moat-upgrade-hint {
	font-size: 0.75rem;
	color: var(--text-muted);
}

.moat-upgrade-cta {
	border-radius: 0.75rem;
	box-shadow: var(--shadow-xs);
}

.moat-upgrade-cta i {
	font-size: 0.9rem;
}

.moat-dimension-card:hover {
	border-color: var(--border);
	box-shadow: var(--shadow-m);
}

.moat-dimension-card[data-expanded="true"] {
	border-color: color-mix(in oklch, #22c55e 40%, var(--border));
	background: color-mix(in oklch, #22c55e 3%, var(--bg-light));
}

/* Dimension header */
.moat-dimension-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.moat-dimension-header:hover {
	background: color-mix(in oklch, var(--highlight) 8%, transparent);
}

.moat-dimension-header:focus {
	outline: 2px solid var(--primary);
	outline-offset: -2px;
}

/* Dimension icons */
.moat-dimension-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 0.65rem;
	font-size: 1.125rem;
	flex-shrink: 0;
}

.moat-icon-switching {
	background: color-mix(in oklch, #22c55e 15%, var(--bg));
	color: #22c55e;
}

.moat-icon-network {
	background: color-mix(in oklch, #3b82f6 15%, var(--bg));
	color: #3b82f6;
}

.moat-icon-cost {
	background: color-mix(in oklch, #8b5cf6 15%, var(--bg));
	color: #8b5cf6;
}

.moat-icon-intangibles {
	background: color-mix(in oklch, #f59e0b 15%, var(--bg));
	color: #f59e0b;
}

/* Additional defense icon types */
.moat-icon-pricing {
	background: color-mix(in oklch, #22c55e 15%, var(--bg));
	color: #22c55e;
}

.moat-icon-capital {
	background: color-mix(in oklch, #6366f1 15%, var(--bg));
	color: #6366f1;
}

.moat-icon-resilience {
	background: color-mix(in oklch, #10b981 15%, var(--bg));
	color: #10b981;
}

.moat-icon-default {
	background: color-mix(in oklch, #64748b 15%, var(--bg));
	color: #64748b;
}

/* Dimension info */
.moat-dimension-info {
	flex: 1;
	min-width: 0;
}

.moat-dimension-title {
	font-size: 0.9375rem;
	font-weight: 600;
	margin: 0 0 0.2rem;
	color: var(--text);
}

.moat-dimension-rating {
	font-size: 0.75rem;
	font-weight: 500;
}

.moat-rating-strong {
	color: #22c55e;
}

.moat-rating-moderate {
	color: #3b82f6;
}

.moat-rating-developing {
	color: #f59e0b;
}

.moat-rating-weak {
	color: #ef4444;
}

/* Score wrap */
.moat-dimension-score-wrap {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

/* Circular score */
.moat-dimension-score {
	position: relative;
	width: 42px;
	height: 42px;
}

.moat-score-ring {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.moat-score-bg {
	fill: none;
	stroke: color-mix(in oklch, var(--border) 50%, transparent);
	stroke-width: 3;
}

.moat-score-fill {
	fill: none;
	stroke: #22c55e;
	stroke-width: 3;
	stroke-linecap: round;
	transition: stroke-dasharray 0.5s ease;
}

.moat-score-value {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 0.9375rem;
	font-weight: 700;
	color: var(--text);
}

/* Toggle button */
.moat-dimension-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	color: var(--text-muted);
	cursor: pointer;
	border-radius: 0.5rem;
	transition: all 0.2s ease;
}

.moat-dimension-toggle:hover {
	background: color-mix(in oklch, var(--highlight) 15%, transparent);
	color: var(--text);
}

.moat-dimension-toggle i {
	transition: transform 0.3s ease;
}

/* Dimension body (expandable content) */
.moat-dimension-body {
	padding: 0 1rem 1rem;
	animation: moatBodySlide 0.3s ease;
}

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

.moat-dimension-desc {
	font-size: 0.9375rem;
	color: var(--text);
	line-height: 1.6;
	margin: 0 0 1rem;
}

.moat-defense-teaser {
	padding: 0.85rem 0.95rem;
	border-radius: 0.8rem;
	border: 1px solid color-mix(in oklch, var(--primary) 30%, var(--border));
	background:
		linear-gradient(120deg, color-mix(in oklch, var(--primary) 10%, transparent), transparent 55%),
		color-mix(in oklch, var(--bg) 92%, var(--bg-light));
	display: grid;
	gap: 0.5rem;
}

.moat-teaser-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--primary);
}

.moat-teaser-title {
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--text);
	margin: 0;
}

.moat-teaser-meta {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin: 0;
}

.moat-teaser-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.moat-teaser-cta {
	border-radius: 0.7rem;
}

.moat-teaser-cta i {
	font-size: 0.9rem;
}

/* Key evidence */
.moat-evidence {
	margin-bottom: 1rem;
}

.moat-evidence-label {
	display: block;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	margin-bottom: 0.5rem;
	text-transform: uppercase;
}

.moat-evidence-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.moat-evidence-tag {
	display: inline-flex;
	align-items: center;
	padding: 0.375rem 0.75rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #22c55e;
	background: color-mix(in oklch, #22c55e 12%, var(--bg));
	border: 1px solid color-mix(in oklch, #22c55e 30%, transparent);
	border-radius: 2rem;
	transition: all 0.2s ease;
}

.moat-evidence-tag:hover {
	background: color-mix(in oklch, #22c55e 18%, var(--bg));
}

/* Strengths and risks grid */
.moat-strengths-risks {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

@media (max-width: 575.98px) {
	.moat-strengths-risks {
		grid-template-columns: 1fr;
		gap: 0.75rem;
	}
}

.moat-sr-label {
	display: flex;
	align-items: center;
	font-size: 0.65rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	margin-bottom: 0.4rem;
	text-transform: uppercase;
}

.moat-strengths .moat-sr-label {
	color: #22c55e;
}

.moat-risks .moat-sr-label {
	color: #ef4444;
}

.moat-sr-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.moat-sr-list li {
	display: flex;
	align-items: flex-start;
	gap: 0.25rem;
	font-size: 0.8125rem;
	color: var(--text);
	line-height: 1.4;
	margin-bottom: 0.3rem;
}

.moat-strengths .moat-sr-list li i {
	color: #22c55e;
	flex-shrink: 0;
	margin-top: 0.125rem;
}

.moat-risk-dot {
	display: inline-block;
	width: 6px;
	height: 6px;
	background: #ef4444;
	border-radius: 50%;
	flex-shrink: 0;
	margin-top: 0.5rem;
	margin-right: 0.375rem;
}

/* Detail link */
.moat-detail-link {
	display: inline-flex;
	align-items: center;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--primary);
	text-decoration: none;
	transition: all 0.2s ease;
}

.moat-detail-link:hover {
	color: var(--primary);
	text-decoration: underline;
	text-decoration-color: color-mix(in oklch, var(--primary) 50%, transparent);
}

.moat-detail-link i {
	font-size: 0.75rem;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
	:root:not([data-bs-theme="light"]) .moat-dimension-card {
		background: color-mix(in oklch, var(--bg-light) 95%, var(--bg));
	}
	
	:root:not([data-bs-theme="light"]) .moat-radar-card {
		background: color-mix(in oklch, var(--bg-light) 95%, var(--bg));
	}
}

[data-bs-theme="dark"] .moat-dimension-card {
	background: color-mix(in oklch, var(--bg-light) 95%, var(--bg));
}

[data-bs-theme="dark"] .moat-radar-card {
	background: color-mix(in oklch, var(--bg-light) 95%, var(--bg));
}
