/* ============================================
   SOULVD - CREATIVE FINTECH DESIGN SYSTEM
   Advanced animations & 3D effects
   ============================================ */

:root {
  --primary: #00d4aa;
  --primary-dark: #00b894;
  --secondary: #00b4d8;
  --accent: #a855f7;
  --bg-dark: #0a0f1c;
  --bg-card: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ===== CUSTOM CURSOR ===== */
.custom-cursor {
  width: 20px;
  height: 20px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 10000;
  transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}

.custom-cursor.hover {
  width: 50px;
  height: 50px;
  background: rgba(0, 212, 170, 0.1);
}

.cursor-dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 10001;
  transform: translate(-50%, -50%);
}

/* ===== SPOTLIGHT EFFECT ===== */
.spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), 
    transparent 0%,
    rgba(10, 15, 28, 0.4) 50%,
    rgba(10, 15, 28, 0.8) 100%);
  z-index: 1;
}

/* ===== MAGNETIC BUTTONS ===== */
.magnetic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--bg-dark);
  font-weight: 700;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

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

.magnetic-btn:hover::before {
  opacity: 1;
}

/* ===== 3D CARD FLIP ===== */
.card-3d {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.card-3d-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;
}

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

.card-3d-front,
.card-3d-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 24px;
  padding: 2rem;
}

.card-3d-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* ===== FLOATING 3D ELEMENTS ===== */
.float-3d {
  transform-style: preserve-3d;
  animation: float-3d 6s ease-in-out infinite;
}

@keyframes float-3d {
  0%, 100% { 
    transform: translateY(0) rotateX(0) rotateY(0); 
  }
  25% { 
    transform: translateY(-20px) rotateX(5deg) rotateY(5deg); 
  }
  50% { 
    transform: translateY(-10px) rotateX(-5deg) rotateY(-5deg); 
  }
  75% { 
    transform: translateY(-30px) rotateX(3deg) rotateY(-3deg); 
  }
}

/* ===== TILT EFFECT ===== */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
  transition: transform 0.1s ease;
}

.tilt-content {
  transform: translateZ(50px);
}

/* ===== GLITCH TEXT EFFECT ===== */
.glitch-text {
  position: relative;
  color: white;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  animation: glitch-1 0.3s infinite linear alternate-reverse;
  color: #ff00ff;
  z-index: -1;
}

.glitch-text::after {
  animation: glitch-2 0.3s infinite linear alternate-reverse;
  color: #00ffff;
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% { clip-path: inset(0 0 95% 0); transform: translate(-2px, -2px); }
  20% { clip-path: inset(30% 0 50% 0); transform: translate(2px, 2px); }
  40% { clip-path: inset(60% 0 20% 0); transform: translate(-2px, 2px); }
  60% { clip-path: inset(10% 0 70% 0); transform: translate(2px, -2px); }
  80% { clip-path: inset(80% 0 5% 0); transform: translate(-2px, 2px); }
}

@keyframes glitch-2 {
  0%, 100% { clip-path: inset(95% 0 0 0); transform: translate(2px, 2px); }
  20% { clip-path: inset(50% 0 30% 0); transform: translate(-2px, -2px); }
  40% { clip-path: inset(20% 0 60% 0); transform: translate(2px, -2px); }
  60% { clip-path: inset(70% 0 10% 0); transform: translate(-2px, 2px); }
  80% { clip-path: inset(5% 0 80% 0); transform: translate(2px, -2px); }
}

/* ===== LIQUID BUTTON ===== */
.liquid-btn {
  position: relative;
  padding: 1rem 2.5rem;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-weight: 700;
  border-radius: 50px;
  overflow: hidden;
  transition: color 0.5s;
  z-index: 1;
}

.liquid-btn::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  border-radius: 50% 50% 0 0;
  transition: top 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: -1;
}

.liquid-btn:hover {
  color: var(--bg-dark);
}

.liquid-btn:hover::before {
  top: -50%;
  border-radius: 0;
}

/* ===== NEON GLOW ===== */
.neon-glow {
  position: relative;
}

.neon-glow::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--primary), var(--secondary), var(--accent), var(--primary));
  background-size: 400% 400%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(15px);
  animation: neon-shift 3s linear infinite;
  transition: opacity 0.3s;
}

.neon-glow:hover::before {
  opacity: 1;
}

@keyframes neon-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== PARTICLE CANVAS ===== */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== MORPHING BLOB ===== */
.morph-blob {
  position: absolute;
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
  filter: blur(60px);
  opacity: 0.3;
  animation: morph 8s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    transform: rotate(0deg) translate(0, 0);
  }
  25% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(90deg) translate(20px, -20px);
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    transform: rotate(180deg) translate(-20px, 20px);
  }
  75% {
    border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
    transform: rotate(270deg) translate(20px, 20px);
  }
}

/* ===== BENTO GRID ===== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 2rem;
}

.bento-item {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  overflow: hidden;
}

.bento-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(0, 212, 170, 0.15), 
    transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.bento-item:hover::before {
  opacity: 1;
}

.bento-item:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.bento-item.large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item.wide {
  grid-column: span 2;
}

/* ===== TYPING CURSOR ===== */
.typing-text::after {
  content: '|';
  animation: blink 1s infinite;
  color: var(--primary);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ===== SCROLL PROGRESS BAR ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  z-index: 10000;
  transition: width 0.1s;
}

/* ===== HOLO CARD EFFECT ===== */
.holo-card {
  position: relative;
  background: var(--bg-card);
  border-radius: 24px;
  overflow: hidden;
}

.holo-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(0, 212, 170, 0.3) 60deg,
    transparent 120deg
  );
  animation: holo-rotate 4s linear infinite;
}

.holo-card::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--bg-card);
  border-radius: 22px;
}

@keyframes holo-rotate {
  100% { transform: rotate(360deg); }
}

/* ===== AURORA BACKGROUND ===== */
.aurora-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.aurora-bg::before,
.aurora-bg::after {
  content: '';
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(ellipse at center,
    rgba(0, 212, 170, 0.15) 0%,
    transparent 50%);
  animation: aurora 15s ease-in-out infinite;
}

.aurora-bg::after {
  animation-delay: -7.5s;
  background: radial-gradient(ellipse at center,
    rgba(0, 180, 216, 0.1) 0%,
    transparent 50%);
}

@keyframes aurora {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(5%, 5%) rotate(120deg);
  }
  66% {
    transform: translate(-5%, 10%) rotate(240deg);
  }
}

/* ===== ORBIT ANIMATION ===== */
.orbit-container {
  position: relative;
  width: 300px;
  height: 300px;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: 50%;
  animation: orbit-rotate 20s linear infinite;
}

.orbit-ring:nth-child(2) {
  inset: 40px;
  animation-duration: 15s;
  animation-direction: reverse;
}

.orbit-ring:nth-child(3) {
  inset: 80px;
  animation-duration: 10s;
}

.orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 20px var(--primary);
}

@keyframes orbit-rotate {
  100% { transform: rotate(360deg); }
}

/* ===== TEXT REVEAL ===== */
.reveal-text {
  overflow: hidden;
}

.reveal-text span {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  animation: text-reveal 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes text-reveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ===== SKEW SCROLL ===== */
.skew-scroll {
  transition: transform 0.3s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bento-item.large,
  .bento-item.wide {
    grid-column: span 2;
  }
  
  .custom-cursor,
  .cursor-dot {
    display: none;
  }
}
