/**
 * Timezone Widget - frontend styles
 * Scoped BEM classes (atw-widget__*) to avoid clashing with Divi.
 * Colors/spacing/font come from inline CSS custom properties set
 * per-instance by the shortcode (see class-atw-shortcode.php).
 * The widget background is always transparent by design.
 */

.atw-widget {
	--atw-online-color: #3ddc84;
	--atw-offline-color: #8a8f98;
	--atw-text-color: #eaeaea;
	--atw-tooltip-bg: rgba(15, 17, 20, 0.95);
	--atw-font-family: inherit;

	box-sizing: border-box;
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	max-width: 100%;
	width: fit-content;
	padding: 0;
	background: transparent;
	color: var(--atw-text-color);
	font-family: var(--atw-font-family);
	line-height: 1.4;
	cursor: default;
}

.atw-widget:focus {
	outline: none;
}

.atw-widget:focus-visible {
	outline: 1px dashed currentColor;
	outline-offset: 4px;
}

.atw-widget *,
.atw-widget *::before,
.atw-widget *::after {
	box-sizing: border-box;
}

.atw-widget__header {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	font-family: 'JetBrains Mono', monospace;
	font-size: 10px;
	letter-spacing: 0.1em;
	color: rgb(179, 196, 183);
}

.atw-widget__location {
	white-space: nowrap;
}

.atw-widget__dot-sep {
	opacity: 0.6;
}

.atw-widget__utc {
	white-space: nowrap;
}

.atw-widget__status-row {
	display: flex;
	align-items: center;
}

.atw-widget__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.atw-widget__dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background-color: var(--atw-offline-color);
	box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
	flex-shrink: 0;
}

.atw-widget--online .atw-widget__dot {
	background-color: var(--atw-online-color);
	box-shadow: 0 0 8px 1px var(--atw-online-color);
	animation: atw-pulse 2.2s ease-in-out infinite;
}

.atw-widget__status-text {
	font-family: 'JetBrains Mono', monospace;
	font-size: 9px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgb(116, 138, 124);
}

.atw-widget__tooltip {
	position: fixed;
	top: 0;
	left: 0;
	width: max-content;
	max-width: 220px;
	padding: 8px 10px;
	background: var(--atw-tooltip-bg);
	color: var(--atw-text-color);
	font-family: var(--atw-font-family);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: normal;
	text-transform: none;
	line-height: 1.5;
	border-radius: 6px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
	z-index: 2147483000;
}

.atw-widget__tooltip--visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

@keyframes atw-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.45);
	}
	50% {
		box-shadow: 0 0 0 5px rgba(61, 220, 132, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.atw-widget--online .atw-widget__dot {
		animation: none;
	}
}
