/* ============================================
   SNAPLINKED MODERN 3D DESIGN SYSTEM v5.0
   ============================================

   Ultra-modern design with:
   - 3D transformations & perspectives
   - Advanced glassmorphism
   - Floating elements & parallax
   - Particle systems
   - Gradient animations
   - Micro-interactions

   Created: February 2026
   ============================================ */

/* ============================================
   3D VARIABLES & FOUNDATIONS
   ============================================ */
:root {
  /* 3D Perspective */
  --perspective-3d: 1200px;
  --perspective-intense: 800px;
  --perspective-soft: 2000px;

  /* 3D Transforms */

  /* Glassmorphism Advanced */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-bg-dark: rgba(15, 23, 42, 0.75);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 8px 32px rgba(10, 102, 194, 0.15);
  --glass-blur: blur(20px);
  --glass-blur-intense: blur(40px);

  /* Neon Glows */
  --glow-primary: 0 0 30px rgba(10, 102, 194, 0.5), 0 0 60px rgba(10, 102, 194, 0.3);

  /* Gradient Animations */
  --gradient-animated: linear-gradient(
    135deg,
    var(--primary-400) 0%,
    var(--primary-600) 25%,
    #7c3aed 50%,
    var(--primary-500) 75%,
    var(--primary-400) 100%
  );

  /* Mesh Gradients */
  --mesh-gradient: radial-gradient(at 40% 20%, rgba(10, 102, 194, 0.15) 0px, transparent 50%),
                   radial-gradient(at 80% 0%, rgba(124, 58, 237, 0.1) 0px, transparent 50%),
                   radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
                   radial-gradient(at 80% 80%, rgba(245, 158, 11, 0.06) 0px, transparent 50%),
                   radial-gradient(at 0% 100%, rgba(10, 102, 194, 0.1) 0px, transparent 50%);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

/* Floating 3D Animation */
@keyframes float3D {
  0%, 100% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translateY(-15px) rotateX(3deg) rotateY(-3deg);
  }
  50% {
    transform: translateY(-8px) rotateX(-2deg) rotateY(2deg);
  }
  75% {
    transform: translateY(-20px) rotateX(2deg) rotateY(-2deg);
  }
}

/* Gradient Shift — OPT-11: use opacity instead of background-position (composited) */
@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Glow Pulse — OPT-11: use filter only (composited) instead of box-shadow */
@keyframes glowPulse {
  0%, 100% {
    filter: brightness(1) drop-shadow(0 0 10px rgba(10, 102, 194, 0.3));
  }
  50% {
    filter: brightness(1.1) drop-shadow(0 0 30px rgba(10, 102, 194, 0.5));
  }
}

/* Rotate 3D Continuous */
@keyframes rotate3D {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

/* Particle Float */
@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.6;
  }
  33% {
    transform: translateY(-30px) translateX(15px) scale(1.1);
    opacity: 0.9;
  }
  66% {
    transform: translateY(-15px) translateX(-10px) scale(0.9);
    opacity: 0.7;
  }
}

/* Border Glow Animation — OPT-11: use opacity instead of border-color/box-shadow (composited) */
@keyframes borderGlowPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Morphing Background — OPT-11: removed border-radius animation (non-composited), use transform only */
@keyframes morphBg {
  0%, 100% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
}

/* Text Shimmer — OPT-11: use transform instead of background-position (composited) */
@keyframes textShimmer {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Scale Bounce In */
@keyframes scaleBounceIn {
  0% {
    transform: scale(0.9) translateY(20px);
    opacity: 0;
  }
  60% {
    transform: scale(1.02) translateY(-5px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Orbit Animation */
@keyframes orbit {
  from {
    transform: rotate(0deg) translateX(100px) rotate(0deg);
  }
  to {
    transform: rotate(360deg) translateX(100px) rotate(-360deg);
  }
}

/* Wave Animation */
@keyframes wave {
  0%, 100% {
    transform: translateY(0) scaleY(1);
  }
  50% {
    transform: translateY(-10px) scaleY(1.05);
  }
}

/* ============================================
   3D PERSPECTIVE CONTAINERS
   ============================================ */

.perspective-container {
  perspective: var(--perspective-3d);
  perspective-origin: 50% 50%;
}

.perspective-intense {
  perspective: var(--perspective-intense);
}

.perspective-soft {
  perspective: var(--perspective-soft);
}

/* ============================================
   ADVANCED GLASSMORPHISM
   ============================================ */

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--glass-shadow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 48px rgba(10, 102, 194, 0.2);
  transform: translateY(-4px);
}

.glass-card-dark {
  background: var(--glass-bg-dark);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
}

.glass-card-intense {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--glass-blur-intense);
  -webkit-backdrop-filter: var(--glass-blur-intense);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(10, 102, 194, 0.12),
              inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* ============================================
   3D CARD TRANSFORMS
   ============================================ */

.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.card-3d:hover {
  transform: rotateY(-8deg) rotateX(4deg) translateZ(30px);
}

.card-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.4) 0%,
    transparent 50%
  );
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}

