/* Preloader */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--white);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader {
  display: flex;
}

.letter {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  animation: bounce 0.6s ease infinite alternate;
}

.letter:nth-child(2) {
  animation-delay: 0.1s;
}

.letter:nth-child(3) {
  animation-delay: 0.2s;
}

.letter:nth-child(4) {
  animation-delay: 0.3s;
}

.letter:nth-child(5) {
  animation-delay: 0.4s;
}

.letter:nth-child(6) {
  animation-delay: 0.5s;
}

.letter:nth-child(7) {
  animation-delay: 0.6s;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-20px);
    color: var(--accent-color);
  }
}

/* Scroll Reveal Animations */
.reveal-left,
.reveal-right,
.reveal-bottom {
  opacity: 0;
  transition: all 1s ease;
}

.reveal-left {
  transform: translateX(-50px);
}

.reveal-right {
  transform: translateX(50px);
}

.reveal-bottom {
  transform: translateY(50px);
}

.reveal-left.active,
.reveal-right.active,
.reveal-bottom.active {
  opacity: 1;
  transform: translate(0);
}

[data-delay="200"] {
  transition-delay: 0.2s;
}

[data-delay="400"] {
  transition-delay: 0.4s;
}

/* Counter Animation */
.counter {
  display: inline-block;
  animation: countUp 2s ease-out forwards;
  animation-play-state: paused;
}

.counter.animate {
  animation-play-state: running;
}

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

/* Form Input Animations */
.form-group input,
.form-group textarea,
.form-group select {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  transform: scale(1.01);
}

/* Button Hover Animation */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 1;
}

.btn:hover::after {
  width: 300px;
  height: 300px;
}

.btn span {
  position: relative;
  z-index: 2;
}

/* Course Card Animations */
.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}

.course-card:hover::before {
  transform: scaleX(1);
}

.course-card.featured::before {
  background: linear-gradient(90deg, var(--accent-color), var(--primary-light));
}

.course-card.special::before {
  background: linear-gradient(90deg, var(--success-color), var(--accent-color));
}

/* Navigation Hover Animation */
.nav-link:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Mobile view animations */
@media (max-width: 768px) {
  .letter {
    font-size: 2.5rem;
  }
  
  .reveal-left,
  .reveal-right {
    transform: translateY(30px);
  }
  
  .reveal-left.active,
  .reveal-right.active {
    transform: translateY(0);
  }
}