/**
 * Loading Semaforo
 *
 * Panel operativo visual del sistema unificado de cierres/aperturas.
 * No decide permisos; solo muestra información.
 */

.vem-loading-semaforo {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	margin: 0 0 10px;
	padding: 8px 10px;
	border: 1px solid #d7e0ea;
	border-radius: 12px;
	background: #f8fbff;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
	font-family: inherit;
}

.vem-loading-semaforo *,
.vem-loading-semaforo *::before,
.vem-loading-semaforo *::after {
	box-sizing: border-box;
}

.vem-loading-semaforo__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 6px;
	padding: 0 2px;
}

.vem-loading-semaforo__title {
	margin: 0;
	font-size: 14px;
	line-height: 1.25;
	font-weight: 800;
	color: #10233f;
	letter-spacing: -0.01em;
}

.vem-loading-semaforo__subtitle {
	margin: 2px 0 0;
	font-size: 11px;
	line-height: 1.35;
	color: #5f6f84;
}

.vem-loading-semaforo__status-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex: 0 0 auto;
	padding: 4px 8px;
	border-radius: 999px;
	background: #ffffff;
	border: 1px solid #d8e4ef;
	color: #3e536d;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.vem-loading-semaforo__sections {
	display: grid;
	grid-template-columns: 1fr;
	gap: 6px;
}

.vem-loading-semaforo__section {
	position: relative;
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 6px;
	padding: 6px 8px;
	border-radius: 10px;
	border: 1px solid transparent;
	overflow: hidden;
}

