/* 
  Shipment Tracking Component - CSS Stylesheet
  Matches corporate styling with royal blue accent colors, clean cards, and a responsive step progress timeline.
*/

.tracking-widget-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color) !important;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
  padding: 2.5rem;
}

.tracking-search-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tracking-search-input-wrap {
  position: relative;
  flex-grow: 1;
}

.tracking-search-input-wrap .search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.tracking-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 3rem;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition-fast) ease;
}

.tracking-search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(163, 122, 26, 0.1);
}

.tracking-search-btn {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-headings);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color var(--transition-fast) ease;
  white-space: nowrap;
}

.tracking-search-btn:hover {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-accent));
  color: #ffffff;
}

/* Shipment Status Banner */
.shipment-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.shipment-status-title {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.status-badge-transit {
  background-color: var(--color-primary);
  color: #ffffff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  display: inline-block;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.consignment-code-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: var(--font-body);
}

.consignment-code-text strong {
  color: var(--text-primary);
}

.estimated-delivery-box {
  text-align: right;
}

.estimated-delivery-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.estimated-delivery-date {
  color: var(--color-primary);
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.6rem;
}

/* Locations Subpanel */
.locations-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2.5rem;
}

.location-title {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.location-name {
  color: var(--color-primary);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0;
}

/* Horizontal Timeline */
.tracking-timeline-row {
  display: flex;
  position: relative;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  padding: 0 1rem;
}

.timeline-connector-line {
  position: absolute;
  top: 1.25rem;
  left: 3%;
  right: 3%;
  height: 4px;
  background-color: #E2E8F0;
  z-index: 1;
}

.timeline-connector-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--color-success);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  z-index: 2;
}

/* Timeline Circles */
.timeline-circle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  box-shadow: 0 0 0 4px #ffffff;
  transition: var(--transition-smooth);
}

/* Completed Step: Solid green, white checkmark */
.timeline-step.completed .timeline-circle {
  background-color: var(--color-success);
  border: 2px solid var(--color-success);
  color: #ffffff;
}

/* Active Step: Gold border, white background, gold reload icon inside */
.timeline-step.active .timeline-circle {
  background-color: #ffffff;
  border: 3px solid var(--color-accent);
  color: var(--color-accent);
}

/* Spinning reload icon */
.timeline-step.active .timeline-circle i {
  animation: spin 3s linear infinite;
  font-size: 1.15rem;
}

/* Pending Step: White background, gray borders, smaller inner gray circle */
.timeline-step.pending .timeline-circle {
  background-color: #ffffff;
  border: 2px solid #CBD5E1;
}

.timeline-step.pending .timeline-circle::after {
  content: '';
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  background-color: #CBD5E1;
  display: block;
}

/* Timeline Info Labels */
.timeline-label {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
}

.timeline-step.active .timeline-label {
  color: var(--color-accent);
}

.timeline-step.pending .timeline-label {
  color: var(--text-muted);
}

.timeline-time {
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 140px;
  line-height: 1.3;
}

/* Footer Section */
.tracking-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Keyframes */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .shipment-meta-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .estimated-delivery-box {
    text-align: left;
  }
  
  .tracking-timeline-row {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 2rem;
    gap: 2rem;
  }
  
  .timeline-connector-line {
    top: 0;
    left: 3.25rem;
    transform: translateX(-50%);
    width: 4px;
    height: 90%;
  }
  
  .timeline-step {
    flex-direction: row;
    text-align: left;
    gap: 1.25rem;
  }
  
  .timeline-circle {
    margin-bottom: 0;
  }
  
  .timeline-time {
    max-width: none;
  }
}
