/* ==========================================
   FOOTER - Professional glassmorphism design
   SEO-оптимизированный, адаптивный footer
   ========================================== */

:root {
  --footer-bg: linear-gradient(135deg, rgba(15,23,42,.95) 0%, rgba(11,18,32,.98) 100%);
  --footer-border: rgba(139,92,246,.25);
  --footer-text: #cbd5e1;
  --footer-heading: #f1f5f9;
  --footer-link-hover: #a78bfa;
  --footer-shadow: 0 -4px 24px rgba(0,0,0,.3), 0 0 0 1px rgba(139,92,246,.08);
}

/* ==========================================
   FOOTER CONTAINER
   ========================================== */

.site-footer {
  position: relative;
  margin-top: 80px;
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  box-shadow: var(--footer-shadow);
  overflow: hidden;
}

/* Декоративный фон с градиентами */
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 600px 400px at 20% 0%, rgba(139,92,246,.15), transparent),
    radial-gradient(ellipse 800px 500px at 80% 100%, rgba(99,102,241,.12), transparent),
    radial-gradient(ellipse 500px 300px at 50% 50%, rgba(6,182,212,.08), transparent);
  opacity: 0.6;
  pointer-events: none;
  z-index: 0;
}

/* Subtle noise texture */
.site-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px 24px;
}

/* ==========================================
   FOOTER GRID - 4 колонки
   ========================================== */

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}

/* ==========================================
   FOOTER COLUMN - общие стили
   ========================================== */

.footer-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-column__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--footer-heading);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(139,92,246,.3);
  position: relative;
}

.footer-column__title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  border-radius: 2px;
}

/* ==========================================
   BRAND COLUMN - логотип и описание
   ========================================== */

.footer-brand {
  grid-column: span 1;
}

.footer-brand__logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.footer-brand__logo:hover {
  transform: scale(1.05);
}

.footer-brand__logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 0 !important;
  filter: drop-shadow(0 4px 12px rgba(139,92,246,.4));
}

.footer-brand__logo-text {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-brand__description {
  font-size: 14px;
  line-height: 1.65;
  color: var(--footer-text);
  margin: 0 0 16px 0;
  max-width: 280px;
}

.footer-brand__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(124,58,237,.4);
  box-shadow: 0 4px 16px rgba(139,92,246,.35);
  transition: all 0.3s ease;
  max-width: max-content;
}

.footer-brand__cta:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 0 8px 24px rgba(139,92,246,.5);
}

.footer-brand__cta-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ==========================================
   NAVIGATION LINKS - ссылки колонок
   ========================================== */

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links__item {
  position: relative;
}

.footer-links__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: var(--footer-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.footer-links__link::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
  transition: width 0.3s ease;
}

.footer-links__link:hover {
  color: var(--footer-link-hover);
  transform: translateX(4px);
}

.footer-links__link:hover::before {
  width: 100%;
}

.footer-links__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.footer-links__link:hover .footer-links__icon {
  opacity: 1;
  transform: translateX(0);
}

/* Show icons always on mobile and tablets */
@media (max-width: 1023px) {
  .footer-links__icon {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   CONTACT COLUMN - контакты и соцсети
   ========================================== */

.footer-contact__item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--footer-text);
  line-height: 1.6;
}

.footer-contact__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #a78bfa;
  margin-top: 2px;
}

.footer-contact__link {
  color: var(--footer-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-contact__link:hover {
  color: var(--footer-link-hover);
}

/* Social links */
.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.footer-social__link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(139,92,246,.15);
  border: 1px solid rgba(139,92,246,.3);
  border-radius: 12px;
  color: #a78bfa;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-social__link:hover {
  background: rgba(139,92,246,.25);
  border-color: rgba(139,92,246,.5);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(139,92,246,.3);
}

.footer-social__icon {
  width: 22px;
  height: 22px;
}

/* ==========================================
   FOOTER BOTTOM - copyright и дополнительные ссылки
   ========================================== */

.footer-bottom {
  border-top: 1px solid rgba(139,92,246,.2);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-bottom__copyright {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
}

.footer-bottom__copyright a {
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.footer-bottom__copyright a:hover {
  color: #c4b5fd;
}

.footer-bottom__links {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-bottom__link {
  font-size: 14px;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-bottom__link:hover {
  color: var(--footer-link-hover);
}

/* ==========================================
   SCROLL TO TOP BUTTON
   ========================================== */

.scroll-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  border: 1px solid rgba(124,58,237,.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(139,92,246,.4);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(139,92,246,.6);
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

.scroll-to-top__icon {
  width: 24px;
  height: 24px;
}

/* ==========================================
   RESPONSIVE - адаптивная верстка
   ========================================== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
  }
  
  .footer-brand {
    grid-column: span 2;
    max-width: 100%;
  }
  
  .footer-brand__description {
    max-width: 100%;
  }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
  .site-footer__inner {
    padding: 48px 20px 20px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    margin-bottom: 36px;
  }
  
  .footer-brand {
    grid-column: span 1;
  }
  
  .footer-column__title {
    font-size: 15px;
  }
  
  .footer-links__link {
    font-size: 14px;
  }
  
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding-top: 24px;
  }
  
  .footer-bottom__links {
    flex-wrap: wrap;
    gap: 16px;
  }
  
  .scroll-to-top {
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
  }
  
  .scroll-to-top__icon {
    width: 22px;
    height: 22px;
  }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
  .site-footer__inner {
    padding: 40px 16px 16px;
  }
  
  .footer-grid {
    gap: 32px;
    margin-bottom: 32px;
  }
  
  .footer-brand__logo {
    margin-bottom: 12px;
  }
  
  .footer-brand__logo-img {
    width: 40px;
    height: 40px;
  }
  
  .footer-brand__logo-text {
    font-size: 20px;
  }
  
  .footer-brand__description {
    font-size: 13px;
  }
  
  .footer-brand__cta {
    width: 100%;
  }
  
  .footer-social {
    justify-content: flex-start;
  }
  
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Focus states для клавиатурной навигации */
.footer-links__link:focus-visible,
.footer-brand__cta:focus-visible,
.footer-social__link:focus-visible,
.footer-bottom__link:focus-visible,
.scroll-to-top:focus-visible {
  outline: 3px solid rgba(139,92,246,.5);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Prevent text selection на кнопке scroll-to-top */
.scroll-to-top {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .site-footer::before,
  .site-footer::after,
  .footer-brand__logo,
  .footer-links__link,
  .footer-social__link,
  .scroll-to-top {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ==========================================
   TOAST NOTIFICATION
   ========================================== */

.footer-toast {
  position: fixed;
  bottom: 100px;
  right: 32px;
  min-width: 300px;
  max-width: 400px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(139,92,246,.95) 0%, rgba(99,102,241,.95) 100%);
  border: 1px solid rgba(139,92,246,.5);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(139,92,246,.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.footer-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.footer-toast__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  vertical-align: middle;
}

@media (max-width: 767px) {
  .footer-toast {
    bottom: 80px;
    right: 16px;
    left: 16px;
    min-width: auto;
    max-width: none;
  }
}
