/**
 * Estilos do Widget de Rastreamento
 * Inspirado no layout da Olist (envios.olist.com/rastreios)
 *
 * @package VimeHub\Transporte
 */

/* ===========================
   Container Principal
   =========================== */
.vime-tw {
	--vime-tw-primary: #1a1a6e;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	max-width: 720px;
	margin: 0 auto;
	position: relative;
}

/* ===========================
   Formulario de Busca
   =========================== */
.vime-tw-search {
	text-align: center;
	padding: 40px 20px;
}

.vime-tw-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--vime-tw-primary);
	margin: 0 0 8px;
	line-height: 1.3;
}

.vime-tw-subtitle {
	font-size: 16px;
	color: #666;
	margin: 0 0 32px;
}

.vime-tw-form {
	display: flex;
	gap: 0;
	max-width: 560px;
	margin: 0 auto;
}

.vime-tw-input-wrap {
	flex: 1;
	position: relative;
}

.vime-tw-search-icon {
	position: absolute;
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	color: #999;
	pointer-events: none;
}

.vime-tw-input {
	width: 100%;
	padding: 14px 16px 14px 52px;
	border: 2px solid #e0e0e0;
	border-right: none;
	border-radius: 8px 0 0 8px;
	font-size: 15px;
	color: #333;
	outline: none;
	transition: border-color 0.2s ease;
	box-sizing: border-box;
	height: 52px;
}

.vime-tw-input:focus {
	border-color: var(--vime-tw-primary);
}

.vime-tw-input::placeholder {
	color: #aaa;
}

.vime-tw-btn {
	padding: 14px 32px;
	background: var(--vime-tw-primary);
	color: #fff;
	border: none;
	border-radius: 0 8px 8px 0;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.2s ease;
	white-space: nowrap;
	height: 52px;
}

.vime-tw-btn:hover {
	opacity: 0.9;
}

.vime-tw-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ===========================
   Mensagem de Erro
   =========================== */
.vime-tw-error {
	max-width: 560px;
	margin: 16px auto 0;
	padding: 12px 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #dc2626;
	font-size: 14px;
	text-align: center;
}

/* ===========================
   Botao Voltar
   =========================== */
.vime-tw-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 24px;
	font-size: 14px;
	color: #333;
	cursor: pointer;
	transition: background 0.2s ease;
	margin-bottom: 24px;
}

.vime-tw-back:hover {
	background: #f5f5f5;
}

.vime-tw-back svg {
	width: 18px;
	height: 18px;
}

/* ===========================
   Card de Resultado
   =========================== */
.vime-tw-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	padding: 28px 32px;
}

.vime-tw-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 24px;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 24px;
}

.vime-tw-tag-icon {
	width: 20px;
	height: 20px;
	color: #999;
	flex-shrink: 0;
}

.vime-tw-code-label {
	font-size: 14px;
	color: #999;
}

.vime-tw-code-value {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
	letter-spacing: 0.5px;
}

.vime-tw-copy {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: #999;
	transition: color 0.2s ease;
	flex-shrink: 0;
}

.vime-tw-copy:hover {
	color: var(--vime-tw-primary);
}

.vime-tw-copy svg {
	width: 18px;
	height: 18px;
}

/* ===========================
   Timeline
   =========================== */
.vime-tw-timeline {
	position: relative;
	padding-left: 0;
}

.vime-tw-event {
	display: flex;
	gap: 16px;
	position: relative;
	padding-bottom: 32px;
}

.vime-tw-event:last-child {
	padding-bottom: 0;
}

/* Linha vertical entre eventos */
.vime-tw-event:not(:last-child) .vime-tw-marker::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 14px;
	bottom: -32px;
	width: 2px;
	background: #c5d0f0;
	transform: translateX(-50%);
}

/* Data/hora */
.vime-tw-event-date {
	flex-shrink: 0;
	width: 90px;
	text-align: right;
	font-size: 13px;
	color: #888;
	line-height: 1.4;
	padding-top: 2px;
}

.vime-tw-event-date-day {
	display: block;
	font-weight: 600;
	color: #555;
}

.vime-tw-event-date-time {
	display: block;
}

/* Marcador */
.vime-tw-marker {
	position: relative;
	flex-shrink: 0;
	width: 14px;
	height: 14px;
	margin-top: 4px;
}

.vime-tw-marker-dot {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 3px solid var(--vime-tw-primary);
	background: #fff;
	box-sizing: border-box;
}

/* Marcador para status de problema/cancelamento */
.vime-tw-event.is-issue .vime-tw-marker-dot {
	border-color: #ef4444;
	background: #ef4444;
}

/* Marcador para entregue */
.vime-tw-event.is-delivered .vime-tw-marker-dot {
	border-color: #22c55e;
	background: #22c55e;
}

/* Conteudo do evento */
.vime-tw-event-content {
	flex: 1;
	min-width: 0;
}

.vime-tw-event-title {
	font-size: 15px;
	font-weight: 700;
	color: var(--vime-tw-primary);
	margin-bottom: 2px;
	line-height: 1.4;
}

.vime-tw-event.is-issue .vime-tw-event-title {
	color: #ef4444;
}

.vime-tw-event.is-delivered .vime-tw-event-title {
	color: #22c55e;
}

.vime-tw-event-description {
	font-size: 14px;
	color: #555;
	margin-bottom: 4px;
	line-height: 1.5;
}

.vime-tw-event-carrier {
	font-size: 13px;
	color: #999;
	font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
	letter-spacing: 0.5px;
}

.vime-tw-event-location {
	font-size: 13px;
	color: #777;
	margin-top: 2px;
}

/* ===========================
   Loading
   =========================== */
.vime-tw-loading {
	text-align: center;
	padding: 60px 20px;
}

.vime-tw-spinner {
	display: inline-block;
	width: 40px;
	height: 40px;
	border: 3px solid #e5e5e5;
	border-top-color: var(--vime-tw-primary);
	border-radius: 50%;
	animation: vime-tw-spin 0.7s linear infinite;
}

@keyframes vime-tw-spin {
	to { transform: rotate(360deg); }
}

/* ===========================
   Mensagem vazia
   =========================== */
.vime-tw-empty {
	text-align: center;
	padding: 24px;
	color: #888;
	font-size: 14px;
}

/* ===========================
   Responsivo
   =========================== */
@media (max-width: 600px) {
	.vime-tw-search {
		padding: 24px 16px;
	}

	.vime-tw-title {
		font-size: 22px;
	}

	.vime-tw-subtitle {
		font-size: 14px;
		margin-bottom: 24px;
	}

	.vime-tw-form {
		flex-direction: column;
		gap: 12px;
	}

	.vime-tw-input {
		border-right: 2px solid #e0e0e0;
		border-radius: 8px;
	}

	.vime-tw-input:focus {
		border-color: var(--vime-tw-primary);
	}

	.vime-tw-btn {
		border-radius: 8px;
		width: 100%;
	}

	.vime-tw-card {
		padding: 20px 16px;
	}

	.vime-tw-card-header {
		flex-wrap: wrap;
	}

	.vime-tw-event {
		gap: 12px;
	}

	.vime-tw-event-date {
		width: 70px;
		font-size: 12px;
	}
}
