/* Анимации для Creatorry.Music Academy */

/* Анимация для прогресс-бара */
@keyframes progressFill {
  from {
    width: 0;
  }
  to {
    width: var(--progress-width, 25%);
  }
}

.progress-fill {
  animation: progressFill 1.5s ease forwards;
}

/* Анимация для музыкальных баров в логотипе */
@keyframes bar-animation-1 {
  0%, 100% { height: 12px; }
  50% { height: 18px; }
}

@keyframes bar-animation-2 {
  0%, 100% { height: 8px; }
  50% { height: 14px; }
}

@keyframes bar-animation-3 {
  0%, 100% { height: 10px; }
  50% { height: 16px; }
}

.animate-bar.bar1 {
  animation: bar-animation-1 1.2s ease-in-out infinite;
}

.animate-bar.bar2 {
  animation: bar-animation-2 0.8s ease-in-out infinite;
  animation-delay: 0.2s;
}

.animate-bar.bar3 {
  animation: bar-animation-3 1s ease-in-out infinite;
  animation-delay: 0.4s;
}

/* Появление элементов */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Анимация снизу вверх */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s forwards;
}

/* Исчезновение вверх */
@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.fade-out-up {
  animation: fadeOutUp 0.5s forwards;
}

/* Анимация для карточек модулей */
.module-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Анимация для кнопок */
.btn-primary {
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(61, 90, 241, 0.2);
}

/* Анимация для бейджей */
@keyframes badgeAppear {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  animation: badgeAppear 0.5s ease forwards;
}

.badge:nth-child(2) {
  animation-delay: 0.2s;
}

.badge:nth-child(3) {
  animation-delay: 0.4s;
}

/* Анимация для меню */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

.sidebar.mobile-active {
  animation: slideInLeft 0.3s forwards;
}

/* Анимация для текстовых ссылок */
.nav-link, .module-card-link {
  position: relative;
}

.nav-link::after, .module-card-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-primary);
  transition: width 0.3s ease;
}

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

/* Анимация для модальных окон */
@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal.active .modal-overlay {
  animation: modalFadeIn 0.3s forwards;
}

.modal.active .modal-container {
  animation: modalSlideIn 0.3s forwards;
}

/* Анимация для мобильного меню */
@keyframes mobileMenuSlideDown {
  from {
    max-height: 0;
    opacity: 0;
  }
  to {
    max-height: 400px;
    opacity: 1;
  }
}

.mobile-menu.active {
  animation: mobileMenuSlideDown 0.3s forwards;
  overflow: hidden;
}

/* Анимация пульсации для иконок меню */
@keyframes menu-icon-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.menu-icon {
  transition: transform 0.3s ease;
}

.menu-item:hover .menu-icon {
  transform: translateX(3px);
  color: var(--color-primary);
}

.menu-item.active .menu-icon {
  animation: menu-icon-pulse 2s infinite;
}

/* Задержки для анимации */
.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

.delay-400 {
  animation-delay: 0.4s;
}

.delay-500 {
  animation-delay: 0.5s;
}

/* Анимации для элементов модуля */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
  50% {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
}

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

/* Применение анимаций к элементам */
.module-header {
  animation: fadeInUp 0.8s ease forwards;
}

.module-topic {
  animation: fadeInUp 0.6s ease forwards;
  animation-fill-mode: both;
}

.module-topic:nth-child(1) {
  animation-delay: 0.1s;
}

.module-topic:nth-child(2) {
  animation-delay: 0.3s;
}

.module-topic:nth-child(3) {
  animation-delay: 0.5s;
}

.module-topic:hover .topic-number {
  animation: pulse 1.5s ease infinite;
}

.topic-title::after {
  animation: shimmer 3s infinite linear;
  background: linear-gradient(90deg, 
    rgba(61, 90, 241, 0.3), 
    rgba(61, 90, 241, 0.5), 
    rgba(61, 90, 241, 0.3)
  );
  background-size: 200% 100%;
}

.demo-block {
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: both;
}

.demo-label {
  animation: pulse 2s ease infinite;
}