/* ===================================
   Bouncing Ball CTA Styles
   3D animated ball for company CTA
   =================================== */

/* CSS Variables */
:root {
  --ball-size-desktop: 120px;
  --ball-size-mobile: 100px;
  --ball-bg: #111827;
  --ball-bg-gradient: linear-gradient(145deg, #1f2937 0%, #111827 100%);
  --ball-shadow-color: rgba(17, 24, 39, 0.35);
}

/* Container - Absolute positioning within hero */
.bouncing-ball-container {
  position: absolute;
  bottom: 60px;
  right: 60px;
  z-index: 10;
  pointer-events: none; /* Let clicks pass through container */
}

/* Shadow element - Oval blur below ball */
.bouncing-ball-shadow {
  position: absolute;
  width: calc(var(--ball-size-desktop) * 0.8);
  height: 20px;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at center,
    var(--ball-shadow-color) 0%,
    transparent 70%
  );
  filter: blur(8px);
  pointer-events: none;
  will-change: transform, opacity;
}

/* Main ball - 3D sphere with gradient and shadows */
.bouncing-ball {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ball-size-desktop);
  height: var(--ball-size-desktop);
  border-radius: 50%;
  background: var(--ball-bg-gradient);
  text-decoration: none;
  cursor: pointer;
  pointer-events: auto; /* Enable clicks on ball only */
  position: relative;

  /* 3D inset shadows for depth */
  box-shadow:
    inset -8px -8px 16px rgba(31, 41, 55, 0.8),
    inset 8px 8px 16px rgba(0, 0, 0, 0.4),
    inset -2px -2px 8px rgba(0, 0, 0, 0.6),
    0 10px 30px var(--ball-shadow-color);

  /* Performance optimizations */
  will-change: transform;
  transform: translate3d(0, 0, 0); /* Force GPU acceleration */
  backface-visibility: hidden;

  transition: box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Glossy highlight - Creates 3D shine effect */
.bouncing-ball::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 25%;
  width: 40%;
  height: 40%;
  background: radial-gradient(
    ellipse at top left,
    rgba(255, 255, 255, 0.3) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}

/* Text container */
.bouncing-ball-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.3;
  z-index: 1;
  position: relative;
}

/* Desktop text (default visible) */
.text-desktop {
  display: block;
}

/* Mobile text (hidden by default) */
.text-mobile {
  display: none;
}

/* Hover state - Enhanced shadow */
.bouncing-ball:hover {
  box-shadow:
    inset -8px -8px 16px rgba(31, 41, 55, 0.8),
    inset 8px 8px 16px rgba(0, 0, 0, 0.4),
    inset -2px -2px 8px rgba(0, 0, 0, 0.6),
    0 15px 50px rgba(17, 24, 39, 0.5);
}

/* Keyboard focus state - Accessibility */
.bouncing-ball:focus-visible {
  outline: 3px solid #3B82F6;
  outline-offset: 4px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  .bouncing-ball-container {
    bottom: 40px;
    right: 40px;
  }

  .bouncing-ball {
    width: var(--ball-size-mobile);
    height: var(--ball-size-mobile);
  }

  .bouncing-ball-shadow {
    width: calc(var(--ball-size-mobile) * 0.8);
  }

  /* Show single "?" on mobile */
  .text-desktop {
    display: none;
  }

  .text-mobile {
    display: block;
    font-size: 32px;
  }
}

/* Extra small screens - Additional adjustments */
@media (max-width: 480px) {
  .bouncing-ball-container {
    bottom: 30px;
    right: 30px;
  }

  .bouncing-ball {
    width: 90px;
    height: 90px;
  }

  .bouncing-ball-shadow {
    width: 72px;
  }

  .text-mobile {
    font-size: 28px;
  }
}
