/* ============================================================
   COMMON.CSS — shared design tokens & components
   Used by both the problem-report wizard (home.css) and the
   tracking page (tracking.css). Load this file before either.
   ============================================================ */

:root {
  --purple: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark: #6d28d9;
  --bg-dark: #0d0620;
  --bg-dark2: #150a2e;
  --bg-light: #f2f1f6;
  --card-dark: #1b1035;
  --card-border: #3a2a5c;
  --text-light: #e9e6f5;
  --text-muted: #b9b0d6;
  --text-dark: #1a1330;
  --text-dark-muted: #5c5473;
}

body {
  background: radial-gradient(ellipse at 50% 0%, #2a1257 0%, var(--bg-dark) 55%, var(--bg-dark) 100%);
}

/* ----- Collapsible card (status details, items, images, timeline, ...) ----- */
.collapsible-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
#step4Items .collapsible-card {
  box-shadow: none;
}
.collapsible-card--inline {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 14px;
}
.collapsible-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.collapsible-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: transparent !important;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  border-radius: 0 !important;
}
.collapsible-toggle:hover,
.collapsible-toggle:focus,
.collapsible-toggle:focus-visible,
.collapsible-toggle:active {
  background-color: transparent !important;
  outline: none;
  box-shadow: none;
}
.collapsible-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.collapsible-toggle-arrow {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.collapsible-card:not(.is-collapsed) > .collapsible-toggle .collapsible-toggle-arrow {
  transform: rotate(180deg);
}
.collapsible-body {
  display: grid;
  grid-template-rows: 1fr;
  margin-top: 14px;
  opacity: 1 !important;
  color: var(--text);
  transition: grid-template-rows 0.25s ease, margin-top 0.25s ease;
}
.collapsible-inner {
  min-height: 0;
  overflow: hidden;
}
.collapsible-card.is-collapsed > .collapsible-body {
  grid-template-rows: 0fr;
  margin-top: 0;
}

/* ----- Items (Artikel) list ----- */
.items-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}
.items-row {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 12px 0 !important;
  border-top: 1px solid var(--border);
}
.items-row:first-child {
  border-top: none;
  padding-top: 0 !important;
}
.items-quantity {
  flex-shrink: 0;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(88, 28, 135, 0.1)) !important;
  color: var(--accent) !important;
  font-size: clamp(13px, 2vw, 13px);
  font-weight: 700 !important;
  opacity: 1 !important;
}
.items-name {
  color: var(--muted) !important;
  font-size: clamp(13px, 2vw, 13px);
  opacity: 1 !important;
}

/* ----- Lightbox ----- */
/* Base .lightbox* rules now live in lightbox.css (shared with lightbox.js);
   this page's stylesheet only needs to load after it. */

/* ============================================================
   Shared tracking-result components — HTML generated by
   tracking-common.js and rendered on both the tracking page
   and the problem-report wizard (step 4 "Sendungsdetails").
   ============================================================ */

/* ----- Order summary card (company, person, Auftrag/Lieferschein/Tracking) ----- */
.order-summary-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
@media (max-width: 540px) {
  .order-summary-card { padding: 18px 16px; }
}

/* ----- Mitarbeiter (contact) note: avatar + speech-bubble greeting -----
   Shared by the problem-report wizard (step 4) and the tracking page
   order summary card. ----- */
.mitarbeiter-note {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.mitarbeiter-avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 90px;
  width: 90px;
}
.mitarbeiter-photo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #1a1330;
  box-shadow: 0 4px 12px rgba(82,38,125,0.25);
  background: #ede9fe;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mitarbeiter-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.mitarbeiter-label {
  font-size: 11px;
  font-weight: 700;
  color: #1a1330;
  text-align: center;
  letter-spacing: 0.03em;
  width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}
.mitarbeiter-bubble {
  position: relative;
  background: rgba(82, 38, 125, 0.06);
  border: 1px solid rgba(82, 38, 125, 0.25);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  flex: 1;
  min-width: 0;
}
.mitarbeiter-bubble::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 14px;
  width: 12px;
  height: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 22'><path d='M12 1 L1 11 L12 21' fill='rgba(82,38,125,0.06)' stroke='rgba(82,38,125,0.25)' stroke-width='1' stroke-linejoin='round'/><line x1='12' y1='1' x2='12' y2='21' stroke='rgba(82,38,125,0.06)' stroke-width='2'/></svg>");
  background-repeat: no-repeat;
}
.mitarbeiter-bubble::after { display: none; }
.mitarbeiter-bubble b {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 15px;
  color: #1a1330;
}
.mitarbeiter-bubble--plain {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  color: #1a1330;
}
.mitarbeiter-bubble--plain::before,
.mitarbeiter-bubble--plain::after { display: none; }
.mitarbeiter-bubble--plain b { font-size: 16px; }
@media (max-width: 480px) {
  .mitarbeiter-note { flex-direction: column; align-items: center; }
  .mitarbeiter-avatar { width: auto; max-width: 100%; }
  .mitarbeiter-label { width: auto; white-space: nowrap; }
  .mitarbeiter-bubble { border-radius: 16px; }
  .mitarbeiter-bubble::before, .mitarbeiter-bubble::after { display: none; }
}

