/* Кнопка "Наверх" - минималистичный дизайн в стилистике сайта */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 56px;
  height: 56px;
  background: var(--white);
  border: 2px solid rgba(28, 43, 51, 0.1);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.8);
  box-shadow: 
    0 8px 24px rgba(28, 43, 51, 0.08),
    0 4px 8px rgba(28, 43, 51, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--primary-color);
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* Показать кнопку при прокрутке */
.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Эффекты при наведении */
.scroll-to-top:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 
    0 16px 40px rgba(28, 43, 51, 0.15),
    0 8px 16px rgba(28, 43, 51, 0.08);
}

/* Анимация иконки */
.scroll-to-top svg {
  width: 24px;
  height: 24px;
  transition: all 0.3s ease;
  stroke-width: 2.5;
}

.scroll-to-top:hover svg {
  transform: translateY(-2px);
  stroke-width: 3;
}

/* Анимация нажатия */
.scroll-to-top:active {
  transform: translateY(-2px) scale(1.02);
  transition-duration: 0.1s;
}

/* Пульсирующий эффект при появлении */
.scroll-to-top.visible {
  animation: scrollButtonAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes scrollButtonAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Анимация скрытия */
.scroll-to-top.hiding {
  animation: scrollButtonHide 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes scrollButtonHide {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
}

/* Дополнительный эффект при клике */
.scroll-to-top.clicking {
  animation: scrollButtonClick 0.3s ease;
}

@keyframes scrollButtonClick {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-6px) scale(1.1);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

/* Адаптивные стили */
@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }
  
  .scroll-to-top svg {
    width: 20px;
    height: 20px;
  }
  
  .scroll-to-top:hover {
    transform: translateY(-3px) scale(1.03);
  }
}

@media (max-width: 480px) {
  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  
  .scroll-to-top svg {
    width: 18px;
    height: 18px;
  }
}

/* Дополнительные стили для темной темы (если потребуется) */
@media (prefers-color-scheme: dark) {
  .scroll-to-top {
    background: rgba(28, 43, 51, 0.95);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .scroll-to-top:hover {
    background: var(--white);
    color: var(--primary-color);
    border-color: var(--white);
  }
}

/* Плавная анимация прокрутки */
html {
  scroll-behavior: smooth;
}

/* Дополнительные эффекты для улучшения UX */
.scroll-to-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(28, 43, 51, 0.02) 0%, rgba(28, 43, 51, 0.01) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.scroll-to-top:hover::before {
  opacity: 1;
}

/* Эффект свечения при наведении */
.scroll-to-top::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--primary-color), #2d3b43);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
  filter: blur(8px);
}

.scroll-to-top:hover::after {
  opacity: 0.3;
}
