/* ========================================
   MaxAtMin - Custom CSS with Advanced Animations
   ======================================== */

/* Root Variables */
:root {
  --primary-color: #1DA1F2;
  --secondary-color: #14F195;
  --accent-color: #FF6B35;
  --dark-bg: #0f172a;
  --light-bg: #f8fafc;
  --text-dark: #1e293b;
  --text-light: #94a3b8;
  --gradient-1: linear-gradient(135deg, #1DA1F2 0%, #0c7abf 100%);
  --gradient-2: linear-gradient(135deg, #14F195 0%, #0bc978 100%);
  --gradient-3: linear-gradient(135deg, #FF6B35 0%, #ff4500 100%);
  
  /* Animation Variables */
  --animation-speed: 0.3s;
  --animation-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --animation-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --animation-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0c7abf;
}

/* Page Transitions */
.page-content {
  animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient Text Animation */
.gradient-text {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
  background-size: 200% 200%;
}

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

/* Floating Animation */
.float-animation {
  animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* Pulse Glow Effect */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(29, 161, 242, 0.8);
  }
}

/* Card Hover Effects */
.card-3d {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Shimmer Effect */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* Slide-in Animations */
.slide-in-left {
  animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Rotate on Hover */
.rotate-hover {
  transition: transform 0.6s ease;
}

.rotate-hover:hover {
  transform: rotate(360deg);
}

/* Scale Bounce */
.scale-bounce:hover {
  animation: scaleBounce 0.6s ease;
}

@keyframes scaleBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--primary-color);
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from, to {
    border-color: transparent;
  }
  50% {
    border-color: var(--primary-color);
  }
}

/* Gradient Background Animation */
.gradient-bg-animated {
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

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

/* Tilt Effect */
.tilt {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt:hover {
  transform: perspective(1000px) rotateX(10deg) rotateY(10deg);
}

/* Glitch Effect */
.glitch {
  position: relative;
}

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

.glitch::before {
  animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  color: #00ffff;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
  color: #ff00ff;
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 100% {
    transform: translate(0);
  }
  33% {
    transform: translate(-2px, 2px);
  }
  66% {
    transform: translate(2px, -2px);
  }
}

@keyframes glitch-2 {
  0%, 100% {
    transform: translate(0);
  }
  33% {
    transform: translate(2px, -2px);
  }
  66% {
    transform: translate(-2px, 2px);
  }
}

/* Smooth Button Transitions */
.btn-modern {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  pointer-events: auto;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
  pointer-events: none; /* Prevent pseudo-element from blocking clicks */
}

.btn-modern:hover::before {
  width: 300px;
  height: 300px;
}

/* Parallax Effect */
.parallax-layer {
  transition: transform 0.1s ease-out;
}

/* Stagger Animation (for lists) */
.stagger-item {
  opacity: 0;
  animation: staggerFadeIn 0.5s ease forwards;
}

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }

/* Loading Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(29, 161, 242, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Bounce Animation */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  60% {
    transform: translateY(-15px);
  }
}

/* Fade in on Scroll */
.fade-in-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Neon Glow Effect */
.neon-glow {
  text-shadow: 
    0 0 10px var(--primary-color),
    0 0 20px var(--primary-color),
    0 0 30px var(--primary-color),
    0 0 40px var(--primary-color);
  animation: neonFlicker 1.5s infinite alternate;
}

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

/* Background Particle Effect */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.2;
  animation: particleFloat 20s infinite;
}

@keyframes particleFloat {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.3;
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Responsive Typography */
@media (max-width: 768px) {
  .typewriter {
    font-size: 1.25rem;
  }
}

/* ========================================
   STUNNING CSS ANIMATIONS (CSS-Tricks Inspired)
   ======================================== */

/* Removed: Page Transition and Navigation Color Morphing Animations */

/* Stunning Service Card Animations */
.service-card-3d {
  transform-style: preserve-3d;
  transition: all 0.6s var(--animation-smooth);
  perspective: 1000px;
}

.service-card-3d:hover {
  transform: translateY(-20px) rotateX(10deg) rotateY(5deg);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1);
}

.service-card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s var(--animation-smooth);
  z-index: 1;
}

.service-card-3d:hover::before {
  transform: translateX(100%);
}

/* Floating Animation with Physics */
.float-physics {
  animation: floatPhysics 6s ease-in-out infinite;
}

@keyframes floatPhysics {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  25% {
    transform: translateY(-20px) rotate(1deg);
  }
  50% {
    transform: translateY(-10px) rotate(-1deg);
  }
  75% {
    transform: translateY(-15px) rotate(0.5deg);
  }
}

/* Hero Section Square Animations - Dynamic Scattered Movement */
.hero-square-1 {
  animation: heroSquare1 12s ease-in-out infinite;
  transform: translate(-30%, 30%) rotate(12deg);
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-square-2 {
  animation: heroSquare2 10s ease-in-out infinite;
  transform: translate(0%, 0%) rotate(-6deg);
  animation-delay: 1s;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-square-3 {
  animation: heroSquare3 14s ease-in-out infinite;
  transform: translate(30%, -30%) rotate(3deg);
  animation-delay: 2s;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.hero-square-4 {
  animation: heroSquare4 11s ease-in-out infinite;
  transform: translate(60%, -60%) rotate(-12deg);
  animation-delay: 3s;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

@keyframes heroSquare1 {
  0% {
    transform: translate(-30%, 30%) rotate(12deg) translate(0px, 0px);
  }
  25% {
    transform: translate(-40%, 20%) rotate(15deg) translate(-10px, -20px);
  }
  50% {
    transform: translate(-20%, 40%) rotate(8deg) translate(15px, -10px);
  }
  75% {
    transform: translate(-35%, 25%) rotate(18deg) translate(-5px, -25px);
  }
  100% {
    transform: translate(-30%, 30%) rotate(12deg) translate(0px, 0px);
  }
}

@keyframes heroSquare2 {
  0% {
    transform: translate(0%, 0%) rotate(-6deg) translate(0px, 0px);
  }
  25% {
    transform: translate(10%, -10%) rotate(-3deg) translate(20px, -15px);
  }
  50% {
    transform: translate(-10%, 10%) rotate(-9deg) translate(-15px, 20px);
  }
  75% {
    transform: translate(5%, -5%) rotate(-1deg) translate(10px, -20px);
  }
  100% {
    transform: translate(0%, 0%) rotate(-6deg) translate(0px, 0px);
  }
}

@keyframes heroSquare3 {
  0% {
    transform: translate(30%, -30%) rotate(3deg) translate(0px, 0px);
  }
  25% {
    transform: translate(40%, -20%) rotate(6deg) translate(25px, -10px);
  }
  50% {
    transform: translate(20%, -40%) rotate(0deg) translate(-10px, 15px);
  }
  75% {
    transform: translate(35%, -25%) rotate(8deg) translate(15px, -25px);
  }
  100% {
    transform: translate(30%, -30%) rotate(3deg) translate(0px, 0px);
  }
}

@keyframes heroSquare4 {
  0% {
    transform: translate(60%, -60%) rotate(-12deg) translate(0px, 0px);
  }
  25% {
    transform: translate(70%, -50%) rotate(-8deg) translate(30px, -20px);
  }
  50% {
    transform: translate(50%, -70%) rotate(-16deg) translate(-20px, 25px);
  }
  75% {
    transform: translate(65%, -55%) rotate(-5deg) translate(20px, -30px);
  }
  100% {
    transform: translate(60%, -60%) rotate(-12deg) translate(0px, 0px);
  }
}

/* Magnetic Hover Effect */
.magnetic-hover {
  transition: transform 0.3s var(--animation-smooth);
  cursor: pointer;
}

.magnetic-hover:hover {
  transform: scale(1.05);
}

/* Gradient Text Animation */
.gradient-text-animated {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

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

/* Liquid Button Animation */
.liquid-button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--animation-smooth);
}

.liquid-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s var(--animation-smooth), height 0.6s var(--animation-smooth);
}

.liquid-button:hover::before {
  width: 300px;
  height: 300px;
}

/* Scroll-Triggered Animations */
.scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s var(--animation-smooth);
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Animation */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s var(--animation-smooth);
}

.stagger-item.revealed {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }

/* Glitch Effect */
.glitch {
  position: relative;
  color: var(--primary-color);
  font-weight: bold;
}

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

.glitch::before {
  animation: glitch-1 0.5s infinite;
  color: #ff0000;
  z-index: -1;
}

.glitch::after {
  animation: glitch-2 0.5s infinite;
  color: #00ff00;
  z-index: -2;
}

@keyframes glitch-1 {
  0%, 14%, 15%, 49%, 50%, 99%, 100% {
    transform: translate(0);
  }
  15%, 49% {
    transform: translate(-2px, 2px);
  }
}

@keyframes glitch-2 {
  0%, 20%, 21%, 62%, 63%, 99%, 100% {
    transform: translate(0);
  }
  21%, 62% {
    transform: translate(2px, -2px);
  }
}

/* Morphing Shapes */
.morphing-shape {
  width: 200px;
  height: 200px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  animation: morphing 8s ease-in-out infinite;
}

@keyframes morphing {
  0%, 100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  }
  25% {
    border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%;
  }
  50% {
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
  }
  75% {
    border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%;
  }
}

/* Pulse Glow Effect */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(29, 161, 242, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(29, 161, 242, 0.8), 0 0 60px rgba(29, 161, 242, 0.4);
  }
}

