/* Improvements CSS */

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
}


/* Page Animations */
.fade-in {
  animation: fadeIn 0.8s ease forwards;
}

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

/* Staggered animations for content sections */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
}

.stagger-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Accessibility Improvements */
:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}


/* Custom 404 Page */
.error-container {
  text-align: center;
  padding: 50px 20px;
  max-width: 800px;
  margin: 0 auto;
}

.error-code {
  font-size: 120px;
  color: var(--primary-color);
  margin: 0;
  line-height: 1;
}

.error-message {
  font-size: 24px;
  margin: 20px 0;
}

.error-description {
  margin-bottom: 30px;
}

.error-home-link {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s;
}

.error-home-link:hover {
  background-color: var(--accent-color);
}

/* Lazy loading for images */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Image optimization placeholder style */
.image-placeholder {
  background-color: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.image-placeholder::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
