/**
 * Styles innovants et micro-interactions
 * Auto Pièces Équipements
 */

/* Animations et effets */
@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-gradient-flow {
  background-size: 400% 400%;
  animation: gradient-flow 15s ease infinite;
}

.glassmorphism {
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Effets 3D */
.card-3d {
  transform-style: preserve-3d;
  transform: perspective(1000px) rotateY(var(--rotate-y, 0deg)) rotateX(var(--rotate-x, 0deg));
  transition: transform 0.3s ease;
}

.tilt-effect {
  --rotate-x: 0;
  --rotate-y: 0;
  transform: perspective(1000px) rotateX(var(--rotate-x)) rotateY(var(--rotate-y));
  transition: transform 0.3s ease;
}

/* Configurateur de pièces */
.configurator-steps {
  display: grid;
  grid-template-rows: 1fr;
  gap: 1.5rem;
}

.configurator-steps .step {
  display: none;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.configurator-steps .step.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.vehicle-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.vehicle-card {
  position: relative;
  background-color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.vehicle-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.vehicle-info {
  margin-top: 1rem;
}

.ar-overlay {
  position: absolute;
  bottom: 1rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
}

/* Recherche vocale */
.voice-search-button {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.voice-search-button:hover {
  background-color: var(--primary-hover);
}

.voice-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--primary);
  opacity: 0;
  pointer-events: none;
}

.voice-search-active .voice-feedback {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.1; transform: translate(-50%, -50%) scale(1.3); }
  100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
}

/* Tableau de bord client */
.customer-dashboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .customer-dashboard {
    grid-template-columns: 2fr 1fr;
  }
}

.garage-virtuel {
  background-color: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.vehicle-health {
  position: relative;
  margin: 1rem 0;
}

.health-meter {
  height: 8px;
  width: 100%;
  background-color: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}

.health-meter::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--percentage, 0%);
  background-color: #10b981;
  border-radius: 4px;
}

.order-timeline {
  position: relative;
  padding-left: 2rem;
}

.order-timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 8px;
  width: 2px;
  background-color: #e5e7eb;
}

.order-event {
  position: relative;
  margin-bottom: 1.5rem;
}

.event-dot {
  position: absolute;
  top: 4px;
  left: -2rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--primary);
}

.order-event[data-status="delivered"] .event-dot {
  background-color: #10b981;
}

.order-event[data-status="processing"] .event-dot {
  background-color: #f59e0b;
}

/* Intégration sociale */
.social-proof {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .social-proof {
    grid-template-columns: 1fr 1fr;
  }
}

.activity-items {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.activity-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-right: 1rem;
}

.activity-item time {
  margin-left: auto;
  font-size: 0.875rem;
  color: #6b7280;
}

.review-cards {
  display: grid;
  gap: 1rem;
}

.review-card {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.review-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.verified-badge {
  color: #10b981;
  font-size: 0.875rem;
}

.product-info {
  display: flex;
  align-items: center;
}

.product-info img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin-right: 0.5rem;
}

/* Système de gamification */
.gamification-system {
  margin-top: 2rem;
}

.achievement-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.achievement {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
}

.achievement.unlocked:hover {
  transform: translateY(-5px);
}

.achievement.locked {
  opacity: 0.6;
  filter: grayscale(1);
}

.badge-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.loyalty-progress {
  margin-top: 1.5rem;
}

.progress-bar {
  position: relative;
  height: 1.5rem;
  background-color: #e5e7eb;
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--progress, 0%);
  background-color: var(--primary);
  border-radius: 0.75rem;
}

.progress-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.rewards-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reward {
  font-size: 0.875rem;
  padding: 0.375rem 0.75rem;
  background-color: rgba(194, 31, 31, 0.1);
  color: var(--primary);
  border-radius: 9999px;
}

/* Design adaptatif avancé */
@media (pointer: fine) and (min-width: 1024px) {
  .product-card:hover .product-3d-view {
    display: block;
    transform: translateY(-20px) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .animate-gradient-flow,
  .voice-feedback {
    animation: none !important;
  }
}

@container (width > 480px) {
  .vehicle-card {
    grid-template-columns: 1fr 2fr;
  }
}