.card-3d:hover::before {
  opacity: 1;
}

/* 3D Flip Card */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ============================================
   FLOATING ELEMENTS
   ============================================ */

.float-3d {
  animation: float3D 6s ease-in-out infinite;
  will-change: transform;
  transform-style: preserve-3d;
}

.float-element {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-primary);
  filter: blur(1px);
  opacity: 0.6;
  animation: particleFloat 8s ease-in-out infinite;
  will-change: transform, opacity;
}

.float-element:nth-child(1) { animation-delay: 0s; }
.float-element:nth-child(2) { animation-delay: -2s; }
.float-element:nth-child(3) { animation-delay: -4s; }
.float-element:nth-child(4) { animation-delay: -6s; }

/* Orbiting Elements */
.orbit-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orbit-item {
  position: absolute;
  animation: orbit 15s linear infinite;
  will-change: transform;
}

.orbit-item:nth-child(2) { animation-delay: -5s; }
.orbit-item:nth-child(3) { animation-delay: -10s; }

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */

.gradient-animated-bg {
  background: var(--gradient-animated);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite;
  will-change: opacity;
}

.mesh-gradient-bg {
  background: var(--mesh-gradient);
  background-color: var(--bg-body);
}

.gradient-border {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--gradient-animated);
  background-size: 300% 300%;
  animation: gradientShift 4s ease infinite;
  will-change: opacity;
  border-radius: inherit;
  z-index: -1;
}

/* ============================================
   GLOW EFFECTS
   ============================================ */

.glow-primary {
  box-shadow: var(--glow-primary);
}

.glow-pulse {
  animation: glowPulse 3s ease-in-out infinite;
  will-change: filter;
}

.text-glow {
  text-shadow: 0 0 20px rgba(10, 102, 194, 0.5),
               0 0 40px rgba(10, 102, 194, 0.3);
}

.border-glow {
  animation: borderGlowPulse 3s ease-in-out infinite;
  will-change: opacity;
}

/* ============================================
   MODERN BUTTONS
   ============================================ */

.btn-3d {
  position: relative;
  padding: 1rem 2rem;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  background-size: 200% 200%;
  color: white;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(10, 102, 194, 0.3),
              0 8px 30px rgba(10, 102, 194, 0.2);
}

.btn-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.3) 0%,
    transparent 50%
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-3d::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.6s;
}

.btn-3d:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 25px rgba(10, 102, 194, 0.4),
              0 16px 50px rgba(10, 102, 194, 0.25);
  animation: gradientShift 3s ease infinite;
  will-change: opacity;
}

.btn-3d:hover::before {
  opacity: 1;
}

.btn-3d:active {
  transform: translateY(-2px) scale(0.98);
}

.btn-3d:active::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Outline 3D Button */
.btn-3d-outline {
  position: relative;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 1rem;
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  color: var(--primary);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-3d-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn-3d-outline:hover {
  color: white;
  border-color: transparent;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(10, 102, 194, 0.3);
}

.btn-3d-outline:hover::before {
  transform: scaleX(1);
}

/* ============================================
   INPUT FIELDS 3D
   ============================================ */

.input-3d {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-3d:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring),
              0 8px 25px rgba(10, 102, 194, 0.15);
  transform: translateY(-2px);
}

.input-3d-group {
  position: relative;
}

.input-3d-label {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  padding: 0 0.25rem;
}

.input-3d:focus ~ .input-3d-label,
.input-3d:not(:placeholder-shown) ~ .input-3d-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--bg-surface);
}

/* ============================================
   HERO SECTION 3D
   ============================================ */

.hero-3d {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--mesh-gradient);
  background-color: var(--bg-body);
}

.hero-3d::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230a66c2' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-visual-3d {
  perspective: 1000px;
  position: relative;
}

.hero-card-3d {
  transform: rotateY(-12deg) rotateX(6deg);
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card-3d:hover {
  transform: rotateY(-6deg) rotateX(3deg) scale(1.02);
}

/* Floating Particles */
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  animation: particleFloat 10s ease-in-out infinite;
  will-change: transform, opacity;
}

.particle:nth-child(1) { top: 20%; left: 10%; width: 8px; height: 8px; animation-delay: 0s; }
.particle:nth-child(2) { top: 60%; left: 20%; width: 12px; height: 12px; animation-delay: -2s; }
.particle:nth-child(3) { top: 40%; left: 80%; width: 6px; height: 6px; animation-delay: -4s; }
.particle:nth-child(4) { top: 80%; left: 60%; width: 14px; height: 14px; animation-delay: -6s; }
.particle:nth-child(5) { top: 10%; left: 70%; width: 10px; height: 10px; animation-delay: -8s; }
.particle:nth-child(6) { top: 70%; left: 40%; width: 8px; height: 8px; animation-delay: -1s; }

