/* ==========================================================================
   cyber-motion-v1.css — Advanced Physics & Holographic Cyber Animation Engine
   Designed specifically for resellx (myreselling.cc)
   Zero cursor-tracking interior glow | Full 60-120 FPS GPU Acceleration
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 3D Perspective & Layered Parallax for Product Cards
   -------------------------------------------------------------------------- */
@layer theme {
  [data-theme="dark"] :is(.catalog-card, .ai-card) {
    perspective: 1200px !important;
    transform-style: preserve-3d !important;
    will-change: transform, box-shadow, border-color !important;
    position: relative !important;
    isolation: isolate !important;
  }

  /* Parallax depth for card internal elements */
  [data-theme="dark"] :is(.catalog-card, .ai-card) .brand-banner,
  [data-theme="dark"] :is(.catalog-card, .ai-card) .ai-brand-banner {
    transform: translateZ(12px);
    transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
    will-change: transform;
    position: relative;
    overflow: hidden;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card) :is(h3, .ai-product-title) {
    transform: translateZ(18px);
    transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card) :is(.catalog-card-footer, .ai-card-footer, .catalog-action) {
    transform: translateZ(22px);
    transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.25, 1);
  }

  /* Razor-thin Bevel Specular Sheen (No radial glow, just a crisp diagonal refraction) */
  [data-theme="dark"] :is(.catalog-card, .ai-card) .cyber-bevel-sheen {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    border-radius: inherit;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card):hover .cyber-bevel-sheen {
    opacity: 1;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card) .cyber-bevel-sheen::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
      115deg,
      transparent 0%,
      rgba(255, 255, 255, 0.0) 42%,
      rgba(255, 255, 255, 0.09) 48%,
      rgba(180, 220, 255, 0.18) 50%,
      rgba(255, 255, 255, 0.09) 52%,
      transparent 58%
    );
    transform: rotate(0deg);
    transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card):hover .cyber-bevel-sheen::after {
    transform: translateX(120%);
  }

  /* --------------------------------------------------------------------------
     2. Conic Electric Laser Border Beam (Subtle Cyber Pulse on Hover)
     -------------------------------------------------------------------------- */
  @property --cyber-beam-angle {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card) .cyber-border-beam {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 1px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card):hover .cyber-border-beam {
    opacity: 1;
  }

  [data-theme="dark"] :is(.catalog-card, .ai-card) .cyber-border-beam::before {
    content: '';
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
      from var(--cyber-beam-angle, 0deg),
      transparent 0%,
      transparent 70%,
      rgba(255, 255, 255, 0.3) 88%,
      rgba(96, 165, 250, 0.8) 96%,
      #ffffff 100%
    );
    animation: cyber-beam-spin 3s linear infinite;
  }

  @keyframes cyber-beam-spin {
    from {
      --cyber-beam-angle: 0deg;
      transform: rotate(0deg);
    }
    to {
      --cyber-beam-angle: 360deg;
      transform: rotate(360deg);
    }
  }

  /* --------------------------------------------------------------------------
     3. Magnetic Pull & Quantum Shockwave Ripple on Buttons
     -------------------------------------------------------------------------- */
  .cyber-magnetic-btn {
    position: relative !important;
    isolation: isolate !important;
    will-change: transform !important;
    overflow: hidden !important;
  }

  /* Click Shockwave Ring */
  .cyber-shockwave {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.45) 0%, rgba(96, 165, 250, 0.3) 40%, transparent 70%);
    animation: cyber-shockwave-expand 0.55s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
    z-index: 10;
  }

  @keyframes cyber-shockwave-expand {
    0% {
      transform: translate(-50%, -50%) scale(0);
      opacity: 1;
    }
    50% {
      opacity: 0.7;
    }
    100% {
      transform: translate(-50%, -50%) scale(3.5);
      opacity: 0;
    }
  }

  /* Micro spark particles emitted on click */
  .cyber-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #ffffff;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 6px #60a5fa, 0 0 10px #ffffff;
    animation: cyber-spark-fly 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 11;
  }

  @keyframes cyber-spark-fly {
    0% {
      transform: translate(0, 0) scale(1);
      opacity: 1;
    }
    100% {
      transform: translate(var(--spark-x, 15px), var(--spark-y, -15px)) scale(0);
      opacity: 0;
    }
  }

  /* Shimmer sweep on button hover */
  .catalog-action::before,
  .glass-primary::before,
  .glass-checkout::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 80%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-20deg);
    transition: none;
    pointer-events: none;
    z-index: 3;
  }

  .catalog-action:hover::before,
  .glass-primary:hover::before,
  .glass-checkout:hover::before {
    left: 140%;
    transition: left 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @media (min-width: 768px) {
    header > div:has(> .desktop-store-nav) {
      position: relative !important;
    }
    .desktop-store-nav {
      position: absolute !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      gap: 2px !important;
      white-space: nowrap !important;
      background: none !important;
      box-shadow: none !important;
      border: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      padding: 0 !important;
      border-radius: 0 !important;
    }
  }

  .desktop-store-nav > button,
  .desktop-nav-btn,
  .desktop-store-nav > button:focus,
  .desktop-store-nav > button:focus-visible,
  .desktop-nav-btn:focus,
  .desktop-nav-btn:focus-visible {
    outline: none !important;
    outline-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  /* --------------------------------------------------------------------------
     5. Modal Opening Spring Warp & Cascading Payment Methods
     -------------------------------------------------------------------------- */
  /* Modal backdrop blur dissipation */
  .fixed.inset-0.bg-black\/80,
  .fixed.inset-0[style*="background-color: rgba(0, 0, 0"] {
    animation: cyber-backdrop-fade 0.28s cubic-bezier(0.16, 1, 0.3, 1) both !important;
  }

  @keyframes cyber-backdrop-fade {
    0% {
      opacity: 0;
      backdrop-filter: blur(0px);
      -webkit-backdrop-filter: blur(0px);
    }
    100% {
      opacity: 1;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
  }

  /* Modal window spring entry */
  [role="dialog"],
  .fixed.inset-0 > div:has(> div > h3, > div > button) {
    animation: cyber-modal-spring 0.35s cubic-bezier(0.16, 1, 0.3, 1) both !important;
    transform-origin: center center;
  }

  @keyframes cyber-modal-spring {
    0% {
      transform: scale(0.92) translateY(12px);
      opacity: 0;
    }
    100% {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }

  /* Staggered cascading reveal for payment methods */
  .cyber-stagger-item {
    animation: cyber-item-reveal 0.32s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: calc(var(--stagger-i, 0) * 35ms);
  }

  @keyframes cyber-item-reveal {
    0% {
      opacity: 0;
      transform: translateY(10px) scale(0.98);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }

  /* Floating Copy Success Badge Physics */
  .cyber-copy-toast {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(17, 20, 26, 0.95);
    border: 1px solid rgba(96, 165, 250, 0.5);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), 0 0 10px rgba(96, 165, 250, 0.35);
    pointer-events: none;
    z-index: 100;
    animation: cyber-toast-float 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes cyber-toast-float {
    0% {
      opacity: 0;
      transform: translateX(-50%) translateY(8px) scale(0.85);
    }
    20% {
      opacity: 1;
      transform: translateX(-50%) translateY(0) scale(1.03);
    }
    35% {
      transform: translateX(-50%) translateY(-2px) scale(1);
    }
    75% {
      opacity: 1;
      transform: translateX(-50%) translateY(-5px);
    }
    100% {
      opacity: 0;
      transform: translateX(-50%) translateY(-14px);
    }
  }

  /* --------------------------------------------------------------------------
     6. Digital Counter Roll Effect
     -------------------------------------------------------------------------- */
  .cyber-odometer-digit {
    display: inline-block;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s ease;
  }
}

/* Reduced Motion Override */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
