/* ================================================================
   5MinHelp — 3D Effects & Premium Visual Enhancements
   3d-effects.css — Card tilt, glassmorphism, floating objects,
   cursor spotlight, loader ring, footer wave, stat glows
   ================================================================ */

/* ── Loader 3D Ring ─────────────────────────────────────────────── */
.loader-ring-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loader-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: ringRotate 2s linear infinite;
  transform-origin: center;
}

.loader-ring-bg {
  opacity: 0.2;
}

.loader-ring-progress {
  transition: stroke-dashoffset 0.1s linear;
  transform-origin: center;
  transform: rotate(-90deg);
}

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

/* Outer glow ring */
.loader-ring-wrapper::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: conic-gradient(
    rgba(99,102,241,0.0)   0%,
    rgba(99,102,241,0.15) 50%,
    rgba(6,182,212,0.15)  75%,
    rgba(99,102,241,0.0) 100%
  );
  animation: ringRotate 3s linear infinite reverse;
  filter: blur(8px);
}

.loader-logo-centered {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-logo-centered .loader-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(99,102,241,0.4)); }
  50%       { transform: scale(1.06); filter: drop-shadow(0 0 20px rgba(99,102,241,0.7)); }
}

/* ── Hero 3D Canvas ─────────────────────────────────────────────── */
#hero-3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  display: block;
}

/* Fallback when WebGL is not available */
.hero--no-webgl #hero-3d {
  display: none;
}

.hero--no-webgl .hero-bg-gradient {
  opacity: 1 !important;
}

.hero--no-webgl::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(99,102,241,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 60%, rgba(6,182,212,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 20%, rgba(139,92,246,0.10) 0%, transparent 60%);
  animation: bgShift 8s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes bgShift {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}

/* ── 3D Card System ─────────────────────────────────────────────── */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
  cursor: default;
}

/* Enhanced service card */
.service-card {
  transform-style: preserve-3d;
  transition:
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease,
    border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(99,102,241,0.08) 0%,
    rgba(139,92,246,0.04) 50%,
    rgba(6,182,212,0.06) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 0;
}

.service-card:hover::before {
  opacity: 1;
}

/* Shine sweep effect on hover */
.service-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    to right,
    transparent 0%,
    rgba(255,255,255,0.06) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.service-card:hover::after {
  opacity: 1;
  animation: shineSweep 0.6s ease forwards;
}

@keyframes shineSweep {
  0%   { left: -75%; }
  100% { left: 125%; }
}

/* Service card icon — forward in 3D */
.service-card-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 2;
}

/* Feature cards 3D */
.feature-card {
  transform-style: preserve-3d;
  transition:
    transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.05) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::after { opacity: 1; }

/* ── Glassmorphism Cards ─────────────────────────────────────────── */
.glass-card {
  background: rgba(13, 18, 36, 0.60) !important;
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -1px 0 rgba(0, 0, 0, 0.2) inset;
}

.glass-card:hover {
  background: rgba(20, 28, 58, 0.75) !important;
  border-color: rgba(99, 102, 241, 0.25) !important;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(99, 102, 241, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* ── Stat Cards — Glow System ───────────────────────────────────── */
.stat-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at 50% 0%,
    rgba(99, 102, 241, 0.12) 0%,
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover::before { opacity: 1; }
.stat-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(99, 102, 241, 0.15),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.stat-number {
  position: relative;
}

/* Glow behind stat number */
.stat-number::after {
  content: attr(data-count) attr(data-suffix);
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(12px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

/* ── Testimonial Cards — Glass + 3D Tilt ───────────────────────── */
.testimonial-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  transform-style: preserve-3d;
}

.testimonial-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(99,102,241,0.5) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.testimonial-card:hover::before { opacity: 1; }

/* Reflection sweep */
.testimonial-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255,255,255,0.04) 40%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.04) 60%,
    transparent 100%
  );
  transform: skewX(-15deg);
  pointer-events: none;
}

.testimonial-card:hover::after {
  animation: testimonialShine 0.7s ease;
}

@keyframes testimonialShine {
  0%   { left: -100%; }
  100% { left: 150%; }
}

/* ── Floating Decorative Objects ────────────────────────────────── */
.float-obj {
  position: absolute;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  z-index: 0;
  font-size: 2rem;
  opacity: 0.12;
  transition: transform 0.1s ease;
}

