/* ==========================================================================
   BM Forex Hub — Modern Motion & Responsive Polish Engine (motion.css)
   GPU-Accelerated Animations, Glassmorphism, Micro-Interactions & Responsive Polish
   ========================================================================== */

/* ---------- Interactive Motion Cursor & Scroll Animation ---------- */
.bm-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: #19C3FF;
  border-radius: 50%;
  pointer-events: none;
  z-index: 999999;
  transform: translate3d(-50%, -50%, 0);
  transition: transform 0.05s ease-out, background-color 0.2s ease, opacity 0.3s ease;
  box-shadow: 0 0 10px rgba(25, 195, 255, 0.8);
}

.bm-cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 36px;
  height: 36px;
  border: 1.5px solid rgba(22, 119, 255, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 999998;
  transform: translate3d(-50%, -50%, 0);
  transition: transform 0.15s ease-out, width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background 0.25s ease, opacity 0.3s ease;
  will-change: transform;
}

/* Hover active state over interactive elements */
.bm-cursor-hover .bm-cursor-ring {
  width: 52px;
  height: 52px;
  border-color: rgba(25, 195, 255, 0.8);
  background: rgba(22, 119, 255, 0.08);
}

.bm-cursor-hover .bm-cursor-dot {
  transform: translate3d(-50%, -50%, 0) scale(1.5);
  background: #1677FF;
}

/* Active Scroll Pulsing Animation on Cursor */
.bm-cursor-scrolling .bm-cursor-ring {
  animation: bmCursorScrollPulse 0.8s ease-in-out infinite alternate;
}

@keyframes bmCursorScrollPulse {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(1);
    border-color: rgba(22, 119, 255, 0.5);
    box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.2);
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1.35);
    border-color: rgba(25, 195, 255, 0.9);
    box-shadow: 0 0 16px 4px rgba(25, 195, 255, 0.35);
  }
}

/* Disable Custom Cursor on Touch Devices & Reduced Motion */
@media (hover: none) and (pointer: coarse), (prefers-reduced-motion: reduce) {
  .bm-cursor-dot,
  .bm-cursor-ring {
    display: none !important;
  }
}

/* ---------- Stylish Custom Webkit & Firefox Scrollbars ---------- */
html {
  scrollbar-width: thin;
  scrollbar-color: #283548 #0B0F14;
}

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

::-webkit-scrollbar-track {
  background: #0B0F14;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1e2d42 0%, #283548 100%);
  border-radius: 4px;
  border: 1px solid rgba(22, 119, 255, 0.15);
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #1677FF 0%, #0D47A1 100%);
  box-shadow: 0 0 10px rgba(22, 119, 255, 0.5);
}

/* ---------- Top Scroll Progress Bar ---------- */
.bm-scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #1677FF 0%, #19C3FF 50%, #16C784 100%);
  width: 0%;
  z-index: 99999;
  box-shadow: 0 0 8px rgba(22, 119, 255, 0.6);
  transition: width 0.1s ease-out;
  pointer-events: none;
}

/* ---------- Keyframe Animations ---------- */
@keyframes bmPageFadeIn {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bmFadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 24px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bmFadeInDown {
  from {
    opacity: 0;
    transform: translate3d(0, -20px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes bmScaleIn {
  from {
    opacity: 0;
    transform: scale3d(0.95, 0.95, 1);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes bmPulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 119, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 119, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 119, 255, 0);
  }
}

@keyframes bmPulseSuccess {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 199, 132, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 199, 132, 0);
  }
}

@keyframes bmPulseDanger {
  0% {
    box-shadow: 0 0 0 0 rgba(246, 70, 93, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(246, 70, 93, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(246, 70, 93, 0);
  }
}

@keyframes bmShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes bmBorderGlow {
  0%, 100% {
    border-color: rgba(22, 119, 255, 0.3);
  }
  50% {
    border-color: rgba(22, 119, 255, 0.8);
  }
}

@keyframes bmShakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

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

@keyframes bmGradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Subtle Professional Floating Keyframes (3px–10px range) ---------- */
@keyframes bmSubtleFloatSmall {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -4px, 0);
  }
}

@keyframes bmSubtleFloatMedium {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -7px, 0);
  }
}

