/**
 * AZADIGI Core — Order Tracking & Status Timeline Stylesheet
 * Responsive layout, step timeline, item snapshot table, and WhatsApp support CTA.
 *
 * @package AZADIGI_Core
 */

.az-tracking-block-wrapper {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 16px 60px 16px;
  box-sizing: border-box;
}

.az-tracking-app {
  width: 100%;
  box-sizing: border-box;
}

/* Spinner & Loading */
.az-tracking-loading {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.az-tracking-loading .az-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px auto;
  border: 3px solid #e2e8f0;
  border-top-color: #00b865;
  border-radius: 50%;
  animation: az-spin 0.8s linear infinite;
}

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

.az-tracking-loading p {
  color: #475569;
  font-size: 15px;
  margin: 0;
}

/* Form Shell */
.az-tracking-form-shell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: 0 4px 20px rgba(12, 21, 39, 0.05);
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .az-tracking-form-shell {
    padding: 24px 18px;
  }
}

.az-tracking-intro {
  text-align: center;
  margin-bottom: 28px;
}

.az-tracking-intro .az-badge-pill {
  display: inline-block;
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.az-tracking-intro h2 {
  font-size: 26px;
  font-weight: 700;
  color: #0c1527;
  margin: 0 0 10px 0;
  line-height: 1.25;
}

.az-tracking-intro p {
  color: #64748b;
  font-size: 15px;
  margin: 0 auto;
  max-width: 500px;
  line-height: 1.5;
}

/* Alerts */
.az-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.az-alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.az-alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #b45309;
}

.az-alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Form Grid */
.az-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 600px) {
  .az-form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.az-form-group {
  display: flex;
  flex-direction: column;
}

.az-form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
}

.az-form-group label .required {
  color: #ef4444;
}

.az-form-group input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 15px;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
  width: 100%;
}

.az-form-group input:focus {
  border-color: #00b865;
  box-shadow: 0 0 0 3px rgba(0, 184, 101, 0.15);
  outline: none;
}

.az-field-hint {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 5px;
  line-height: 1.3;
}

.az-form-actions {
  text-align: center;
}

.az-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
  box-sizing: border-box;
}

.az-btn-large {
  width: 100%;
  height: 48px;
  font-size: 16px;
}

.az-btn-primary {
  background: #00b865;
  color: #ffffff;
}

.az-btn-primary:hover:not(:disabled) {
  background: #009954;
  color: #ffffff;
}

.az-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.az-btn-spinner {
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: az-spin 0.6s linear infinite;
}

/* ==========================================
 * Dynamic Results View
 * ========================================== */
.az-tracking-results-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(12, 21, 39, 0.05);
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .az-tracking-results-card {
    padding: 20px 16px;
  }
}

/* Results Header */
.az-results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 20px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.az-results-header-left h3 {
  font-size: 22px;
  font-weight: 700;
  color: #0c1527;
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.az-results-meta {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

.az-results-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status Badges */
.az-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.az-badge-pending-payment {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.az-badge-payment-submitted {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.az-badge-payment-verification {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.az-badge-processing {
  background-color: #ecfeff;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.az-badge-completed {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.az-badge-cancelled {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Visual Step Timeline */
.az-timeline-wrapper {
  margin: 28px 0 32px 0;
}

.az-timeline-steps {
  display: flex;
  justify-content: space-between;
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

.az-timeline-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

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

.az-step-indicator {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.az-step-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.3;
}

.az-step-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.2;
}

/* Completed Step State */
.az-timeline-step.is-completed .az-step-indicator {
  background: #00b865;
  box-shadow: 0 0 0 2px #00b865;
  color: #ffffff;
}

.az-timeline-step.is-completed .az-step-label {
  color: #0f172a;
}

/* Current / Active Step State */
.az-timeline-step.is-current .az-step-indicator {
  background: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
  color: #ffffff;
  transform: scale(1.1);
}

.az-timeline-step.is-current .az-step-label {
  color: #2563eb;
  font-weight: 700;
}

@media (max-width: 640px) {
  .az-timeline-steps {
    flex-direction: column;
    gap: 16px;
  }

  .az-timeline-steps::before {
    top: 18px;
    bottom: 18px;
    left: 18px;
    right: auto;
    width: 3px;
    height: auto;
  }

  .az-timeline-step {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 14px;
    padding: 0;
  }

  .az-step-indicator {
    margin-bottom: 0;
    flex-shrink: 0;
  }
}

/* Cancelled Banner State */
.az-cancelled-banner {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.az-cancelled-banner-icon {
  font-size: 24px;
  color: #ef4444;
  flex-shrink: 0;
}

.az-cancelled-banner-text h4 {
  margin: 0 0 4px 0;
  color: #991b1b;
  font-size: 15px;
  font-weight: 700;
}

.az-cancelled-banner-text p {
  margin: 0;
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.4;
}

/* Status Description Callout */
.az-status-description-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #00b865;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 28px;
}

.az-status-description-box h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.az-status-description-box p {
  margin: 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

/* Items Snapshot Table */
.az-items-card {
  margin-bottom: 28px;
}

.az-items-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: #0c1527;
  margin: 0 0 14px 0;
}

.az-tracking-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  box-sizing: border-box;
}

.az-tracking-items-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.az-tracking-items-table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.az-tracking-item-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.az-tracking-item-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.az-tracking-item-placeholder {
  width: 44px;
  height: 44px;
  background: #f1f5f9;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.az-tracking-item-info strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.3;
}

.az-tracking-guarantee-tag {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 3px;
}

.az-tracking-items-table tfoot td {
  padding: 12px;
  font-size: 15px;
  border-bottom: none;
}

.az-tracking-items-table tfoot .az-total-row td {
  font-size: 16px;
  font-weight: 700;
  color: #0c1527;
  border-top: 2px solid #e2e8f0;
}

/* WhatsApp CTA & Reset Actions */
.az-tracking-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #f1f5f9;
  align-items: center;
}

.az-btn-whatsapp-track {
  background: #25d366;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
  transition: all 0.2s ease;
  max-width: 100%;
  text-align: center;
}

.az-btn-whatsapp-track:hover {
  background: #20bd5a;
  color: #ffffff;
}

.az-btn-whatsapp-track svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.az-btn-reset-lookup {
  background: transparent;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
}

.az-btn-reset-lookup:hover {
  background: #f8fafc;
  color: #0f172a;
}