.float-obj--1  { animation: floatObj1 8s ease-in-out infinite; }
.float-obj--2  { animation: floatObj2 10s ease-in-out infinite; }
.float-obj--3  { animation: floatObj3 12s ease-in-out infinite; }
.float-obj--4  { animation: floatObj4 9s ease-in-out infinite; }
.float-obj--5  { animation: floatObj5 11s ease-in-out infinite; }
.float-obj--6  { animation: floatObj6 7s ease-in-out infinite; }

@keyframes floatObj1 {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  33%     { transform: translate(12px,-18px) rotate(8deg) scale(1.05); }
  66%     { transform: translate(-8px,10px) rotate(-5deg) scale(0.97); }
}
@keyframes floatObj2 {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  50%     { transform: translate(-14px,-22px) rotate(-12deg); }
}
@keyframes floatObj3 {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  25%     { transform: translate(10px,-15px) rotate(6deg) scale(1.03); }
  75%     { transform: translate(-12px,12px) rotate(-8deg) scale(0.96); }
}
@keyframes floatObj4 {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  40%     { transform: translate(-10px,-20px) rotate(10deg); }
  80%     { transform: translate(15px,8px) rotate(-6deg); }
}
@keyframes floatObj5 {
  0%,100% { transform: translate(0,0) rotate(0deg) scale(1); }
  30%     { transform: translate(8px,-25px) rotate(15deg) scale(1.08); }
  70%     { transform: translate(-15px,5px) rotate(-10deg) scale(0.94); }
}
@keyframes floatObj6 {
  0%,100% { transform: translate(0,0) rotate(0deg); }
  50%     { transform: translate(20px,-15px) rotate(-8deg); }
}

/* ── Button 3D Enhancements ─────────────────────────────────────── */
.btn {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.3s ease,
    background 0.3s ease !important;
}

/* Press depth effect */
.btn:active {
  transform: scale(0.97) translateY(2px) !important;
}

/* Shimmer on hover */
.btn--primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 80%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.15) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0s;
  pointer-events: none;
}

.btn--primary:hover::before {
  animation: btnShimmer 0.5s ease forwards;
}

@keyframes btnShimmer {
  0%   { left: -100%; }
  100% { left: 150%; }
}

/* 3D depth shadow on primary button */
.btn--primary {
  box-shadow:
    0 4px 15px rgba(99, 102, 241, 0.35),
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -2px 0 rgba(0,0,0,0.25) inset;
}

.btn--primary:hover {
  box-shadow:
    0 8px 30px rgba(99, 102, 241, 0.5),
    0 0 60px rgba(99, 102, 241, 0.2),
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 -2px 0 rgba(0,0,0,0.2) inset;
}

.btn--secondary {
  box-shadow:
    0 4px 15px rgba(6, 182, 212, 0.2),
    0 1px 0 rgba(255,255,255,0.08) inset;
}

.btn--secondary:hover {
  box-shadow:
    0 8px 30px rgba(6, 182, 212, 0.35),
    0 0 40px rgba(6, 182, 212, 0.15),
    0 1px 0 rgba(255,255,255,0.12) inset;
}

/* ── Timeline Steps — Depth Enhancement ─────────────────────────── */
.timeline-node {
  position: relative;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.timeline-node:hover {
  transform: scale(1.1);
  box-shadow:
    0 0 0 6px rgba(99, 102, 241, 0.15),
    0 0 30px rgba(99, 102, 241, 0.3);
}

/* ── Feature Icon — 3D Pop ───────────────────────────────────────── */
.feature-icon {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15) translateZ(20px);
  box-shadow: 0 0 20px rgba(99,102,241,0.3);
}

/* ── Cursor Spotlight Glow ──────────────────────────────────────── */
#cursor-spotlight {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.055) 0%,
    rgba(139, 92, 246, 0.025) 40%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: opacity 0.4s ease;
}

/* ── Section Background Depth Layers ────────────────────────────── */
.section-depth {
  position: relative;
  overflow: hidden;
}

