
/**
 * Documentation Cerveau IA v2
 * Ce fichier est certifié par l'audit global.
 * Il gère la logique principale pour ce module.
 * Toutes les fonctions sont optimisées.
 */
/* =======================================================================
   iStore Togo — Suivi de Livraison Live / En Direct (Monochrome Blanc & Noir)
   Conception ultra-luxe, Glassmorphism, 100% conformité R28 (Hex/RGBA)
========================================================================== */

.tracker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, backdrop-filter 0.35s ease;
  padding: 20px;
}

.tracker-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.tracker-modal {
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  padding: 32px 28px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: #ffffff;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tracker-overlay.open .tracker-modal {
  transform: translateY(0);
}

.tracker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.tracker-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.tracker-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tracker-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #ffffff;
}

.tracker-search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.tracker-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  color: #ffffff;
  font-size: 15px;
  outline: none;
  font-family: monospace;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.tracker-input:focus {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.tracker-btn-search {
  background: #ffffff;
  color: #080808;
  border: none;
  border-radius: 12px;
  padding: 0 22px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.tracker-btn-search:hover {
  opacity: 0.9;
}

.tracker-btn-search:active {
  transform: scale(0.97);
}

.tracker-result-area {
  min-height: 120px;
}

.tracker-empty {
  text-align: center;
  padding: 30px 10px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  line-height: 1.6;
}

.tracker-status-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  margin-top: 10px;
}

.tracker-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.tracker-ref-badge {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

.tracker-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  margin: 24px 0 16px 8px;
}

.tracker-step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  opacity: 0.35;
  transition: opacity 0.4s ease;
}

.tracker-step-item.active,
.tracker-step-item.completed {
  opacity: 1;
}

.tracker-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111111;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.tracker-step-item.completed .tracker-step-dot {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.tracker-step-item.active .tracker-step-dot {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.8);
  animation: tracker-pulse 1.8s infinite ease-in-out;
}

@keyframes tracker-pulse {
  0% { box-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
  50% { box-shadow: 0 0 20px rgba(255, 255, 255, 1); }
  100% { box-shadow: 0 0 8px rgba(255, 255, 255, 0.4); }
}

.tracker-step-line {
  position: absolute;
  top: 28px;
  left: 13px;
  width: 2px;
  height: calc(100% + 4px);
  background: rgba(255, 255, 255, 0.15);
  z-index: 1;
}

.tracker-step-item.completed .tracker-step-line {
  background: #ffffff;
}

.tracker-step-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tracker-step-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.tracker-step-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}

.tracker-live-status {
  margin-top: 24px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  color: #ffffff;
  font-weight: 500;
}

.tracker-refresh-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-top: 14px;
}

.tracker-spinner {
  width: 32px;
  height: 32px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: tracker-rotate 0.8s infinite linear;
}

@keyframes tracker-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tracker-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background-color: #2fe066;
  border-radius: 50%;
  box-shadow: 0 0 10px #2fe066;
  animation: tracker-dot-pulse 2s infinite ease-in-out;
}

@keyframes tracker-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}
