/* Enhanced Footer Styles */

/* Footer layout enhancements */
footer {
  position: relative;
  display: block !important; /* Force display */
  background-color: var(--bg-secondary);
  padding: calc(var(--spacing-xl) + 40px) 0 var(--spacing-xl);
  margin-top: var(--spacing-xl);
  z-index: 10; /* Ensure footer is above other elements */
  visibility: visible !important; /* Force visibility */
}

.footer-container {
  max-width: var(--content-width, 1280px);
  width: 90%;
  margin: 0 auto;
  padding: 0 var(--spacing-md, 1rem);
  display: block !important; /* Force display */
}

.footer-content {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-lg);
}

/* Footer left side */
.footer-left {
  flex: 1;
}

.copyright {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Footer right side */
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--spacing-md);
}

/* Footer links */
.footer-links {
  display: flex;
  gap: var(--spacing-md);
}

.footer-links a {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  transition: color 0.3s ease;
  padding: var(--spacing-sm);
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--accent);
}

/* Footer social links */
.footer-social {
  display: flex;
  gap: var(--spacing-md);
}

.footer-social .social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.footer-social .social-link:hover,
.footer-social .social-link:focus {
  color: var(--accent);
  transform: translateY(-3px);
}

/* Back to top button enhancements */
#scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--accent);
  color: white;
  border: none;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.3);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  z-index: 99;
}

#scroll-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#scroll-to-top:hover {
  background-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(var(--accent-rgb), 0.5);
}

#scroll-to-top.clicked {
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

#scroll-to-top.touch-active {
  transform: scale(0.9);
  opacity: 0.8;
}

#scroll-to-top img {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

#scroll-to-top:hover img {
  transform: translateY(-2px);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  footer {
    padding: calc(var(--spacing-lg) + 20px) 0 var(--spacing-lg);
    padding-bottom: calc(var(--spacing-lg) + var(--safe-area-inset-bottom));
  }
  
  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--spacing-md);
  }
  
  .footer-right {
    align-items: center;
  }
  
  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  #scroll-to-top {
    right: 20px;
    bottom: 20px;
    width: 45px;
    height: 45px;
    bottom: max(20px, env(safe-area-inset-bottom) + 10px);
    right: max(20px, env(safe-area-inset-right) + 10px);
  }
}

/* Support for reduced motion */
@media (prefers-reduced-motion: reduce) {
  #scroll-to-top,
  .footer-social .social-link {
    transition: none;
  }
}
