/**
 * Akel Tools Design System — Feedback (alert, skeleton, empty, progress)
 */

.at-alert {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
	padding: var(--space-4);
	font-size: var(--text-md);
	border-radius: 0;
	border: 1px solid var(--border-default);
	border-left-width: 3px;
}

.at-alert--info {
	border-left-color: var(--brand-accent);
	background: var(--brand-accent-soft);
	color: var(--text-primary);
}

.at-alert--success {
	border-left-color: var(--brand-success);
	background: var(--brand-success-soft);
	color: var(--text-primary);
}

.at-alert--warning {
	border-left-color: var(--brand-warning);
	background: var(--brand-warning-soft);
	color: var(--text-primary);
}

.at-alert--danger {
	border-left-color: var(--brand-danger);
	background: var(--brand-danger-soft);
	color: var(--text-primary);
}

.at-alert__body {
	flex: 1;
	font-weight: var(--weight-medium);
}

.at-alert__title {
	font-weight: var(--weight-semibold);
	margin-bottom: var(--space-1);
}

.at-alert__dismiss {
	flex-shrink: 0;
	padding: 0;
	background: none;
	border: none;
	color: inherit;
	opacity: 0.6;
	cursor: pointer;
	font-size: var(--text-lg);
	line-height: 1;
}

.at-alert__dismiss:hover {
	opacity: 1;
}

/* Skeleton */
.at-skeleton {
	display: block;
	background: linear-gradient(
		90deg,
		var(--surface-subtle) 0%,
		var(--surface-sunken) 50%,
		var(--surface-subtle) 100%
	);
	background-size: 200% 100%;
	animation: at-shimmer 1.4s ease-in-out infinite;
	border-radius: 0;
}

.at-skeleton--text {
	height: 14px;
	margin-bottom: var(--space-2);
}

.at-skeleton--text:last-child {
	width: 70%;
}

.at-skeleton--circle {
	width: 40px;
	height: 40px;
	border-radius: 0;
}

.at-skeleton--rect {
	height: 120px;
}

/* Empty state */
.at-empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: var(--space-9) var(--space-6);
}

.at-empty-state__icon {
	width: 48px;
	height: 48px;
	margin-bottom: var(--space-4);
	color: var(--text-tertiary);
	opacity: 0.5;
}

.at-empty-state__title {
	margin: 0 0 var(--space-2);
	font-size: var(--text-lg);
	font-weight: var(--weight-semibold);
	color: var(--text-primary);
}

.at-empty-state__body {
	margin: 0 0 var(--space-5);
	font-size: var(--text-md);
	color: var(--text-secondary);
	max-width: 360px;
}

/* Progress */
.at-progress {
	height: 6px;
	background: var(--surface-subtle);
	border-radius: 0;
	overflow: hidden;
}

.at-progress__bar {
	height: 100%;
	background: var(--brand-accent);
	border-radius: 0;
	transition: width var(--duration-slow) var(--ease-out);
}

.at-progress--success .at-progress__bar {
	background: var(--brand-success);
}

.at-progress--indeterminate .at-progress__bar {
	width: 40% !important;
	animation: at-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes at-progress-indeterminate {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(350%); }
}

.at-progress__label {
	display: flex;
	justify-content: space-between;
	margin-bottom: var(--space-2);
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	color: var(--text-secondary);
}

/**
 * Canonical loading spinner — circular ring (@keyframes at-spin lives in tokens.css).
 * Sizes: modifiers use px so local border spinners inherit global radius carve-out.
 */
.at-spinner {
	display: inline-block;
	width: 1em;
	height: 1em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	box-sizing: border-box;
	vertical-align: -0.15em;
	animation: at-spin 0.6s linear infinite;
	border-radius: 50% !important;
}

.at-spinner--sm {
	width: 14px;
	height: 14px;
	border-width: 2px;
}

.at-spinner--md {
	width: 18px;
	height: 18px;
	border-width: 2px;
}

.at-spinner--lg {
	width: 24px;
	height: 24px;
	border-width: 3px;
}