/* ----- Horizontal progress steps ----- */
.tracking-steps-card {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.tracking-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-start;
}
.tracking-step {
  position: relative;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 0 4px;
}
.tracking-step::before {
  content: '';
  position: absolute;
  top: 5px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.tracking-step:first-child::before { display: none; }
.tracking-step-dot {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 2px solid var(--border);
}
.tracking-step-label {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}
.tracking-step.is-complete::before,
.tracking-step.is-active::before {
  background: var(--accent);
}
.tracking-step.is-complete .tracking-step-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.tracking-step.is-active .tracking-step-dot {
  border-color: var(--accent);
  background: var(--bg-light);
  box-shadow: 0 0 0 3px var(--input-focus);
}
.tracking-step.is-complete .tracking-step-label,
.tracking-step.is-active .tracking-step-label {
  color: var(--text);
  font-weight: 700;
}
@media (max-width: 600px) {
  .tracking-steps {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .tracking-step {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 0 0 20px 0;
  }
  .tracking-step:last-child { padding-bottom: 0; }
  .tracking-step-dot { margin-top: 2px; flex-shrink: 0; }
  .tracking-step-label { font-size: 14px; }
  .tracking-step::before {
    top: 12px;
    left: 5px;
    width: 2px;
    height: 100%;
  }
  /* In the vertical layout the line hangs below a step's own dot,
     connecting down to the next one — the opposite of the horizontal
     layout, where it leads in from the previous step. */
  .tracking-step:first-child::before { display: block; }
  .tracking-step:last-child::before { display: none; }
  .tracking-step-dot + .tracking-step-label { margin-left: 12px; }
}

/* ----- Status card ----- */
.tracking-status-card {
  background: var(--bg-light);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 36px 32px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.tracking-status-card::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-secondary), transparent);
  opacity: 0.6;
}
.tracking-status-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
@media (min-width: 601px) {
  .tracking-status-top {
    flex-wrap: nowrap;
  }
  .tracking-status-top .tracking-provider,
  .tracking-status-top .status-badge {
    flex: 0 0 auto;
  }
  .tracking-status-top .tracking-service {
    flex: 1 1 auto;
    text-align: center;
  }
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: clamp(12.5px, 2vw, 14px);
  font-weight: 700;
  background: rgba(17, 24, 39, 0.08);
  color: var(--text);
}
.status-badge.status-delivered { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.status-badge.status-transit { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.status-badge.status-exception { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.tracking-service {
  font-size: clamp(12.5px, 2vw, 14px);
  color: var(--muted);
}
.tracking-provider {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: clamp(12px, 1.8vw, 13px);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(82, 38, 125, 0.06);
  color: var(--accent);
  border: 1px solid rgba(82, 38, 125, 0.25);
}
.tracking-status-dates {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0px;
}

.tracking-status-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.tracking-status-date {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.tracking-status-date .label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tracking-status-date .value {
  font-size: clamp(14px, 2.2vw, 15.5px);
  font-weight: 700;
  color: var(--text);
}

/* ----- Timeline (Sendungsverlauf) ----- */
.timeline-history-title {
  margin: 18px 0 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
  padding-left: 4px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 18px;
  bottom: -4px;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 2px solid var(--border);
  margin-top: 2px;
  z-index: 1;
}
.timeline-item.is-latest .timeline-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.timeline-status {
  font-size: clamp(13px, 2vw, 13px);
  font-weight: 400;
  color: var(--text);
}
.timeline-item.is-latest .timeline-status { color: var(--accent); }
.timeline-description {
  margin-top: 2px;
  font-size: clamp(13px, 2vw, 13px);
  color: var(--text);
}
.timeline-meta {
  margin-top: 3px;
  font-size: clamp(13px, 2vw, 13px);
  color: var(--muted);
}

/* ----- Images ----- */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
}
.image-tile {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 10px !important;
  overflow: hidden;
  background: var(--input-bg);
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  font: inherit;
  background-color: transparent !important;
}
.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.image-group-title svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----- Footer CTA ("Problem melden") ----- */
.tracking-footer-cta {
  background: var(--bg-light);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  text-align: center;
}
.tracking-footer-cta p {
  margin: 0 0 16px;
  font-size: clamp(14px, 2.2vw, 15.5px);
  color: var(--muted);
}
.tracking-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: #52267D;
  color: #fff !important;
  padding: 14px 24px;
  border-radius: 32px;
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(14px, 2vw, 15px);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.tracking-footer-btn:hover {
  background: #3f1d63 !important;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .tracking-status-card,
  .collapsible-card:not(.collapsible-card--inline) {
    padding: 16px;
  }
  .tracking-status-top {
    gap: 8px;
  }
  .tracking-provider,
  .status-badge {
    font-size: 11px;
    padding: 5px 11px;
  }
  .tracking-service {
    font-size: 12px;
  }
  .tracking-steps-card {
    padding: 18px 14px 16px;
  }
  .tracking-status-date {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .tracking-status-date .value {
    word-break: break-word;
  }
  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  }
}
