/* ==========================================================================
   UMX Matrix Widget – Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper
   -------------------------------------------------------------------------- */
.umx-matrix-wrapper {
	--umx-axis-thickness: 2px;
	--umx-arrow-size: 8px;
	--umx-axis-color: #374151;
	--umx-grid-color: #e5e7eb;

	display: flex;
	flex-direction: column;
	gap: 16px;
	font-family: inherit;
	box-sizing: border-box;
}

.umx-matrix-wrapper *,
.umx-matrix-wrapper *::before,
.umx-matrix-wrapper *::after {
	box-sizing: inherit;
}

/* --------------------------------------------------------------------------
   Filter area (two filter groups stacked)
   -------------------------------------------------------------------------- */
.umx-filter-area {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

/* One filter group row */
.umx-filter-group {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.umx-filter-group__label {
	font-size: 0.75rem;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	min-width: 110px;   /* keeps labels aligned across both rows */
}

.umx-filter-group__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* Shared button styles */
.umx-filter-btn {
	display: inline-flex;
	align-items: center;
	padding: 5px 14px;
	border: 2px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	color: #374151;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease,
	            color 0.15s ease, opacity 0.25s ease;
	line-height: 1.4;
	font-family: inherit;
}

.umx-filter-btn:hover {
	border-color: #9ca3af;
}

/* Active state – Filter 1 (blue, overridden via Elementor color control) */
.umx-filter-group--1 .umx-filter-btn.is-active {
	background-color: #2b6cb0;
	border-color:     #2b6cb0;
	color: #fff;
}

/* Active state – Filter 2 (green, overridden via Elementor color control) */
.umx-filter-group--2 .umx-filter-btn.is-active {
	background-color: #276749;
	border-color:     #276749;
	color: #fff;
}

.umx-filter-btn:focus-visible {
	outline: 2px solid #2b6cb0;
	outline-offset: 2px;
}

/* Divider between the two filter groups */
.umx-filter-group + .umx-filter-group {
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
}

/* --------------------------------------------------------------------------
   Outer layout (labels + canvas)
   -------------------------------------------------------------------------- */
.umx-matrix-outer {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
}

.umx-matrix-row {
	display: flex;
	align-items: center;
	width: 100%;
}

/* Axis labels */
.umx-axis-label {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--text-inverted, #ffffff);
	white-space: nowrap;
	user-select: none;
}

.umx-axis-label--top,
.umx-axis-label--bottom {
	text-align: center;
	padding: 6px 0;
	width: 100%;
}

.umx-axis-label--left  { padding-right: 12px; }
.umx-axis-label--right { padding-left:  12px; }

/* --------------------------------------------------------------------------
   Matrix canvas
   -------------------------------------------------------------------------- */
.umx-matrix-canvas {
	position: relative;
	flex: 1 1 auto;
	width: 100%;
	height: 560px;        /* overridden by Elementor slider control */
	overflow: visible;    /* allow items to slightly overflow at edges */
	/*background: #f9fafb;*/
	/*border: 1px solid #e5e7eb;*/
}

/* --------------------------------------------------------------------------
   Grid lines
   -------------------------------------------------------------------------- */
.umx-matrix-gridline {
	position: absolute;
	background-color: var(--umx-grid-color, #e5e7eb);
	pointer-events: none;
}

.umx-matrix-gridline--v {
	top: 0;
	bottom: 0;
	width: 1px;
	transform: translateX(-50%);
}

.umx-matrix-gridline--h {
	left: 0;
	right: 0;
	height: 1px;
	transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Axes
   -------------------------------------------------------------------------- */
.umx-matrix-axis {
	position: absolute;
	background-color: var(--umx-axis-color, #374151);
	pointer-events: none;
}

/* Horizontal axis – runs full width, centered vertically */
.umx-matrix-axis--h {
	left: 0;
	right: 0;
	top: 50%;
	height: var(--umx-axis-thickness);
	transform: translateY(-50%);
}

/* Vertical axis – runs full height, centered horizontally */
.umx-matrix-axis--v {
	top: 0;
	bottom: 0;
	left: 50%;
	width: var(--umx-axis-thickness);
	transform: translateX(-50%);
}

/* --------------------------------------------------------------------------
   Arrow heads
   -------------------------------------------------------------------------- */
.umx-matrix-arrow {
	position: absolute;
	width: 0;
	height: 0;
}

/* Left arrowhead on horizontal axis */
.umx-matrix-arrow--left {
	left: 0;
	top: 50%;
	transform: translate(-100%, -50%);
	border-top:    var(--umx-arrow-size) solid transparent;
	border-bottom: var(--umx-arrow-size) solid transparent;
	border-right:  calc(var(--umx-arrow-size) * 1.4) solid var(--umx-axis-color, #374151);
}

/* Right arrowhead */
.umx-matrix-arrow--right {
	right: 0;
	top: 50%;
	transform: translate(100%, -50%);
	border-top:    var(--umx-arrow-size) solid transparent;
	border-bottom: var(--umx-arrow-size) solid transparent;
	border-left:   calc(var(--umx-arrow-size) * 1.4) solid var(--umx-axis-color, #374151);
}

/* Top arrowhead on vertical axis */
.umx-matrix-arrow--top {
	top: 0;
	left: 50%;
	transform: translate(-50%, -100%);
	border-left:   var(--umx-arrow-size) solid transparent;
	border-right:  var(--umx-arrow-size) solid transparent;
	border-bottom: calc(var(--umx-arrow-size) * 1.4) solid var(--umx-axis-color, #374151);
}

/* Bottom arrowhead */
.umx-matrix-arrow--bottom {
	bottom: 0;
	left: 50%;
	transform: translate(-50%, 100%);
	border-left:   var(--umx-arrow-size) solid transparent;
	border-right:  var(--umx-arrow-size) solid transparent;
	border-top:    calc(var(--umx-arrow-size) * 1.4) solid var(--umx-axis-color, #374151);
}

/* --------------------------------------------------------------------------
   Matrix items – circular dots
   -------------------------------------------------------------------------- */
.umx-matrix-item {
	position: absolute;
	transform: translate(-50%, -50%);
	border-radius: 50%;           /* perfect circle; overridden by Elementor control */
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease;
	z-index: 10;
	overflow: visible;            /* label sits outside the circle */
    @media screen and (max-width: 1024px) {
        width: 40px!important;
        height: 40px!important;
    };
    @media screen and (max-width: 768px) {
        width: 32px!important;
        height: 32px!important;
    }
}

.umx-matrix-item.has-shadow {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22), 0 1px 4px rgba(0, 0, 0, 0.12);
}

.umx-matrix-item:hover,
.umx-matrix-item:focus-visible {
	transform: translate(-50%, -50%) scale(1.15);
	z-index: 20;
}

.umx-matrix-item:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px rgba(43, 108, 176, 0.45);
}

/* --------------------------------------------------------------------------
   Item label – sits to the right of the circle
   -------------------------------------------------------------------------- */
.umx-matrix-item__label {
	position: absolute;
	left: calc(100% + 8px);
	top: 50%;
	transform: translateY(-50%);
	white-space: nowrap;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	padding: 3px 8px;
	border-radius: 4px;
	color: #1f2937;
	font-size: 0.6875rem;
	font-weight: 600;
	line-height: 1.3;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
	pointer-events: none;
	z-index: 5;
	transition: opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   Floating cursor tooltip
   -------------------------------------------------------------------------- */
#umx-floating-tooltip {
	position: fixed;
	z-index: 99999;
	max-width: 280px;
	background: #1f2937;
	color: #f9fafb;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 0.8125rem;
	line-height: 1.55;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.15);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.12s ease;
	transform: translateZ(0);   /* GPU layer – keeps it snappy */
}

#umx-floating-tooltip.is-visible {
	opacity: 1;
}

.umx-tooltip__headline {
	display: block;
	font-weight: 700;
	font-size: 0.875rem;
	margin: 0 0 5px;
	color: #fff;
}

.umx-tooltip__body {
	color: rgba(255, 255, 255, 0.82);
	margin: 0;
}

.umx-tooltip__body p { margin: 0; }

/* --------------------------------------------------------------------------
   Hidden state (filtered out)
   -------------------------------------------------------------------------- */
.umx-matrix-item[aria-hidden="true"] {
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.6);
}

.umx-matrix-item[aria-hidden="true"] .umx-matrix-item__label {
	opacity: 0;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
	.umx-filter-group {
		flex-direction: column;
		align-items: flex-start;
	}

	.umx-filter-group__label {
		min-width: unset;
	}
}

@media (max-width: 600px) {
	.umx-matrix-canvas {
		height: 320px !important; /* forced minimum on very small screens */
	}

	.umx-matrix-item__headline {
		font-size: 0.6875rem;
	}

	.umx-filter-btn {
		font-size: 0.8125rem;
		padding: 4px 10px;
	}
}