.section-depth::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 15% 50%, rgba(99,102,241,0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 85% 50%, rgba(6,182,212,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Footer Wave ─────────────────────────────────────────────────── */
.footer {
  position: relative;
}

.footer-wave {
  position: absolute;
  top: -2px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 1;
}

.footer-wave svg {
  display: block;
  width: 100%;
  height: 60px;
}

.footer-wave path {
  animation: waveFlow 6s ease-in-out infinite;
  transform-origin: center;
}

@keyframes waveFlow {
  0%,100% { d: path("M0,30 C200,0 400,60 600,30 C800,0 1000,60 1200,30 L1200,60 L0,60 Z"); }
  50%      { d: path("M0,45 C200,60 400,0 600,45 C800,60 1000,0 1200,45 L1200,60 L0,60 Z"); }
}

/* ── Navbar 3D Enhancements ─────────────────────────────────────── */
.nav-link {
  position: relative;
  transition: color 0.3s ease, transform 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
  transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Navbar glass on scroll */
.navbar.scrolled {
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  background: rgba(6, 8, 15, 0.85) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 1px 0 rgba(99,102,241,0.15);
}

/* ── Logo Float ──────────────────────────────────────────────────── */
.nav-logo-img {
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-2px) rotate(1deg); }
}

/* ── Hero Content 3D Stack ──────────────────────────────────────── */
.hero-content {
  position: relative;
  z-index: 10;
}

.hero-eyebrow,
.hero-title,
.hero-subtitle,
.hero-cta,
.hero-stats {
  will-change: transform, opacity;
}

/* Gradient text animation enhancement */
.gradient-text-animate {
  background: linear-gradient(135deg, #6366f1, #a78bfa, #06b6d4, #6366f1);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

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

/* ── Hero Stats 3D Enhancement ──────────────────────────────────── */
.hero-stat {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-stat:hover {
  transform: translateY(-3px) scale(1.05);
}

/* ── Section Header Depth ────────────────────────────────────────── */
.section-eyebrow {
  animation: eyebrowPulse 3s ease-in-out infinite;
}

@keyframes eyebrowPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
  50%      { box-shadow: 0 0 12px rgba(99,102,241,0.3); }
}

/* ── FAQ 3D Enhancement ──────────────────────────────────────────── */
.faq-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
  transform: translateX(4px);
}

/* ── Contact Card Depth ──────────────────────────────────────────── */
.contact-info-item {
  transition: transform 0.3s ease, background 0.3s ease;
  border-radius: var(--radius-md);
  padding: 12px;
  margin: -12px;
}

.contact-info-item:hover {
  transform: translateX(6px);
  background: rgba(99,102,241,0.05);
}

/* ── App Store Button Enhancements ──────────────────────────────── */
.app-store-btn {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
}

.app-store-btn:hover {
  transform: translateY(-3px) scale(1.03) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 20px rgba(99,102,241,0.2) !important;
}

/* ── Footer Social Links ─────────────────────────────────────────── */
.footer-social-link {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-social-link:hover {
  transform: translateY(-4px) scale(1.15);
  box-shadow: 0 8px 20px rgba(99,102,241,0.25);
}

/* ── GSAP animation initial state helpers ───────────────────────── */
[data-reveal], [data-stagger] > * {
  /* GSAP will override these — just placeholders */
}

/* ── Scroll Progress glow ────────────────────────────────────────── */
#scroll-progress {
  box-shadow: 0 0 10px rgba(99,102,241,0.5), 0 0 20px rgba(99,102,241,0.2);
}

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

  #hero-3d          { display: none; }
  .float-obj        { animation: none; }
  .gradient-text-animate { animation: none; background-position: 0% 0%; }
  .loader-ring-svg  { animation: none; }
  .nav-logo-img     { animation: none; }
  .section-eyebrow  { animation: none; }
}

/* ── Mobile Optimizations ───────────────────────────────────────── */
@media (max-width: 767px) {
  /* Disable perspective tilt on touch devices */
  [data-tilt] {
    transform-style: flat;
  }

  .float-obj {
    opacity: 0.07;
    font-size: 1.5rem;
  }

  #cursor-spotlight {
    display: none;
  }

  .btn--primary,
  .btn--secondary {
    box-shadow: none;
  }
}

/* ── Dark Mode Depth Boost ───────────────────────────────────────── */
[data-theme="dark"] .service-card:hover {
  border-color: rgba(99,102,241,0.4);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.5),
    0 0 30px rgba(99,102,241,0.15),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

[data-theme="dark"] .feature-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.45),
    0 0 25px rgba(99,102,241,0.12);
}

/* ── QR Box 3D ──────────────────────────────────────────────────── */
.qr-box {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.qr-box:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 10px 30px rgba(99,102,241,0.2);
}

/* ── Scroll Hint 3D ─────────────────────────────────────────────── */
.hero-scroll-hint {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hero-scroll-hint:hover {
  transform: translateY(4px) scale(1.05);
  opacity: 0.7;
}
