/* === ANIMATIONS.CSS ===
 * НАЗНАЧЕНИЕ: Анимации, эффекты, уведомления, загрузчики
 * СВЯЗИ: Подключается после components.css
 * ФУНКЦИИ: Динамические эффекты, микро-анимации
 * РАЗМЕР: ~400 строк, ~20,000 символов
 * ОБНОВЛЕНО: 2025-09-29
 */

/* ===== КЛЮЧЕВЫЕ КАДРЫ АНИМАЦИЙ ===== */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(20px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

@keyframes scaleIn {
  from { 
    transform: scale(0.95); 
    opacity: 0; 
  }
  to { 
    transform: scale(1); 
    opacity: 1; 
  }
}

@keyframes slideIn {
  from { 
    transform: translateX(-100%); 
  }
  to { 
    transform: translateX(0); 
  }
}

@keyframes slideInRight {
  from { 
    transform: translateX(100%); 
    opacity: 0;
  }
  to { 
    transform: translateX(0); 
    opacity: 1;
  }
}

@keyframes slideInUp {
  from { 
    transform: translateY(100%); 
    opacity: 0;
  }
  to { 
    transform: translateY(0); 
    opacity: 1;
  }
}

@keyframes slideInDown {
  from { 
    transform: translateY(-100%); 
    opacity: 0;
  }
  to { 
    transform: translateY(0); 
    opacity: 1;
  }
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  70% {
    transform: scale(0.9);
    opacity: 0.9;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

@keyframes neonGlow {
  0%, 100% {
    box-shadow: 
      0 0 5px rgba(59, 130, 246, 0.5),
      0 0 10px rgba(59, 130, 246, 0.5),
      0 0 15px rgba(59, 130, 246, 0.5);
  }
  50% {
    box-shadow: 
      0 0 10px rgba(59, 130, 246, 0.8),
      0 0 20px rgba(59, 130, 246, 0.8),
      0 0 30px rgba(59, 130, 246, 0.8);
  }
}

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

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

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

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

/* ===== КЛАССЫ АНИМАЦИЙ ===== */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-slide-in {
  animation: slideIn 0.5s ease-out;
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

.animate-slide-in-up {
  animation: slideInUp 0.5s ease-out;
}

.animate-slide-in-down {
  animation: slideInDown 0.5s ease-out;
}

.animate-bounce-in {
  animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.animate-shake {
  animation: shake 0.6s ease-in-out;
}

.animate-neon-glow {
  animation: neonGlow 2s ease-in-out infinite;
}

.animate-gradient-shift {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-rotate {
  animation: rotate 2s linear infinite;
}

.animate-heartbeat {
  animation: heartbeat 1.5s ease-in-out 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; }
.delay-700 { animation-delay: 0.7s; }
.delay-1000 { animation-delay: 1s; }

/* ===== HOVER ЭФФЕКТЫ ===== */
.hover-lift {
  transition: all 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(59, 130, 246, 0.15);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.3s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow {
  transition: all 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 
    0 0 20px rgba(59, 130, 246, 0.4),
    0 5px 15px rgba(0, 0, 0, 0.3);
  border-color: rgba(59, 130, 246, 0.6);
}

.hover-gradient {
  background: var(--gradient-card);
  transition: all 0.3s ease;
}

.hover-gradient:hover {
  background: var(--gradient-primary);
  color: white;
}

/* ===== УВЕДОМЛЕНИЯ С АНИМАЦИЯМИ ===== */
.notification-slide-in {
  animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification-slide-out {
  animation: slideInRight 0.3s ease-in reverse;
}

.notification-bounce {
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Прогресс-бар в уведомлениях */
.notification-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--ai-blue);
  animation: progress 5s linear;
}

@keyframes progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ===== МОДАЛЬНЫЕ ОКНА С АНИМАЦИЯМИ ===== */
.modal-fade-in {
  animation: fadeIn 0.3s ease;
}

.modal-content-scale {
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modal-backdrop {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

/* ===== ЗАГРУЗЧИКИ С АНИМАЦИЯМИ ===== */
.loader-wave {
  display: inline-flex;
  gap: 4px;
}

.loader-wave span {
  width: 6px;
  height: 30px;
  background: var(--gradient-primary);
  animation: wave 1.2s ease-in-out infinite;
}

.loader-wave span:nth-child(2) { animation-delay: 0.1s; }
.loader-wave span:nth-child(3) { animation-delay: 0.2s; }
.loader-wave span:nth-child(4) { animation-delay: 0.3s; }
.loader-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
  0%, 40%, 100% {
    transform: scaleY(0.4);
    opacity: 0.5;
  }
  20% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.loader-ring {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(59, 130, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--ai-blue);
  animation: rotate 1s linear infinite;
}

.loader-gradient {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--ai-blue),
    var(--ai-purple),
    var(--ai-green),
    var(--ai-blue)
  );
  animation: rotate 1.5s linear infinite;
  position: relative;
}

.loader-gradient::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: var(--ai-dark);
  border-radius: 50%;
}

/* ===== КНОПКИ С АНИМАЦИЯМИ ===== */
.btn-wave {
  position: relative;
  overflow: hidden;
}

.btn-wave::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;
}

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

.btn-ripple {
  position: relative;
  overflow: hidden;
}

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

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* ===== ПЕРЕХОДЫ СТРАНИЦ ===== */
.page-transition-enter {
  opacity: 0;
  transform: translateY(30px);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
}

.page-transition-exit {
  opacity: 1;
  transform: translateY(0);
}

.page-transition-exit-active {
  opacity: 0;
  transform: translateY(-30px);
  transition: all 0.3s ease;
}

/* ===== СКЕЛЕТОНЫ ЗАГРУЗКИ ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--border-color) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    var(--border-color) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

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

.skeleton-text {
  height: 1rem;
  margin: 0.5rem 0;
}

.skeleton-title {
  height: 2rem;
  margin: 1rem 0;
}

.skeleton-button {
  height: 3rem;
  width: 8rem;
  margin: 1rem 0;
}

.skeleton-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

/* ===== ПРОГРЕСС-БАРЫ ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px;
  transition: width 0.4s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%
  );
  background-size: 20px 20px;
  animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

/* ===== КАРТОЧКИ С АНИМАЦИЯМИ ===== */
.card-flip {
  perspective: 1000px;
}

.card-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-flip:hover .card-flip-inner {
  transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  padding: 2rem;
}

.card-flip-back {
  transform: rotateY(180deg);
}

/* ===== СТАГЕРНЫЕ АНИМАЦИИ ===== */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ===== АДАПТИВНОСТЬ АНИМАЦИЙ ===== */
@media (max-width: 768px) {
  .hover-lift:hover {
    transform: translateY(-3px);
  }
  
  .hover-scale:hover {
    transform: scale(1.02);
  }
  
  /* Упрощение анимаций на мобильных */
  .animate-bounce-in {
    animation: fadeIn 0.4s ease-out;
  }
  
  .card-flip:hover .card-flip-inner {
    transform: none;
  }
}

/* ===== ПРОИЗВОДИТЕЛЬНОСТЬ ===== */
@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-scale-in,
  .animate-slide-in,
  .animate-slide-in-right,
  .animate-slide-in-up,
  .animate-slide-in-down,
  .animate-bounce-in,
  .animate-shake,
  .animate-neon-glow,
  .animate-gradient-shift,
  .animate-float,
  .animate-rotate,
  .animate-heartbeat {
    animation: none !important;
  }
  
  .hover-lift:hover,
  .hover-scale:hover,
  .hover-rotate:hover {
    transform: none !important;
  }
  
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}