/* RankFlow SEO Agentur - Custom Styles */

/* ===================================
   Scroll Animations
   =================================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

.fade-in {
  opacity: 0;
  transition: opacity 0.8s ease-out;
}

.fade-in.visible {
  opacity: 1;
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger animation delays */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* ===================================
   Hero Animated Background
   =================================== */
.hero-gradient {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

/* Floating particles effect */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 20s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 20s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 28s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 24s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 26s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 23s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 27s; }

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

/* ===================================
   Navigation
   =================================== */
.nav-link {
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: #1a1a1a;
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Mobile menu animation */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
  max-height: 400px;
}

/* ===================================
   Buttons
   =================================== */
.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

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

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

/* ===================================
   Cards & Service Boxes
   =================================== */
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-icon {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1);
  background-color: #1a1a1a;
  color: #ffffff;
}

/* ===================================
   Testimonial Slider
   =================================== */
.testimonial-slide {
  opacity: 0;
  transform: translateX(50px);
  position: absolute;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.testimonial-slide.active {
  opacity: 1;
  transform: translateX(0);
  position: relative;
}

/* ===================================
   Process Steps
   =================================== */
.process-step {
  position: relative;
}

.process-step::before {
  content: '';
  position: absolute;
  top: 40px;
  left: calc(50% + 40px);
  width: calc(100% - 80px);
  height: 2px;
  background: linear-gradient(90deg, #1a1a1a, #e5e5e5);
}

.process-step:last-child::before {
  display: none;
}

.process-number {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.process-step:hover .process-number {
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(26, 26, 26, 0.3);
}

/* ===================================
   Counter Animation
   =================================== */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ===================================
   Scroll to Top Button
   =================================== */
.scroll-top {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ===================================
   Form Styles
   =================================== */
.form-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus {
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

/* ===================================
   Loading States
   =================================== */
.skeleton {
  background: linear-gradient(90deg, #f5f5f5 25%, #e5e5e5 50%, #f5f5f5 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

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

::-webkit-scrollbar-track {
  background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
  background: #a3a3a3;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #1a1a1a;
}

/* ===================================
   Accessibility
   =================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible styles */
*:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

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