/* ===== EFFECTS & ANIMATIONS ===== */
/* Tutte le animazioni, effetti speciali e keyframes */

/* Gradient Text Effect */
.gradient-text {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 4s ease-in-out infinite;
}

/* Typing Cursor Effect */
.typing-cursor::after {
  content: "|";
  animation: blink 1s infinite;
  color: #6366f1;
}

/* Particles Effect */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.6;
  animation: float 6s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

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

/* Pulse Animation */
.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* Bounce Animation */
.bounce-animation {
  animation: bounce 1s ease-in-out infinite;
}

/* Rotate Animation */
.rotate-animation {
  animation: rotate 2s linear infinite;
}

/* Scale Animation */
.scale-animation {
  animation: scale 2s ease-in-out infinite;
}

/* Shake Animation */
.shake-animation {
  animation: shake 0.5s ease-in-out;
}

/* Slide Animations */
.animate-fade-in {
  opacity: 0;
  animation: fadeIn 1s ease-out forwards;
}

.animate-slide-up {
  opacity: 0;
  transform: translateY(50px);
  animation: slideUp 0.8s ease-out forwards;
}

.animate-slide-down {
  opacity: 0;
  transform: translateY(-50px);
  animation: slideDown 0.8s ease-out forwards;
}

.animate-slide-left {
  opacity: 0;
  transform: translateX(-50px);
  animation: slideLeft 0.8s ease-out forwards;
}

.animate-slide-right {
  opacity: 0;
  transform: translateX(50px);
  animation: slideRight 0.8s ease-out forwards;
}

/* Zoom Animations */
.animate-zoom-in {
  opacity: 0;
  transform: scale(0.8);
  animation: zoomIn 0.6s ease-out forwards;
}

.animate-zoom-out {
  opacity: 0;
  transform: scale(1.2);
  animation: zoomOut 0.6s ease-out forwards;
}

/* Flip Animations */
.animate-flip-x {
  animation: flipX 0.8s ease-in-out forwards;
}

.animate-flip-y {
  animation: flipY 0.8s ease-in-out forwards;
}

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

/* Loading Effects */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: loading 1.5s infinite;
}

/* Stagger Animation Delays */
.animate-stagger-1 { animation-delay: 0.1s; }
.animate-stagger-2 { animation-delay: 0.2s; }
.animate-stagger-3 { animation-delay: 0.3s; }
.animate-stagger-4 { animation-delay: 0.4s; }
.animate-stagger-5 { animation-delay: 0.5s; }
.animate-stagger-6 { animation-delay: 0.6s; }

/* ===== KEYFRAMES ===== */

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

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

@keyframes float {
  0%, 100% { 
    transform: translateY(0px) scale(1); 
  }
  25% { 
    transform: translateY(-20px) scale(1.1); 
  }
  50% { 
    transform: translateY(-40px)  scale(0.9); 
  }
  75% { 
    transform: translateY(-20px)  scale(1.1); 
  }
}

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

@keyframes pulse {
  0%, 100% { 
    transform: scale(1); 
    opacity: 1;
  }
  50% { 
    transform: scale(1.05); 
    opacity: 0.8;
  }
}

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

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

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
  }
  to { 
    opacity: 1; 
  }
}

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

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

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

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoomOut {
  from {
    opacity: 0;
    transform: scale(1.2);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flipX {
  0% {
    transform: rotateX(0);
  }
  50% {
    transform: rotateX(90deg);
  }
  100% {
    transform: rotateX(0);
  }
}

@keyframes flipY {
  0% {
    transform: rotateY(0);
  }
  50% {
    transform: rotateY(90deg);
  }
  100% {
    transform: rotateY(0);
  }
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.3),
                0 0 10px rgba(99, 102, 241, 0.2),
                0 0 15px rgba(99, 102, 241, 0.1);
  }
  to {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6),
                0 0 20px rgba(99, 102, 241, 0.4),
                0 0 30px rgba(99, 102, 241, 0.2);
  }
}

@keyframes loading {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Animazione smooth per il cambio tema */
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transition-delay: 0 !important;
}

/* Hover Effects */
.hover-lift:hover {
  transform: translateY(-8px);
  transition: transform 0.3s ease;
}

.hover-grow:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease;
}

.hover-shrink:hover {
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
  transition: transform 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  transition: box-shadow 0.3s ease;
}

/* Dark Mode Specific Effects */
.dark .glow-animation {
  animation: darkGlow 2s ease-in-out infinite alternate;
}

.dark .hover-glow:hover {
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.6), 0 0 60px rgba(139, 92, 246, 0.4);
  transition: box-shadow 0.3s ease;
}

/* Dark mode keyframes */
@keyframes darkGlow {
  from {
    box-shadow: 0 0 5px rgba(99, 102, 241, 0.4),
                0 0 10px rgba(99, 102, 241, 0.3),
                0 0 15px rgba(99, 102, 241, 0.2);
  }
  to {
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.8),
                0 0 20px rgba(99, 102, 241, 0.6),
                0 0 30px rgba(99, 102, 241, 0.4);
  }
}

/* Dark mode particle effects */
.dark .particle {
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6), 
              0 0 24px rgba(139, 92, 246, 0.4),
              0 0 36px rgba(236, 72, 153, 0.2);
}

/* Dark mode gradient text enhanced */
.dark .gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 30%, #f9a8d4 60%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 300% 300%;
  animation: darkGradientShift 6s ease-in-out infinite;
  filter: brightness(1.2);
}

@keyframes darkGradientShift {
  0%, 100% { background-position: 0% 50%; }
  25% { background-position: 50% 0%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 100%; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .animate-slide-up,
  .animate-slide-down,
  .animate-slide-left,
  .animate-slide-right {
    animation-duration: 0.6s;
  }
  
  .float-animation,
  .pulse-animation {
    animation-duration: 2s;
  }
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .particle,
  .float-animation,
  .pulse-animation,
  .bounce-animation,
  .rotate-animation {
    animation: none !important;
  }
}

