@import url('../style.css');

.service-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
  text-align: center;
}

.service-hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #a78bfa, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.service-hero p {
  color: #4b5563;
  max-width: 640px;
  margin: 0 auto 2rem;
}

.service-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .service-layout { grid-template-columns: 1fr; }
}

.panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.panel h2 {
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  color: #111827;
}

.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #374151;
  margin-bottom: 0.4rem;
}

.field input, .field textarea, .field select {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #111827;
  font-family: inherit;
  font-size: 0.95rem;
}

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: #6d28d9;
}

.field textarea { resize: vertical; min-height: 80px; }

.field-hint {
  font-size: 0.8rem;
  color: #505070;
  margin-top: 0.35rem;
}

.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.btn-danger {
  background: linear-gradient(135deg, #dc2626, #991b1b);
}

.status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.status-queued { background: #3b3b5c33; color: #a0a0b8; border: 1px solid #3b3b5c; }
.status-checking { background: #3b82f622; color: #60a5fa; border: 1px solid #3b82f644; animation: pulse 2s infinite; }
.status-analyzing { background: #a78bfa22; color: #a78bfa; border: 1px solid #a78bfa44; animation: pulse 2s infinite; }
.status-calling { background: #3b82f622; color: #60a5fa; border: 1px solid #3b82f644; animation: pulse 2s infinite; }
.status-on-call { background: #a78bfa22; color: #a78bfa; border: 1px solid #a78bfa44; }
.status-complete { background: #22c55e22; color: #22c55e; border: 1px solid #22c55e44; }
.status-followup { background: #eab30822; color: #eab308; border: 1px solid #eab30844; }
.status-error { background: #ef444422; color: #ef4444; border: 1px solid #ef444444; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.transcript {
  background: #0a0a0f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  padding: 1rem;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.7;
}

.transcript-entry { margin-bottom: 0.75rem; }
.transcript-entry .role {
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.15rem;
}
.transcript-entry.agent .role { color: #a78bfa; }
.transcript-entry.fedex .role { color: #60a5fa; }
.transcript-entry.system .role { color: #7070a0; }
.transcript-entry.finding .role { color: #22c55e; }

.findings-list { list-style: none; }
.findings-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid #1e1e30;
  font-size: 0.9rem;
  color: #a0a0b8;
}
.findings-list li:last-child { border-bottom: none; }
.findings-list .time { font-size: 0.75rem; color: #505070; }

.arch-diagram {
  margin-top: 2rem;
  padding: 1.25rem;
  background: #0e0e18;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #7070a0;
  line-height: 1.8;
  font-family: 'SF Mono', 'Fira Code', monospace;
}

.arch-diagram .highlight { color: #a78bfa; }

.investigation-card {
  background: #0a0a0f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s;
}
.investigation-card:hover { border-color: #a78bfa44; }
.investigation-card.active { border-color: #a78bfa; }

.investigation-card .tracking {
  font-family: 'SF Mono', monospace;
  font-size: 0.9rem;
  color: #e8e8f0;
}

.investigation-card .meta {
  font-size: 0.75rem;
  color: #505070;
  margin-top: 0.25rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: #505070;
  font-size: 0.9rem;
}

.single-col { max-width: 700px; }

.track-form {
  display: flex; gap: 1rem; align-items: flex-end;
}

.track-form .btn { flex-shrink: 0; margin-top: 1.5rem; }

.search-history {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #1e1e30;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.history-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #374151;
}

.history-clear {
  background: none;
  border: none;
  color: #7070a0;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.2rem 0;
  font-family: inherit;
}

.history-clear:hover { color: #ef4444; }

.history-list {
  display: flex; flex-direction: column; gap: 0.5rem;
}

.history-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.history-track-btn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.history-track-btn:hover {
  border-color: #c4b5fd;
  background: #f3f4f6;
}

.history-num {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  color: #111827;
}

.history-status {
  font-size: 0.8rem;
  color: #6d28d9;
}

.history-time {
  font-size: 0.75rem;
  color: #6b7280;
  margin-left: auto;
}

.history-remove {
  flex-shrink: 0;
  width: 2rem;
  background: #0a0a0f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  color: #505070;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.history-remove:hover {
  border-color: #ef444444;
  color: #ef4444;
}

.hidden { display: none !important; }

.results { max-width: 1100px; margin: 0 auto; padding: 0 2rem 4rem; }

.status-header {
  padding: 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}
.status-header.delivered { border-color: #166534; }
.status-header.delayed { border-color: #b91c1c; }
.status-header.transit { border-color: #1d4ed8; }

.status-code { font-size: 1.5rem; font-weight: 700; color: #111827; }
.tracking-num { font-family: monospace; color: #374151; margin-top: 0.25rem; }
.delay-tag {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: #ef444422; color: #ef4444; border: 1px solid #ef444444;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-item { padding: 0.5rem 0; }
.detail-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: #6b7280; margin-bottom: 0.2rem;
}
.detail-value { font-size: 0.9rem; color: #1f2937; line-height: 1.4; }

.scan-count { font-size: 0.8rem; color: #505070; font-weight: 400; }

.timeline { position: relative; padding-left: 1.5rem; }
.timeline-item {
  position: relative;
  padding: 0 0 1.5rem 1.5rem;
  border-left: 2px solid #e5e7eb;
}
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item.latest .timeline-dot { background: #6d28d9; box-shadow: 0 0 8px #c4b5fd; }
.timeline-dot {
  position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #d1d5db; border: 2px solid #ffffff;
}
.timeline-date { font-size: 0.75rem; color: #6b7280; margin-bottom: 0.2rem; }
.timeline-desc { font-weight: 600; color: #111827; font-size: 0.95rem; }
.timeline-loc { font-size: 0.85rem; color: #7070a0; margin-top: 0.15rem; }
.timeline-exception { font-size: 0.8rem; color: #ef4444; margin-top: 0.25rem; }
.timeline-delay { font-size: 0.8rem; color: #eab308; margin-top: 0.25rem; }

.setup-note {
  margin-top: 1.25rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.6;
}
.setup-note strong { color: #a0a0b8; }
.setup-note a { color: #a78bfa; }

.error-banner {
  max-width: 700px; margin: 0 auto 2rem; padding: 1rem 1.25rem;
  background: #ef444415; border: 1px solid #ef444444; border-radius: 8px;
  color: #ef4444; font-size: 0.9rem;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #7070a0;
  margin-bottom: 1rem;
}

.server-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #505070;
}
.server-dot.online { background: #22c55e; }
.server-dot.sandbox { background: #f59e0b; }
.server-dot.offline { background: #ef4444; }

.status-meta {
  font-size: 0.8rem;
  color: #7070a0;
  margin-top: 0.35rem;
}

.sections-stack {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.api-section h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a78bfa;
}

.section-hint {
  font-size: 0.8rem;
  color: #505070;
  margin: -0.5rem 0 1rem;
}

.detail-item-full { grid-column: 1 / -1; }

.nested-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nested-block {
  background: #0a0a0f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  padding: 0.85rem 1rem;
}

.nested-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7070a0;
  margin-bottom: 0.5rem;
}

.nested-grid {
  margin-top: 0.25rem;
}

.detail-value.muted { color: #505070; }

.scan-fields {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.scan-field {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
}

.scan-field-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #505070;
  margin-bottom: 0.15rem;
}

.scan-field-value {
  font-size: 0.85rem;
  color: #c8c8d8;
  line-height: 1.4;
}

.scan-field-nested { margin-top: 0.25rem; }

.raw-json {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #374151;
  max-height: 600px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn:hover { background: #a78bfa22; color: #fff; }

.demo-btn {
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
}

.demo-buttons { margin: 0.5rem auto; }