/* Neon Text Effect */
.neon-text {
  color: var(--primary-color);
  text-shadow: 
    0 0 5px var(--primary-color),
    0 0 10px var(--primary-color),
    0 0 15px var(--primary-color),
    0 0 20px var(--primary-color);
  animation: neonFlicker 2s infinite alternate;
}

@keyframes neonFlicker {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 
      0 0 5px var(--primary-color),
      0 0 10px var(--primary-color),
      0 0 15px var(--primary-color),
      0 0 20px var(--primary-color);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

/* Loading Spinner with Gradient */
.gradient-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid transparent;
  border-top: 4px solid var(--primary-color);
  border-right: 4px solid var(--secondary-color);
  border-radius: 50%;
  animation: gradientSpin 1s linear infinite;
}

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

/* Hover Lift Effect */
.hover-lift {
  transition: all 0.3s var(--animation-smooth);
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Text Reveal Animation */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: textReveal 0.8s var(--animation-smooth) forwards;
}

@keyframes textReveal {
  to {
    transform: translateY(0);
  }
}

/* Interactive Cursor */
/* DISABLED - Interactive cursor was interfering with button clicks */
/* .interactive-cursor {
  cursor: none;
} */

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--primary-color);
  border-radius: 50%;
  position: fixed;
  pointer-events: none; /* Ensure cursor doesn't block clicks */
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s ease;
}

