/* Ecosystem UI Dedicated Mobile-First Styles (One-Handed Native UX, Safe-Area, Anti-Zoom) */
@keyframes ecoLivePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.22);
  }
}

.eco-live-dot,
.eco-live-pulse {
  animation: ecoLivePulse 1.5s ease-in-out infinite;
}

@keyframes ecoCycleDash {
  to {
    stroke-dashoffset: -36;
  }
}

.eco-cycle-flow-line {
  stroke-dasharray: 8 4;
  animation: ecoCycleDash 1.4s linear infinite;
}

@keyframes ecoSkeletonShimmer {
  0% {
    opacity: 0.55;
  }
  50% {
    opacity: 0.9;
  }
  100% {
    opacity: 0.55;
  }
}

.eco-skeleton {
  animation: ecoSkeletonShimmer 1.3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .eco-live-dot,
  .eco-live-pulse,
  .eco-cycle-flow-line,
  .eco-skeleton {
    animation: none;
  }
}

.eco-tabular-nums {
  font-variant-numeric: tabular-nums;
}

.eco-portal-clip {
  overflow-x: clip;
}

/* Prevent double-tap delay & accidental pinch zoom during auction seconds */
.eco-tap-target {
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

.eco-cta-primary {
  min-height: 48px;
  touch-action: manipulation;
}

/* Mandatory iOS Safari anti-zoom rule: all inputs & selects >= 16px on mobile */
@media (max-width: 767px) {
  #ecosystem-portal-root input,
  #ecosystem-portal-root select,
  #ecosystem-portal-root textarea,
  #ecosystem-admin-root input,
  #ecosystem-admin-root select,
  #ecosystem-admin-root textarea,
  #ecosystem-home-strip input,
  #ecosystem-home-strip select,
  #ecosystem-home-strip textarea {
    font-size: 16px !important;
    min-height: 44px;
    line-height: 1.45;
  }
}

/* Horizontal snap tab bar with clean scroll edge indicator */
.eco-tab-scroll {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.eco-tab-scroll::-webkit-scrollbar {
  display: none;
}

.eco-tab-item {
  scroll-snap-align: center;
  min-height: 44px;
  touch-action: manipulation;
}

/* Touch-friendly 28x28 range slider thumb inside 44px container */
.eco-range-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y;
}

.eco-range-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
}

.eco-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 9999px;
  background: #f59e0b;
  border: 3px solid #020617;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.eco-range-slider::-moz-range-track {
  height: 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
}

.eco-range-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #f59e0b;
  border: 3px solid #020617;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Mobile Bottom Sheet Infrastructure (100dvh + safe-area) */
.eco-bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  height: 100vh;
  height: 100dvh;
  background: rgba(2, 6, 23, 0.68);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overscroll-behavior: contain;
}

.eco-bottom-sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}

.eco-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 9999px;
  background: #cbd5e1;
  margin: 0 auto 12px;
}

/* Sticky mobile quick-bid dock: strictly positioned above App.jsx 54px bottom nav */
.eco-sticky-bid-bar {
  background: rgba(2, 6, 23, 0.97);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 -10px 28px -8px rgba(15, 23, 42, 0.42);
  bottom: 0;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  touch-action: manipulation;
}

@media (max-width: 767px) {
  .eco-sticky-bid-bar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: 10px;
  }
}

@media (min-width: 1024px) {
  .eco-sticky-bid-bar {
    display: none;
  }
}

/* Ticker touch pause support */
.eco-ticker-track {
  display: flex;
  align-items: center;
  gap: 16px;
  width: max-content;
}

/* Full Light/Dark High-Contrast Parity inside #ecosystem-portal-root & #ecosystem-admin-root */
.dark #ecosystem-portal-root .bg-white,
.dark #ecosystem-admin-root .bg-white {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.dark #ecosystem-portal-root .bg-slate-50,
.dark #ecosystem-portal-root [class*="bg-slate-50"],
.dark #ecosystem-admin-root .bg-slate-50,
.dark #ecosystem-admin-root [class*="bg-slate-50"] {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

.dark #ecosystem-portal-root .bg-slate-100,
.dark #ecosystem-portal-root [class*="bg-slate-100"],
.dark #ecosystem-admin-root .bg-slate-100,
.dark #ecosystem-admin-root [class*="bg-slate-100"] {
  background-color: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}

