/* ========================================
   AIMagicTools - Premium Magic Effects
   Visual Enhancement Layer
======================================== */

/* === Magic Variables === */
:root {
  --magic-glow: rgba(103, 126, 234, 0.4);
  --magic-glow-light: rgba(139, 92, 246, 0.3);
  --magic-particle-color: rgba(139, 92, 246, 0.6);
}

/* === Hero Magic Background === */
.hero {
  background: linear-gradient(180deg, 
    #0F172A 0%, 
    #1E1B4B 50%, 
    #FFFFFF 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 1000px;
  background: radial-gradient(circle, rgba(103, 126, 234, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: heroGlowPulse 8s ease-in-out infinite;
}

@keyframes heroGlowPulse {
  0%, 100% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.1);
  }
}

/* === Hero Content Animation === */
.hero-content {
  opacity: 0;
  animation: heroContentFadeIn 1s ease-out 0.3s forwards;
}

.hero-content h1 {
  opacity: 0;
  transform: translateY(30px);
  animation: heroTitleFadeIn 0.8s ease-out 0.5s forwards;
  color: var(--white);
  text-shadow: 0 2px 20px rgba(103, 126, 234, 0.3);
}

.hero-content p {
  opacity: 0;
  transform: translateY(20px);
  animation: heroTextFadeIn 0.8s ease-out 0.7s forwards;
  color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
  opacity: 0;
  transform: translateY(20px);
  animation: heroActionsFadeIn 0.8s ease-out 0.9s forwards;
}

@keyframes heroContentFadeIn {
  to {
    opacity: 1;
  }
}

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

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

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

/* === AI Magic Core === */
.hero-visual {
  position: relative;
  opacity: 0;
  animation: visualFadeIn 1.2s ease-out 0.6s forwards;
}

@keyframes visualFadeIn {
  to {
    opacity: 1;
  }
}

.ai-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, 
    rgba(139, 92, 246, 0.4) 0%, 
    rgba(103, 126, 234, 0.2) 40%, 
    transparent 70%);
  border-radius: 50%;
  animation: coreGlowPulse 4s ease-in-out infinite;
  filter: blur(40px);
}

.ai-core::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, 
    rgba(139, 92, 246, 0.8) 0%, 
    rgba(103, 126, 234, 0.4) 50%, 
    transparent 100%);
  border-radius: 50%;
  filter: blur(20px);
  animation: coreInnerPulse 3s ease-in-out infinite;
}

.ai-core::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  animation: coreRingRotate 10s linear infinite;
}

@keyframes coreGlowPulse {
  0%, 100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

@keyframes coreInnerPulse {
  0%, 100% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

@keyframes coreRingRotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* === Floating Elements Enhancement === */
.floating-element {
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.3);
  border: 1px solid rgba(139, 92, 246, 0.2);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.floating-element:hover {
  transform: translateY(-25px) scale(1.05);
  box-shadow: 0 15px 50px rgba(139, 92, 246, 0.5);
}

/* === Floating AI Text Labels === */
.ai-label {
  position: absolute;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: labelFloat 4s ease-in-out infinite;
}

.ai-label-1 {
  top: 15%;
  right: 5%;
  animation-delay: 0s;
}

.ai-label-2 {
  top: 35%;
  left: 8%;
  animation-delay: 1.5s;
}

.ai-label-3 {
  bottom: 20%;
  right: 10%;
  animation-delay: 3s;
}

.ai-label-4 {
  top: 60%;
  left: 5%;
  animation-delay: 2s;
}

@keyframes labelFloat {
  0%, 100% {
    opacity: 0;
    transform: translateY(0);
  }
  10%, 90% {
    opacity: 0.7;
  }
  50% {
    transform: translateY(-15px);
  }
}

/* === Premium Button Effects === */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #8B5CF6 100%);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6);
}

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

/* === Premium Card Effects === */
.card {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(139, 92, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, 
    rgba(103, 126, 234, 0.3), 
    rgba(139, 92, 246, 0.3));
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

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

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.3);
}

.card-icon {
  position: relative;
  transition: all 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 5px 15px rgba(139, 92, 246, 0.4));
}

/* === Scroll Reveal Animation === */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* === Magic Cursor === */
.magic-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: radial-gradient(circle, 
    rgba(139, 92, 246, 0.8) 0%, 
    transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0;
  filter: blur(2px);
}

.magic-cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.2s ease;
  opacity: 0;
}

/* === Particle Canvas === */
#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.6;
}

/* === Feature Card Enhancement === */
.feature-icon {
  transition: all 0.3s ease;
}

.feature-card:hover .feature-icon {
  transform: scale(1.15);
  background: linear-gradient(135deg, 
    rgba(103, 126, 234, 0.2), 
    rgba(139, 92, 246, 0.2));
}

/* === Step Number Enhancement === */
.step-number {
  position: relative;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
}

.step-number::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  animation: stepRingPulse 2s ease-in-out infinite;
}

@keyframes stepRingPulse {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0;
    transform: scale(1.2);
  }
}

/* === CTA Section Enhancement === */
.cta-section {
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 70%);
  animation: ctaGlowMove 15s linear infinite;
}

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

/* === Reduced Motion Support === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .magic-cursor,
  .magic-cursor-trail {
    display: none !important;
  }
}

/* === Mobile Optimizations === */
@media (max-width: 768px) {
  .hero {
    background: linear-gradient(180deg, 
      #0F172A 0%, 
      #1E1B4B 40%, 
      #FFFFFF 100%);
  }
  
  .ai-core {
    width: 200px;
    height: 200px;
  }
  
  .ai-label {
    display: none;
  }
  
  .magic-cursor,
  .magic-cursor-trail {
    display: none;
  }
  
  #particleCanvas {
    opacity: 0.3;
  }
}

/* === Desktop-only Effects === */
@media (min-width: 769px) {
  .hero-visual {
    transition: transform 0.3s ease;
  }
}
