/*
 * Detalle del pedido: solo lo que Tailwind no resuelve solo (anillo animado, barra de espera,
 * selector de propina y acciones de cada plato).
 */

/* Anillo de progreso del estado: se dibuja con una transición larga al cargar */
.ui-od-ring {
  transition: stroke-dashoffset 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Luz ambiental detrás del estado: respira lento */
.ui-od-aura {
  animation: ui-od-breathe 6s ease-in-out infinite;
}

@keyframes ui-od-breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

/* Ícono central del anillo: entra con un pequeño rebote */
.ui-od-pop {
  animation: ui-od-pop 520ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ui-od-pop {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

/* Reloj de arena de la espera: gira cada tanto */
.ui-od-flip {
  animation: ui-od-flip 2.4s ease-in-out infinite;
}

@keyframes ui-od-flip {
  0%, 70% { transform: rotate(0); }
  85%, 100% { transform: rotate(180deg); }
}

/* Barra indeterminada mientras el restaurante revisa */
.ui-od-indeterminate {
  animation: ui-od-slide 1.8s ease-in-out infinite;
}

@keyframes ui-od-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(300%); }
}

/* Papelera de un plato: botón redondo rojo suave a la derecha, se llena al pasar */
.ui-od-trash {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.875rem;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.ui-od-trash:hover {
  color: #ffffff;
  background: #ef4444;
}

.ui-od-trash:active {
  transform: scale(0.92);
}

/* Cancelar el pedido: botón ancho y claro al final, rojo sin gritar */
.ui-od-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3rem;
  border-radius: 1rem;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  color: #dc2626;
  font-size: 0.875rem;
  font-weight: 700;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.dark .ui-od-cancel {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.ui-od-cancel:hover {
  color: #ffffff;
  background: #ef4444;
  border-color: #ef4444;
}

/* Fila de plato: un leve fondo al pasar el puntero */
.ui-od-line {
  transition: background-color 0.15s ease;
}

.ui-od-line:hover {
  background-color: #f9fafb;
}

.dark .ui-od-line:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

/* Barra de la mesa: cada parte crece al pintar */
.ui-od-split-bar {
  animation: ui-od-grow 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: left center;
}

@keyframes ui-od-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ui-od-ring,
  .ui-od-aura,
  .ui-od-pop,
  .ui-od-flip,
  .ui-od-indeterminate,
  .ui-od-split-bar {
    animation: none;
    transition: none;
  }
}
