/*
 * Wantable Buying Intelligence — Application Styles
 *
 * Propshaft serves these directly. Tailwind handles most styling via utility classes.
 * This file contains non-Tailwind overrides and animations.
 */

/* Turbo loading progress bar — bold copper bar, highly visible */
.turbo-progress-bar {
  background: linear-gradient(90deg, #B45309, #D97706, #B45309);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  height: 6px;
  box-shadow: 0 0 12px rgba(180, 83, 9, 0.5), 0 2px 4px rgba(180, 83, 9, 0.3);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Disabled button state for form submissions */
button[disabled],
input[type="submit"][disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Smooth transitions for Turbo Frame loads */
turbo-frame {
  display: block;
}

/* Flash message fade animation */
@keyframes flashFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-message {
  animation: flashFadeIn 0.3s ease-out;
}

/* Modern tooltip — dark floating bubble on hover */
.tip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1;
}

.tip-trigger {
  font-weight: 600;
  border-bottom: 1.5px dashed currentColor;
  cursor: help;
  opacity: 0.85;
}

.tip-trigger:hover {
  opacity: 1;
}

.tip-bubble {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 280px;
  text-align: left;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Arrow */
.tip-bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
}

.tip-wrapper:hover .tip-bubble {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Row states for reorder toggle (skipped rows dim) */
tr.row-skipped {
  background-color: #f9fafb !important;
  opacity: 0.5;
}
tr.row-skipped td {
  text-decoration: line-through;
  color: #9ca3af;
}

/* Row states for PO cancel (cancelled rows) */
tr.row-cancelled {
  background-color: #fef2f2 !important;
  opacity: 0.6;
}
tr.row-cancelled td {
  text-decoration: line-through;
  color: #b91c1c;
}

/* Admin dropdown menu */
.admin-dropdown {
  position: relative;
}
.admin-dropdown-menu {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  background: #1f2937;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 50;
  transition: opacity 0.15s ease, visibility 0.15s;
  padding: 4px 0;
}
.admin-dropdown:hover .admin-dropdown-menu {
  visibility: visible;
  opacity: 1;
}
.admin-dropdown-menu a {
  display: block;
  padding: 8px 16px;
  font-size: 14px;
  color: #f9fafb;
  transition: background-color 0.15s;
}
.admin-dropdown-menu a:hover {
  background-color: #374151;
}

/* Login page — fashion image slideshow (35s cycle, 5 images) */
@keyframes loginSlideshow {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  20%  { opacity: 1; }
  24%  { opacity: 0; }
  100% { opacity: 0; }
}

.login-slide {
  animation: loginSlideshow 35s infinite;
  opacity: 0;
}
.login-slide:nth-child(1) { animation-delay: 0s; }
.login-slide:nth-child(2) { animation-delay: 7s; }
.login-slide:nth-child(3) { animation-delay: 14s; }
.login-slide:nth-child(4) { animation-delay: 21s; }
.login-slide:nth-child(5) { animation-delay: 28s; }