@keyframes bmSubtleFloatLarge {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

/* Floating Utility Classes */
.bm-float-sm {
  animation: bmSubtleFloatSmall 4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.bm-float-md {
  animation: bmSubtleFloatMedium 5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.bm-float-lg {
  animation: bmSubtleFloatLarge 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

/* Asynchronous Floating Stagger Delays */
.bm-float-delay-1 { animation-delay: 0s; }
.bm-float-delay-2 { animation-delay: 1.1s; }
.bm-float-delay-3 { animation-delay: 2.2s; }
.bm-float-delay-4 { animation-delay: 3.3s; }
.bm-float-delay-5 { animation-delay: 4.4s; }

/* Global Auto-Applied Subtle Floating Effects */
.icon,
.stat-icon,
.sp-card__icon,
.loc-icon,
.upgrade-cta__icon {
  animation: bmSubtleFloatSmall 4.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.hero-card,
.sp-card--elites,
.upgrade-cta,
.trial-banner {
  animation: bmSubtleFloatMedium 5.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

/* ---------- Page Entrance Transition ---------- */
body {
  animation: bmPageFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) ease-out;
}

/* ---------- Hero Motion & Floating Elements ---------- */
.bm-hero-floating {
  animation: bmSubtleFloatLarge 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.bm-gradient-animated {
  background-size: 200% 200% !important;
  animation: bmGradientShift 8s ease infinite !important;
}

/* ---------- Scroll & Entrance Reveal Utilities ---------- */
.bm-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.bm-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.bm-reveal-scale {
  opacity: 0;
  transform: scale3d(0.94, 0.94, 1);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.bm-reveal-scale.is-visible {
  opacity: 1;
  transform: scale3d(1, 1, 1);
}

.bm-reveal-left {
  opacity: 0;
  transform: translate3d(-32px, 0, 0);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.bm-reveal-right {
  opacity: 0;
  transform: translate3d(32px, 0, 0);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.bm-reveal-left.is-visible,
.bm-reveal-right.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Stagger Delays */
.bm-delay-1 { transition-delay: 0.08s; }
.bm-delay-2 { transition-delay: 0.16s; }
.bm-delay-3 { transition-delay: 0.24s; }
.bm-delay-4 { transition-delay: 0.32s; }
.bm-delay-5 { transition-delay: 0.40s; }

/* ---------- Glassmorphism & Elevation ---------- */
.bm-glass {
  background: rgba(16, 23, 34, 0.75) !important;
  backdrop-filter: blur(16px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
  border: 1px solid rgba(40, 53, 72, 0.6) !important;
}

.bm-card-glow,
.sp-card,
.stat-card,
.offer,
.price-card,
.value,
.statement,
.crypto-card {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease !important;
  will-change: transform, box-shadow;
}

.bm-card-glow:hover,
.sp-card:hover,
.stat-card:hover,
.offer:hover,
.price-card:hover,
.value:hover,
.statement:hover,
.crypto-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(22, 119, 255, 0.6) !important;
  box-shadow: 0 14px 36px -8px rgba(22, 119, 255, 0.22), 0 0 0 1px rgba(22, 119, 255, 0.15) !important;
}

/* ---------- Button Micro-Interactions & Ripple ---------- */
.bm-btn-interactive,
.button,
.btn,
.sp-elite-tier,
.action-btn,
.trial-banner__btn,
.sp-toggle__btn {
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  will-change: transform, box-shadow;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bm-btn-interactive:hover,
.button:hover,
.btn:hover,
.sp-elite-tier:hover,
.action-btn:hover,
.trial-banner__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.3);
}

.bm-btn-interactive:active,
.button:active,
.btn:active,
.sp-elite-tier:active,
.action-btn:active,
.trial-banner__btn:active {
  transform: translateY(0) scale(0.98) !important;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.2) !important;
}

/* Ripple Span */
.bm-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: bmRipple 0.6s linear;
  pointer-events: none;
}

@keyframes bmRipple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Spinner Loading */
.bm-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: bmSpin 0.7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

/* ---------- Form Focus & Validation Animations ---------- */
.bm-input-enhanced,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.bm-input-enhanced:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: #1677FF !important;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.2) !important;
  outline: none !important;
}

.bm-shake {
  animation: bmShakeError 0.4s ease-in-out;
}

/* ---------- Live Signal & Badges ---------- */
.bm-badge-pulse-buy,
.signal-badge--buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: bmPulseSuccess 2.2s infinite;
}

.bm-badge-pulse-sell,
.signal-badge--sell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  animation: bmPulseDanger 2.2s infinite;
}

.bm-badge-pulse-glow {
  animation: bmPulseGlow 2.2s infinite;
}

/* ---------- Table Responsive & Sticky Wrappers ---------- */
.bm-table-container,
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  position: relative;
}

.bm-table-container::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}

.bm-table-container::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
  background: #101722;
}

.bm-table-container::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
  background: #283548;
  border-radius: 3px;
}

.bm-table-container::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #1677FF;
}

.bm-table-sticky thead th,
.user-table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #151D29;
  box-shadow: 0 1px 0 #283548;
}

.bm-table-row,
.user-table tbody tr {
  transition: background-color 0.2s ease;
}

.bm-table-row:hover,
.user-table tbody tr:hover {
  background-color: rgba(22, 119, 255, 0.06) !important;
}

/* ---------- Skeleton Loader Shimmer ---------- */
.bm-skeleton {
  background: linear-gradient(90deg, #151D29 25%, #202B3A 50%, #151D29 75%);
  background-size: 200% 100%;
  animation: bmShimmer 1.6s infinite;
  border-radius: 6px;
  display: inline-block;
}

/* ---------- Stylish Scroll-To-Top Button ---------- */
.bm-scroll-top-btn {
  position: fixed;
  bottom: 84px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 23, 34, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(22, 119, 255, 0.4);
  color: #1677FF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.bm-scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.bm-scroll-top-btn:hover {
  background: #1677FF;
  color: #FFFFFF;
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4);
  transform: translateY(-3px);
}

/* ---------- Accessibility (prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: reduce) {
  body,
  .bm-reveal,
  .bm-reveal-scale,
  .bm-reveal-left,
  .bm-reveal-right,
  .bm-card-glow,
  .bm-btn-interactive,
  .bm-skeleton,
  .bm-badge-pulse-buy,
  .bm-badge-pulse-sell,
  .bm-badge-pulse-glow,
  .bm-hero-floating,
  .bm-gradient-animated,
  .bm-scroll-progress-bar,
  .bm-float-sm,
  .bm-float-md,
  .bm-float-lg,
  .icon,
  .stat-icon,
  .sp-card__icon,
  .loc-icon,
  .upgrade-cta__icon,
  .hero-card,
  .sp-card--elites,
  .upgrade-cta,
  .trial-banner {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ---------- Responsive Layout Safety ---------- */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

img, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
}

/* Responsive Container Bounds */
.bm-container {
  width: 100%;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 1920px) {
  .bm-container {
    max-width: 1720px;
  }
}
