/**
 * Interactive Car Diagram - Frontend Styles
 *
 * @package Interactive_Car_Diagram
 * @version 1.0.0
 */

/* Diagram Container */
.icd-diagram-wrapper {
	box-sizing: border-box;
	position: relative;
	width: 100%;
	clear: both;
}

.icd-diagram-wrapper *,
.icd-diagram-wrapper *::before,
.icd-diagram-wrapper *::after {
	box-sizing: inherit;
}

.icd-diagram-wrapper.icd-align-center {
	margin-left: auto;
	margin-right: auto;
}

.icd-diagram-wrapper.icd-align-left {
	margin-left: 0;
	margin-right: auto;
}

.icd-diagram-wrapper.icd-align-right {
	margin-left: auto;
	margin-right: 0;
}

.diagram-box {
	position: relative;
	width: 100%;
	max-width: 900px;
	height: auto;
	margin: 0 auto;
}

.diagram-box svg {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	overflow: visible;
}

/* SVG Base Styles */
.icst0 {
	fill: #ffffff;
	stroke-width: 0.5px;
	stroke: #000000;
	transition: fill 0.15s ease-in-out;
}

.icst9,
.icst0.icst9 {
	stroke-width: 2.5px;
}

.icst1 {
	fill: #221F1F;
}

.icst2 {
	display: none;
	fill: #221F1F;
}

.icst3 {
	fill: #ffffff;
	fill-opacity: 0;
}

.icst4 {
	fill: #231F20;
}

.icst5 {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-weight: 700;
	letter-spacing: 1px;
}

.icst6 {
	font-size: 32px;
}

/* SVG Interactive Parts */
svg a.icd-part-link {
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

svg a.icd-part-link:hover g.icd-part .icst0,
svg a.icd-part-link:focus g.icd-part .icst0 {
	fill: #7bd6ef;
}

svg a.icd-part-link:focus-visible g.icd-part .icst0 {
	stroke: #2563eb;
	stroke-width: 2px;
}

/* Selected / Active Part (for custom events & admin) */
g.icd-part.is-selected .icst0 {
	stroke: #2563eb !important;
	stroke-width: 2.5px !important;
	filter: drop-shadow(0 0 4px rgba(37, 99, 235, 0.6));
}

/* Tooltip Styles */
.icd-tooltip {
	position: absolute;
	width: auto;
	width: max-content;
	max-width: 280px;
	background: #1E293B;
	color: #ffffff;
	text-align: center;
	border-radius: 6px;
	padding: 8px 12px;
	font-size: 13px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-weight: 600;
	line-height: 1.35;
	z-index: 99999;
	white-space: normal;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transition: opacity 0.15s ease-out;
}

/* Tooltip Arrow - default right */
.icd-tooltip::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 100%;
	margin-top: -6px;
	border-width: 6px;
	border-style: solid;
	border-color: transparent #1E293B transparent transparent;
}

/* Tooltip Arrow - left flip */
.icd-tooltip.left-side::after {
	left: 100%;
	right: auto;
	border-color: transparent transparent transparent #1E293B;
}

/* Popup Modal */
.icd-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.icd-modal-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	animation: icdFadeIn 0.2s ease-out;
}

.icd-modal-container {
	position: relative;
	background: #ffffff;
	border-radius: 12px;
	width: 100%;
	max-width: 480px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	z-index: 2;
	animation: icdScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #1e293b;
}

.icd-modal-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 20px 24px 16px;
	border-bottom: 1px solid #f1f5f9;
}

.icd-modal-header-text h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
}

.icd-modal-badge {
	display: inline-block;
	margin-top: 6px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #2563eb;
	background: #eff6ff;
	padding: 2px 8px;
	border-radius: 999px;
}

.icd-modal-close {
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #94a3b8;
	cursor: pointer;
	padding: 0;
	margin: -4px -4px 0 12px;
	transition: color 0.15s;
}

.icd-modal-close:hover {
	color: #0f172a;
}

.icd-modal-body {
	padding: 20px 24px;
	font-size: 14px;
	line-height: 1.6;
	color: #475569;
	max-height: 60vh;
	overflow-y: auto;
}

.icd-modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	padding: 16px 24px 20px;
	border-top: 1px solid #f1f5f9;
	background: #fafafa;
}

.icd-modal-action-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #2563eb;
	color: #ffffff !important;
	padding: 8px 18px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none !important;
	transition: background 0.15s;
}

.icd-modal-action-btn:hover {
	background: #1d4ed8;
	color: #ffffff !important;
}

.icd-modal-secondary-btn {
	background: #ffffff;
	border: 1px solid #cbd5e1;
	color: #475569;
	padding: 8px 16px;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.icd-modal-secondary-btn:hover {
	background: #f1f5f9;
	border-color: #94a3b8;
}

@keyframes icdFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes icdScaleUp {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}

/* Responsive */
@media screen and (max-width: 768px) {
	.diagram-box {
		width: 100% !important;
	}
	.icd-modal-container {
		max-width: 92%;
		margin: 0 auto;
	}
}
