/* ==========================================================================
   NEXORA ONE — Master Motion & Micro-Interaction Design System
   Award-Winning, High-Craft Physics Curves, View Transitions, Card Dynamics,
   Cursor Spotlights, Tactile Squish & Stagger Cascades (Linear/Stripe/Apple-Grade).
   ========================================================================== */

:root {
  /* Physics-Based Springs & Micro-Interaction Timing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring-snappy: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-press: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Overwrite legacy eases with silk physics */
  --ease: var(--ease-spring);
  --ease-dec: var(--ease-spring);
}

/* --------------------------------------------------------------------------
   1. SILKY VIEW & PAGE ROUTE TRANSITIONS (Stripe & Linear Quality)
   Replaces jerky mobile slide animations with fluid upward blur-fade.
   -------------------------------------------------------------------------- */
.view.v-fwd,
.view.v-silk {
  animation: vSilkIn 0.28s var(--ease-spring) both;
  will-change: opacity, transform, filter;
}

.view.v-back,
.view.v-silk-back {
  animation: vSilkBack 0.28s var(--ease-spring) both;
  will-change: opacity, transform, filter;
}

.view.v-fade {
  animation: vSilkIn 0.24s var(--ease-spring) both;
  will-change: opacity, transform, filter;
}

@keyframes vSilkIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes vSilkBack {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(1.005);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* --------------------------------------------------------------------------
   2. STAGGERED CASCADE REVEAL (Linear Cascade for Grids & Lists)
   -------------------------------------------------------------------------- */
.stagger-in > * {
  animation: staggerRise 0.36s var(--ease-spring) both;
  will-change: opacity, transform;
}

.stagger-in > *:nth-child(1)  { animation-delay: 20ms; }
.stagger-in > *:nth-child(2)  { animation-delay: 45ms; }
.stagger-in > *:nth-child(3)  { animation-delay: 70ms; }
.stagger-in > *:nth-child(4)  { animation-delay: 95ms; }
.stagger-in > *:nth-child(5)  { animation-delay: 120ms; }
.stagger-in > *:nth-child(6)  { animation-delay: 145ms; }
.stagger-in > *:nth-child(7)  { animation-delay: 170ms; }
.stagger-in > *:nth-child(8)  { animation-delay: 195ms; }
.stagger-in > *:nth-child(9)  { animation-delay: 220ms; }
.stagger-in > *:nth-child(10) { animation-delay: 245ms; }
.stagger-in > *:nth-child(11) { animation-delay: 270ms; }
.stagger-in > *:nth-child(12) { animation-delay: 295ms; }
.stagger-in > *:nth-child(n+13) { animation-delay: 320ms; }

@keyframes staggerRise {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   3. HIGH-CRAFT CARD HOVER & DYNAMIC CURSOR SPOTLIGHT
   -------------------------------------------------------------------------- */
.exp-card,
.pos-product-card,
.hotel-suite-card,
.cockpit-kpi-card,
.hub-ai,
.tier,
.pro-tile,
.seller-card {
  position: relative;
  transition: transform 0.28s var(--ease-spring),
              box-shadow 0.28s var(--ease-spring),
              border-color 0.28s var(--ease-spring) !important;
  will-change: transform, box-shadow;
}

/* Subtle Cursor Flashlight Glow */
.exp-card::before,
.pos-product-card::before,
.hotel-suite-card::before,
.cockpit-kpi-card::before,
.hub-ai::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(380px circle at var(--mouse-x, -300px) var(--mouse-y, -300px), rgba(201, 169, 97, 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
  z-index: 1;
}

.exp-card:hover::before,
.pos-product-card:hover::before,
.hotel-suite-card:hover::before,
.cockpit-kpi-card:hover::before,
.hub-ai:hover::before {
  opacity: 1;
}

/* Card Spring Elevation on Hover */
.exp-card:hover {
  transform: translateY(-4px) scale(1.008) !important;
  border-color: color-mix(in srgb, var(--primary) 50%, var(--outline-variant)) !important;
  box-shadow: 0 20px 36px -8px rgba(0, 0, 0, 0.16), 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent) !important;
}

:root[data-theme="dark"] .exp-card:hover {
  border-color: rgba(121, 183, 155, 0.5) !important;
  box-shadow: 0 22px 44px -8px rgba(0, 0, 0, 0.7), 0 0 28px -2px rgba(121, 183, 155, 0.22) !important;
}

/* Icon Box Micro-Rotate on Hover */
.exp-card:hover .exp-icon-box,
.cat:hover .ic {
  transform: scale(1.1) rotate(-3.5deg) !important;
  transition: transform 0.3s var(--ease-spring-snappy) !important;
}

/* Call-to-action Arrow Spring Nudge */
.exp-card:hover .exp-cta,
.exp-row-card:hover .exp-row-arrow {
  transform: translateX(4px) scale(1.03) !important;
  transition: transform 0.2s var(--ease-spring-snappy) !important;
}

/* --------------------------------------------------------------------------
   4. TACTILE BUTTON DYNAMICS (Physical Squish & Shimmer)
   -------------------------------------------------------------------------- */
.btn,
.iconbtn,
.chip,
.pos-cat-chip,
.cockpit-nav-btn,
.et-toggle-btn {
  transition: transform 0.14s var(--ease-press),
              box-shadow 0.18s var(--ease-spring),
              background 0.18s var(--ease-smooth),
              opacity 0.18s var(--ease-smooth) !important;
  will-change: transform;
}

.btn:hover,
.iconbtn:hover,
.pos-cat-chip:hover {
  transform: translateY(-1.5px);
}

.btn:active,
.iconbtn:active,
.pos-cat-chip:active {
  transform: scale(0.96) translateY(0.5px) !important;
  transition: transform 0.06s var(--ease-press) !important;
}

/* Tactile Pop Animation Triggered via Click */
@keyframes popTouch {
  0% { transform: scale(1); }
  35% { transform: scale(0.93); }
  70% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.pop-touch {
  animation: popTouch 0.26s var(--ease-spring) both !important;
}

/* Primary Button Light Sheen Sweep */
.btn.primary {
  position: relative;
  overflow: hidden;
}

.btn.primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-22deg);
  pointer-events: none;
  transition: none;
}

.btn.primary:hover::before {
  left: 150%;
  transition: left 0.75s var(--ease-spring);
}

/* --------------------------------------------------------------------------
   5. NAVIGATION & SIDEBAR MOTION (Smooth Horizontal Nudge)
   -------------------------------------------------------------------------- */
.dside .side-link {
  transition: transform 0.18s var(--ease-spring),
              background 0.18s var(--ease-smooth),
              color 0.18s var(--ease-smooth) !important;
}

.dside .side-link:hover {
  transform: translateX(4px);
}

.dside .side-link:active {
  transform: translateX(1px) scale(0.99);
}

.cockpit-nav-btn {
  transition: transform 0.2s var(--ease-spring),
              background 0.2s var(--ease-smooth),
              border-color 0.2s var(--ease-smooth) !important;
}

.cockpit-nav-btn:hover {
  transform: translateX(3px);
}

.cockpit-nav-btn:active {
  transform: translateX(1px) scale(0.98);
}

/* --------------------------------------------------------------------------
   6. LIVE STATUS RADAR PULSES (Breathing Dual-Ring Indicators)
   -------------------------------------------------------------------------- */
.cockpit-live-pulse,
.exp-badge.demo .pulse,
.status-radar {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.cockpit-live-pulse::after,
.exp-badge.demo .pulse::after,
.status-radar::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid #10B981;
  animation: radarPulse 2.2s cubic-bezier(0.2, 0, 0.35, 1) infinite;
  pointer-events: none;
}

@keyframes radarPulse {
  0% {
    transform: scale(0.85);
    opacity: 1;
  }
  65% {
    transform: scale(2.4);
    opacity: 0;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* Amber pulse for warnings / reviews */
.pulse-amber {
  background: #F59E0B !important;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8) !important;
}
.pulse-amber::after {
  border-color: #F59E0B !important;
}

/* --------------------------------------------------------------------------
   7. MODAL DIALOGS, SHEETS & SCRIMS (Apple-Grade Glassmorphism)
   -------------------------------------------------------------------------- */
.scrim {
  backdrop-filter: blur(14px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(180%) !important;
  background: rgba(8, 12, 14, 0.68) !important;
  transition: opacity 0.28s var(--ease-spring) !important;
}

.sheet {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.45) !important;
  transition: transform 0.34s var(--ease-spring), opacity 0.28s var(--ease-spring) !important;
}

body.has-dside .sheet {
  border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: -16px 0 54px rgba(0, 0, 0, 0.5) !important;
  transition: transform 0.34s var(--ease-spring) !important;
}

/* Realistic 80mm Thermal Receipt Paper Eject */
@keyframes thermalPaperEject {
  0% {
    opacity: 0;
    transform: translateY(-24px) scaleY(0.7);
    clip-path: inset(0 0 100% 0);
  }
  50% {
    clip-path: inset(0 0 0 0);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    clip-path: inset(0 0 0 0);
  }
}

.thermal-receipt-modal {
  animation: thermalPaperEject 0.42s var(--ease-spring) both !important;
  transform-origin: top center;
}

/* --------------------------------------------------------------------------
   8. MODERN SHIMMER SKELETON (High-Velocity Silk Sheen)
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--sc-low);
  border-radius: var(--r-m);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  animation: modernShimmer 1.5s infinite var(--ease-spring);
}

@keyframes modernShimmer {
  100% {
    transform: translateX(100%);
  }
}

/* --------------------------------------------------------------------------
   9. TOAST NOTIFICATIONS (Floating Glass Pill)
   -------------------------------------------------------------------------- */
.toast {
  background: rgba(15, 22, 25, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(18px) saturate(190%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(190%) !important;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(0, 0, 0, 0.3) !important;
  transition: transform 0.32s var(--ease-spring), opacity 0.28s var(--ease-spring) !important;
}

.toast.show {
  transform: translate(-50%, 0) scale(1) !important;
  opacity: 1 !important;
}

/* --------------------------------------------------------------------------
   10. WORKSPACE COCKPIT TACTILE INTERACTIONS
   -------------------------------------------------------------------------- */
.pos-product-card {
  transition: transform 0.22s var(--ease-spring),
              box-shadow 0.22s var(--ease-spring),
              border-color 0.22s var(--ease-smooth) !important;
}

.pos-product-card:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(16, 185, 129, 0.35) !important;
  border-color: #10B981 !important;
}

.pos-product-card:active {
  transform: scale(0.97) !important;
}

.hotel-suite-card {
  transition: transform 0.24s var(--ease-spring),
              box-shadow 0.24s var(--ease-spring),
              border-color 0.24s var(--ease-smooth) !important;
}

.hotel-suite-card:hover {
  transform: translateY(-3px) scale(1.018) !important;
  box-shadow: 0 14px 32px -6px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 169, 97, 0.4) !important;
}

.hotel-suite-card:active {
  transform: scale(0.98) !important;
}

/* --------------------------------------------------------------------------
   11. SLEEK TRANSLUCENT SCROLLBAR & SMOOTH SCROLL
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  transition: background 0.2s var(--ease-smooth);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

:root[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
}

:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

/* --------------------------------------------------------------------------
   13. SERVICE SHOWCASE INTRODUCTORY MOTION SYSTEM (The Product Is The Demo)
   Linear/Apple/Stripe-Grade Live Archetype Simulations & Interactive Stages
   -------------------------------------------------------------------------- */
.service-intro-stage {
  position: relative;
  border-radius: var(--r-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(145deg, rgba(15, 23, 20, 0.95), rgba(9, 13, 15, 0.98));
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 22px 24px;
  margin: 18px 0;
  overflow: hidden;
  transition: all 0.3s var(--ease-spring);
}

:root[data-theme="light"] .service-intro-stage {
  background: linear-gradient(145deg, #F8FAFC, #EDF2F7);
  border: 1px solid rgba(31, 61, 51, 0.15);
  box-shadow: 0 12px 32px rgba(31, 61, 51, 0.08);
}

.service-intro-stage::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(121, 183, 155, 0.15), transparent 70%);
  pointer-events: none;
  animation: ambientMeshGlow 8s infinite alternate ease-in-out;
}

@keyframes ambientMeshGlow {
  0% { transform: scale(0.9) translate(0, 0); opacity: 0.6; }
  100% { transform: scale(1.2) translate(-20px, 20px); opacity: 1; }
}

.stage-window-frame {
  background: rgba(11, 15, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-m);
  padding: 16px;
  position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] .stage-window-frame {
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.stage-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.stage-dot.red { background: #EF4444; }
.stage-dot.yellow { background: #F59E0B; }
.stage-dot.green { background: #10B981; }

/* 1. Barcode Laser Scanner Simulation */
.stage-laser-box {
  position: relative;
  height: 120px;
  border: 1px dashed rgba(121, 183, 155, 0.35);
  border-radius: var(--r-s);
  background: rgba(16, 185, 129, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 12px;
}

.stage-laser-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #EF4444, #F43F5E, transparent);
  box-shadow: 0 0 12px #EF4444, 0 0 4px #F43F5E;
  animation: barcodeLaser 2.2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes barcodeLaser {
  0% { top: 8%; opacity: 0.3; }
  50% { top: 92%; opacity: 1; }
  100% { top: 8%; opacity: 0.3; }
}

/* 2. Restaurant KOT Docket Slide-in */
.stage-kot-ticket {
  animation: docketSlideIn 0.4s var(--ease-spring) both;
  background: #192420;
  border: 1px solid rgba(121, 183, 155, 0.3);
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

@keyframes docketSlideIn {
  0% { transform: translateY(-16px) scale(0.96); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* 3. Clinic ECG Pulse Line */
.stage-ecg-path {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: ecgDash 2.4s linear infinite;
}

@keyframes ecgDash {
  to {
    stroke-dashoffset: 0;
  }
}

/* 4. GPS Dispatch Radar Sweep */
.stage-radar-circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.3);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12), transparent 75%);
  margin: 0 auto;
  overflow: hidden;
}

.stage-radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(16, 185, 129, 0.4) 300deg, rgba(16, 185, 129, 0.9) 360deg);
  animation: radarRotate 3s linear infinite;
  mask-image: radial-gradient(circle, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 70%);
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 70%);
}

@keyframes radarRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 5. Statutory Audit Holographic Seal Stamp */
@keyframes sealStamp {
  0% { transform: scale(1.8) rotate(-15deg); opacity: 0; }
  65% { transform: scale(0.92) rotate(2deg); opacity: 1; }
  85% { transform: scale(1.05) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.stage-audit-seal {
  animation: sealStamp 0.6s var(--ease-bounce) both;
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY OVERRIDE (Respect User Motion Preferences)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
