/* ==========================================================================
   Flash Sale Bot System — supplemental styles
   Tailwind v4 (browser build) handles utilities; this file adds the
   personality: typeface, scrollbars, entrance motion, focus polish.
   ========================================================================== */

:root {
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Numeric/latin bits look better slightly tighter */
.tabular {
  font-variant-numeric: tabular-nums;
}

/* --- Scrollbars ------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #475569;
  background-clip: padding-box;
}

/* --- Focus polish ----------------------------------------------------- */
.field:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-glow);
}

/* --- Live status dot -------------------------------------------------- */
.pulse-dot {
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--emerald);
  animation: pulseRing 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

/* --- Entrance motion -------------------------------------------------- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.animate-fade-up {
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.overlay-in {
  animation: overlayIn 0.2s ease forwards;
}
.modal-in {
  animation: modalIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Card hover ------------------------------------------------------- */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease, border-color 0.25s ease;
  will-change: transform;
}
.hover-lift:hover {
  transform: translateY(-4px);
  border-color: #475569;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.55);
}

/* --- Toast ------------------------------------------------------------ */
.toast-in {
  animation: fadeUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* --- Tab underline ---------------------------------------------------- */
.tab-btn {
  position: relative;
  transition: color 0.2s ease;
}
.tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--emerald);
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab-btn.tab-active::after {
  transform: scaleX(1);
}

/* --- Reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::after,
  *::before {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
