/* SwiftParcels Tracking – Frontend Widget */

.spt-track-widget {
	font-family: Inter, system-ui, -apple-system, sans-serif;
	max-width: 640px;
	margin: 0 auto;
}

.spt-track-search {
	background: #fff;
	border-radius: 16px;
	padding: 28px 24px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	border: 1px solid #e2e8f0;
	text-align: center;
}

.spt-track-title {
	margin: 0 0 18px;
	font-size: 1.35rem;
	font-weight: 800;
	color: #0f172a;
}

.spt-track-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.spt-track-form input {
	flex: 1;
	min-width: 200px;
	padding: 14px 18px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 500;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.spt-track-form input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.spt-track-form button {
	padding: 14px 28px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}

.spt-track-form button:hover {
	background: #1d4ed8;
	transform: translateY(-1px);
}

.spt-track-hint {
	margin: 12px 0 0;
	font-size: 13px;
	color: #94a3b8;
}

.spt-track-result {
	margin-top: 20px;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
	border: 1px solid #e2e8f0;
}

.spt-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f1f5f9;
}

.spt-result-id-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.spt-result-icon {
	font-size: 1.5rem;
	line-height: 1;
}

.spt-result-id {
	font-size: 1.15rem;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: 0.03em;
}

.spt-result-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border-radius: 999px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
}

.spt-progress-wrap { margin-bottom: 20px; }

.spt-progress-bar {
	height: 8px;
	background: #f1f5f9;
	border-radius: 999px;
	overflow: hidden;
}

.spt-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #3b82f6, #2563eb);
	border-radius: 999px;
	transition: width 0.6s ease;
}

.spt-progress-label {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 12px;
	color: #64748b;
}

.spt-meta-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
}

.spt-meta-item {
	background: #f8fafc;
	border-radius: 10px;
	padding: 12px 14px;
}

.spt-meta-item span {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #94a3b8;
	margin-bottom: 2px;
}

.spt-meta-item strong {
	font-size: 14px;
	color: #0f172a;
}

.spt-map-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 12px;
}

.spt-map-wrap {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	margin-bottom: 20px;
	background: #f1f5f9;
}

.spt-map-iframe {
	display: block;
	width: 100%;
	height: 240px;
	border: 0;
}

.spt-map-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 10px 14px;
	background: #fff;
	border-top: 1px solid #f1f5f9;
	font-size: 12px;
}

.spt-map-pin {
	color: #475569;
	font-weight: 500;
}

.spt-map-link {
	color: #2563eb;
	font-weight: 600;
	text-decoration: none;
}

.spt-map-link:hover { text-decoration: underline; }

.spt-map-empty {
	padding: 40px 20px;
	text-align: center;
	color: #94a3b8;
	font-size: 14px;
	background: #f8fafc;
	border-radius: 14px;
	border: 1px dashed #e2e8f0;
	margin-bottom: 20px;
}

.spt-timeline-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 14px;
}

.spt-timeline-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.spt-timeline-list li {
	display: flex;
	gap: 12px;
	padding-bottom: 16px;
	position: relative;
}

.spt-timeline-list li:last-child { padding-bottom: 0; }

.spt-timeline-icon {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: #eff6ff;
	border: 2px solid #bfdbfe;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

.spt-tl-current .spt-timeline-icon {
	background: #dbeafe;
	border-color: #2563eb;
	box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

.spt-timeline-list li:not(:last-child) .spt-timeline-icon::after {
	content: '';
	position: absolute;
	top: 36px;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	height: calc(100% + 4px);
	background: #e2e8f0;
}

.spt-timeline-content { padding-top: 4px; }

.spt-timeline-content strong {
	display: block;
	font-size: 14px;
	color: #0f172a;
}

.spt-timeline-content span {
	font-size: 12px;
	color: #64748b;
}

.spt-track-error {
	margin-top: 16px;
	padding: 14px 18px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 12px;
	color: #dc2626;
	font-size: 14px;
	text-align: center;
}

.spt-track-loading {
	margin-top: 16px;
	text-align: center;
	color: #64748b;
	font-size: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
}

.spt-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e2e8f0;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: spt-spin 0.7s linear infinite;
}

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

@media (max-width: 480px) {
	.spt-meta-grid { grid-template-columns: 1fr; }
	.spt-track-form { flex-direction: column; }
	.spt-track-form button { width: 100%; }
	.spt-map-iframe { height: 200px; }
}

/* Route map legend + pins */
.spt-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-top: none;
  border-radius: 0 0 10px 10px;
  font-size: 0.82rem;
  color: #334155;
}
.spt-map-route .spt-map-iframe {
  border-radius: 10px 10px 0 0;
  min-height: 280px;
}
.spt-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.spt-pin i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.spt-pin-origin i { background: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.spt-pin-dest i { background: #dc2626; box-shadow: 0 0 0 3px rgba(220,38,6,.2); }
.spt-pin-current i { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.2); }

/* Leaflet map */
.spt-leaflet-map {
  width: 100%;
  height: 300px;
  border-radius: 12px 12px 0 0;
  z-index: 1;
  background: #e2e8f0;
}
.spt-map-leaflet .spt-map-legend {
  border-radius: 0 0 12px 12px;
}
.spt-map-status {
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
  padding: 8px;
}
.spt-leaflet-pin {
  background: transparent !important;
  border: none !important;
}
.spt-leaflet-pin span {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