/* ============================================
   AUTH PAGES 3D DESIGN
   ============================================ */

.auth-page-3d {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--mesh-gradient);
  background-color: var(--bg-body);
  position: relative;
  overflow: hidden;
}

.auth-page-3d::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 20% 30%, rgba(10, 102, 194, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 50%);
  animation: morphBg 20s ease-in-out infinite;
  will-change: transform;
}

.auth-card-3d {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur-intense);
  -webkit-backdrop-filter: var(--glass-blur-intense);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow:
    0 25px 50px -12px rgba(10, 102, 194, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  transform-style: preserve-3d;
  animation: scaleBounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.auth-card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-animated);
  background-size: 300% 100%;
  animation: gradientShift 3s ease infinite;
  will-change: opacity;
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.auth-logo-3d {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-primary);
  animation: float3D 4s ease-in-out infinite;
  will-change: transform;
  transform-style: preserve-3d;
}

.auth-logo-3d img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xl);
  object-fit: contain;
}

.auth-floating-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-shape {
  position: absolute;
  border-radius: 50%;
  background: var(--gradient-primary);
  opacity: 0.1;
  animation: particleFloat 12s ease-in-out infinite;
  will-change: transform, opacity;
}

.auth-shape-1 {
  width: 300px;
  height: 300px;
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.auth-shape-2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  left: -50px;
  animation-delay: -4s;
}

.auth-shape-3 {
  width: 150px;
  height: 150px;
  bottom: 30%;
  right: -80px;
  animation-delay: -8s;
}

/* [REMOVED] Dashboard 3D, Stat Card 3D, Sidebar 3D — dead CSS (not used in templates).
   Dashboard cards → app-3d.css | Stat cards → landing-3d.css | Sidebar → sidebar.css v8.0 */

/* ============================================
   MOCKUP 3D DISPLAY
   ============================================ */

.mockup-3d-container {
  perspective: 1500px;
  position: relative;
}

.mockup-3d {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  transform: rotateY(-15deg) rotateX(8deg) rotateZ(1deg);
  transform-style: preserve-3d;
  box-shadow:
    30px 30px 80px rgba(10, 102, 194, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mockup-3d:hover {
  transform: rotateY(-8deg) rotateX(4deg) rotateZ(0.5deg) scale(1.02);
}

.mockup-3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.mockup-3d-dots {
  display: flex;
  gap: 8px;
}

.mockup-3d-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mockup-3d-dots .red { background: #ff5f57; }
.mockup-3d-dots .yellow { background: #febc2e; }
.mockup-3d-dots .green { background: #28c840; }

.mockup-3d-reflection {
  position: absolute;
  bottom: -60%;
  left: 0;
  right: 0;
  height: 60%;
  background: inherit;
  transform: scaleY(-1);
  opacity: 0.1;
  mask-image: linear-gradient(to bottom, transparent, black);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black);
  pointer-events: none;
}

/* [REMOVED] Pricing Cards 3D — dead CSS (not used in templates).
   Pricing → landing-3d.css .price-card-3d */

/* ============================================
   TEXT ANIMATIONS
   ============================================ */

.text-gradient-animated {
  background: linear-gradient(
    90deg,
    var(--primary) 0%,
    #7c3aed 25%,
    var(--primary-600) 50%,
    #7c3aed 75%,
    var(--primary) 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 3s linear infinite;
  will-change: transform, opacity;
}

.text-3d {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.1),
    0 2px 0 rgba(0, 0, 0, 0.08),
    0 3px 0 rgba(0, 0, 0, 0.06),
    0 4px 0 rgba(0, 0, 0, 0.04);
}

/* ============================================
   SCROLLBAR MODERN
   ============================================ */

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--primary-300);
  border-radius: 3px;
  transition: background 0.3s;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ============================================
   RESPONSIVE 3D ADJUSTMENTS
   ============================================ */

@media (max-width: 992px) {
  .hero-card-3d,
  .mockup-3d {
    transform: rotateY(-5deg) rotateX(3deg);
  }

  .hero-card-3d:hover,
  .mockup-3d:hover {
    transform: rotateY(-3deg) rotateX(2deg);
  }
}

@media (max-width: 576px) {
  .hero-card-3d,
  .mockup-3d {
    transform: none;
  }

  .auth-card-3d {
    padding: 1.5rem;
  }

  .particle {
    display: none;
  }
}

/* [REMOVED] prefers-reduced-motion — already defined in components-critical.css */

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */

[data-bs-theme="dark"] {
  --glass-bg: rgba(30, 41, 59, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="dark"] .glass-card:hover {
  background: rgba(30, 41, 59, 0.85);
}

[data-bs-theme="dark"] .glass-card-intense {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