.dark #ecosystem-portal-root .bg-slate-200,
.dark #ecosystem-portal-root .bg-slate-300,
.dark #ecosystem-admin-root .bg-slate-200,
.dark #ecosystem-admin-root .bg-slate-300 {
  background-color: #334155 !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}

.dark #ecosystem-portal-root .bg-emerald-100,
.dark #ecosystem-admin-root .bg-emerald-100 {
  background-color: rgba(6, 78, 59, 0.72) !important;
  color: #a7f3d0 !important;
  border-color: rgba(52, 211, 153, 0.45) !important;
}

.dark #ecosystem-portal-root .text-slate-950,
.dark #ecosystem-portal-root .text-slate-900,
.dark #ecosystem-portal-root .text-slate-800,
.dark #ecosystem-admin-root .text-slate-950,
.dark #ecosystem-admin-root .text-slate-900,
.dark #ecosystem-admin-root .text-slate-800 {
  color: #f8fafc !important;
}

.dark #ecosystem-portal-root .bg-slate-950 .bg-white,
.dark #ecosystem-admin-root .bg-slate-950 .bg-white {
  background-color: #f8fafc !important;
  color: #020617 !important;
  border-color: #e2e8f0 !important;
}

.dark #ecosystem-portal-root .text-slate-700,
.dark #ecosystem-portal-root .text-slate-600,
.dark #ecosystem-admin-root .text-slate-700,
.dark #ecosystem-admin-root .text-slate-600 {
  color: #cbd5e1 !important;
}

.dark #ecosystem-portal-root .text-slate-500,
.dark #ecosystem-portal-root .text-slate-400,
.dark #ecosystem-admin-root .text-slate-500,
.dark #ecosystem-admin-root .text-slate-400 {
  color: #94a3b8 !important;
}

.dark #ecosystem-portal-root .text-emerald-700,
.dark #ecosystem-portal-root .text-emerald-800,
.dark #ecosystem-portal-root .text-emerald-900,
.dark #ecosystem-admin-root .text-emerald-700,
.dark #ecosystem-admin-root .text-emerald-800,
.dark #ecosystem-admin-root .text-emerald-900 {
  color: #34d399 !important;
}

.dark #ecosystem-portal-root .text-amber-700,
.dark #ecosystem-portal-root .text-amber-800,
.dark #ecosystem-admin-root .text-amber-700,
.dark #ecosystem-admin-root .text-amber-800 {
  color: #fbbf24 !important;
}

.dark #ecosystem-portal-root .text-violet-700,
.dark #ecosystem-admin-root .text-violet-700 {
  color: #c4b5fd !important;
}

.dark #ecosystem-portal-root .bg-emerald-50,
.dark #ecosystem-admin-root .bg-emerald-50 {
  background-color: rgba(6, 78, 59, 0.45) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #ecfdf5 !important;
}

.dark #ecosystem-portal-root .bg-amber-50,
.dark #ecosystem-portal-root .bg-rose-50\/70,
.dark #ecosystem-portal-root .bg-rose-50,
.dark #ecosystem-admin-root .bg-amber-50,
.dark #ecosystem-admin-root .bg-rose-50\/70,
.dark #ecosystem-admin-root .bg-rose-50 {
  background-color: rgba(120, 53, 15, 0.35) !important;
  border-color: rgba(251, 191, 36, 0.35) !important;
  color: #fef3c7 !important;
}

.dark #ecosystem-portal-root input,
.dark #ecosystem-portal-root select,
.dark #ecosystem-portal-root textarea,
.dark #ecosystem-admin-root input,
.dark #ecosystem-admin-root select,
.dark #ecosystem-admin-root textarea {
  background-color: #020617 !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}

.dark #ecosystem-portal-root table thead,
.dark #ecosystem-admin-root table thead {
  background-color: #020617 !important;
}

.dark #ecosystem-portal-root table tbody tr:hover,
.dark #ecosystem-admin-root table tbody tr:hover {
  background-color: rgba(30, 41, 59, 0.7) !important;
}

/* Keep light-text slate-950 dark cards strictly dark in BOTH themes */
#ecosystem-portal-root .bg-slate-950,
#ecosystem-portal-root .bg-slate-900,
#ecosystem-admin-root .bg-slate-950,
#ecosystem-admin-root .bg-slate-900,
#ecosystem-home-strip {
  color: #ffffff;
}