.vem-loading-semaforo__section--closed {
	background: linear-gradient(135deg, #fff1f1 0%, #fff8f8 100%);
	border-color: #f3b8b8;
}

.vem-loading-semaforo__section--opening {
	background: linear-gradient(135deg, #fff8df 0%, #fffdf3 100%);
	border-color: #ecd180;
}

.vem-loading-semaforo__section--normal {
	background: linear-gradient(135deg, #ecfdf3 0%, #f7fffa 100%);
	border-color: #9eddb7;
}

.vem-loading-semaforo__light-wrap {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 2px;
}

.vem-loading-semaforo__light {
	width: 17px;
	height: 17px;
	border-radius: 50%;
	border: 1.5px solid rgba(255, 255, 255, 0.86);
	box-shadow:
		0 0 0 1px rgba(15, 23, 42, 0.10),
		0 3px 8px rgba(15, 23, 42, 0.14);
}

.vem-loading-semaforo__light--red {
	background: #dc2626;
	animation: vemLoadingSemaforoPulseRed 2.3s ease-in-out infinite;
}

.vem-loading-semaforo__light--yellow {
	background: #f4b400;
	animation: vemLoadingSemaforoPulseYellow 2.6s ease-in-out infinite;
}

.vem-loading-semaforo__light--green {
	background: #16a34a;
	animation: vemLoadingSemaforoPulseGreen 3s ease-in-out infinite;
}

.vem-loading-semaforo__section-title {
	margin: 0 0 4px;
	font-size: 12px;
	line-height: 1.15;
	font-weight: 900;
	color: #16243a;
}

.vem-loading-semaforo__section-description {
	margin: 0;
	font-size: 10.5px;
	line-height: 1.3;
	color: #4d5f75;
}

.vem-loading-semaforo__cards {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 6px;
}

.vem-loading-semaforo__card {
	min-width: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 2px;
	padding: 5px 8px;
	min-height: 0;
	border-radius: 10px;
	background: #ffffff;
	border: 1px solid rgba(148, 163, 184, 0.35);
	box-shadow: none;
}

.vem-loading-semaforo__card--closed {
	border-color: #f3b8b8;
}

.vem-loading-semaforo__card--opening {
	border-color: #ecd180;
}

.vem-loading-semaforo__card-title {
	margin: 0;
	font-size: 10px;
	line-height: 1.15;
	font-weight: 900;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: #10233f;
	text-align: center;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vem-loading-semaforo__ops {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
}

.vem-loading-semaforo__op {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 16px;
	padding: 0 4px;
	border-radius: 999px;
	font-size: 10px;
	line-height: 1;
	font-weight: 900;
	background: #e9eef5;
	color: #1f334f;
}

.vem-loading-semaforo__card--closed .vem-loading-semaforo__op {
	background: #fee2e2;
	color: #991b1b;
}

.vem-loading-semaforo__card--opening .vem-loading-semaforo__op {
	background: #fef3c7;
	color: #92400e;
}

.vem-loading-semaforo__sectors {
	margin: 0;
	font-size: 9.5px;
	line-height: 1.15;
	font-weight: 700;
	color: #52657c;
	text-align: center;
	width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.vem-loading-semaforo__expires {
	margin: 1px 0 0;
	padding: 1px 5px;
	border-radius: 999px;
	background: #fff7d6;
	border: 1px solid #efd37a;
	color: #7a4b00;
	font-size: 9px;
	line-height: 1.1;
	font-weight: 800;
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.vem-loading-semaforo__empty {
	margin: 0;
	padding: 6px 8px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.74);
	border: 1px dashed rgba(100, 116, 139, 0.35);
	color: #64748b;
	font-size: 11px;
	line-height: 1.35;
}

.vem-loading-semaforo__legend {
	margin-top: 6px;
	padding: 4px 7px;
	border-radius: 8px;
	background: #ffffff;
	border: 1px solid #d8e4ef;
	color: #43566f;
	font-size: 10px;
	line-height: 1.25;
	font-weight: 700;
}

.vem-loading-semaforo__error {
	padding: 6px 8px;
	border-radius: 8px;
	background: #fff1f2;
	border: 1px solid #fecdd3;
	color: #9f1239;
	font-size: 11px;
	line-height: 1.4;
	font-weight: 700;
}

.vem-loading-semaforo__loading {
	padding: 6px 8px;
	border-radius: 8px;
	background: #f8fafc;
	border: 1px solid #dbe4ee;
	color: #475569;
	font-size: 11px;
	line-height: 1.4;
	font-weight: 700;
}

@keyframes vemLoadingSemaforoPulseRed {
	0%, 100% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 0 rgba(220, 38, 38, 0.35);
	}
	50% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 6px rgba(220, 38, 38, 0.08);
	}
}

@keyframes vemLoadingSemaforoPulseYellow {
	0%, 100% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 0 rgba(244, 180, 0, 0.38);
	}
	50% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 6px rgba(244, 180, 0, 0.10);
	}
}

@keyframes vemLoadingSemaforoPulseGreen {
	0%, 100% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 0 rgba(22, 163, 74, 0.30);
	}
	50% {
		box-shadow:
			0 0 0 1px rgba(15, 23, 42, 0.10),
			0 3px 8px rgba(15, 23, 42, 0.14),
			0 0 0 6px rgba(22, 163, 74, 0.08);
	}
}

@media (max-width: 1200px) {
	.vem-loading-semaforo__cards {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 992px) {
	.vem-loading-semaforo__cards {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.vem-loading-semaforo__header {
		align-items: flex-start;
		flex-direction: column;
		gap: 6px;
	}

	.vem-loading-semaforo__status-pill {
		white-space: normal;
	}

	.vem-loading-semaforo__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.vem-loading-semaforo {
		width: 100%;
		padding: 8px 10px;
		border-radius: 8px;
	}

	.vem-loading-semaforo__section {
		grid-template-columns: 24px 1fr;
		padding: 6px 8px;
		border-radius: 8px;
	}

	.vem-loading-semaforo__light {
		width: 18px;
		height: 18px;
	}

	.vem-loading-semaforo__title {
		font-size: 13px;
	}
}

@media (max-width: 420px) {
	.vem-loading-semaforo__cards {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vem-loading-semaforo__light--red,
	.vem-loading-semaforo__light--yellow,
	.vem-loading-semaforo__light--green {
		animation: none;
	}
}