.cursor-outline {
  width: 40px;
  height: 40px;
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  position: fixed;
  pointer-events: none; /* Ensure cursor doesn't block clicks */
  pointer-events: none;
  z-index: 9998;
  transition: all 0.15s ease;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .hero-square-1,
  .hero-square-2,
  .hero-square-3,
  .hero-square-4,
  .float-physics,
  .morphing-shape,
  .shimmer::before,
  .gradient-text-animated,
  .liquid-button,
  .pulse-glow {
    animation: none !important;
    transform: none !important;
  }
  
  .hero-square-1 {
    transform: translate(-30%, 30%) rotate(12deg) !important;
  }
  
  .hero-square-2 {
    transform: translate(0%, 0%) rotate(-6deg) !important;
  }
  
  .hero-square-3 {
    transform: translate(30%, -30%) rotate(3deg) !important;
  }
  
  .hero-square-4 {
    transform: translate(60%, -60%) rotate(-12deg) !important;
  }
}

/* Responsive Animations */
@media (max-width: 768px) {
  .service-card-3d:hover {
    transform: translateY(-10px);
  }
  
  .morphing-shape {
    width: 150px;
    height: 150px;
  }
  
  .glitch::before,
  .glitch::after {
    display: none;
  }
  
  /* Mobile hero squares - smaller and less movement */
  .hero-square-1,
  .hero-square-2,
  .hero-square-3,
  .hero-square-4 {
    width: 200px !important;
    height: 200px !important;
  }
  
  .hero-square-1 {
    transform: translate(-20%, 20%) rotate(8deg) !important;
  }
  
  .hero-square-2 {
    transform: translate(0%, 0%) rotate(-4deg) !important;
  }
  
  .hero-square-3 {
    transform: translate(20%, -20%) rotate(2deg) !important;
  }
  
  .hero-square-4 {
    transform: translate(40%, -40%) rotate(-8deg) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


