/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--color-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Error Page Layout */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
  font-family: var(--font-body);
}

.error-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem;
  position: relative;
}

/* 404 Number Styling */
.error-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(8rem, 20vw, 16rem);
  font-weight: 700;
  color: #65a0f8;
  margin: 0;
  line-height: 0.8;
  text-shadow: 4px 4px 0px #f1d859, 8px 8px 0px rgba(0, 0, 0, 0.1);
  animation: bounceIn 1s ease-out;
}

/* Page Not Found Title */
.error-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--color-text);
  margin: 1rem 0;
  animation: slideInLeft 0.8s ease-out 0.3s both;
}

/* Error Message Text */
.error-content p {
  font-size: 1.25rem;
  color: var(--color-muted);
  margin: 1.5rem auto;
  max-width: 600px;
  line-height: 1.6;
  animation: slideInRight 0.8s ease-out 0.6s both;
}

/* Home Button Styling */
.btn-home {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--color-text);
  background-color: #73e65f;
  border: 2px solid black;
  border-radius: 20px;
  box-shadow: grey -3px 3px;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease-out 0.9s both;
  position: relative;
  overflow: hidden;
}

.btn-home::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.btn-home:hover::before {
  left: 100%;
}

.btn-home:hover {
  background-color: #29d10c;
  box-shadow: grey -6px 6px;
  color: #000;
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-home:active {
  transform: translateY(0);
  box-shadow: grey -2px 2px;
}

/* Decorative Elements */
.error-content::before,
.error-content::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  z-index: -1;
  opacity: 0.1;
}

.error-content::before {
  width: 300px;
  height: 300px;
  background-color: #65a0f8;
  top: 10%;
  right: 10%;
  animation: float 6s ease-in-out infinite;
}

.error-content::after {
  width: 200px;
  height: 200px;
  background-color: #f1d859;
  bottom: 20%;
  left: 15%;
  animation: float 8s ease-in-out infinite reverse;
}

/* Footer */
footer {
  display: flex;
  justify-content: center;
  background-color: var(--color-bg);
  padding: 2rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--color-text);
  margin-top: auto;
}

/* Animations */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-10deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.05) rotate(2deg);
  }
  70% {
    transform: scale(0.9) rotate(-1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

@keyframes slideInLeft {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(5deg);
  }
  66% {
    transform: translateY(10px) rotate(-3deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .error-content {
    padding: 1rem;
  }

  .error-content h1 {
    font-size: clamp(6rem, 25vw, 12rem);
  }

  .error-content h2 {
    font-size: clamp(1.5rem, 8vw, 2.5rem);
  }

  .error-content p {
    font-size: 1.1rem;
    margin: 1rem auto;
  }

  .btn-home {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }

  .error-content::before {
    width: 200px;
    height: 200px;
    top: 5%;
    right: 5%;
  }

  .error-content::after {
    width: 150px;
    height: 150px;
    bottom: 10%;
    left: 5%;
  }
}

@media (max-width: 480px) {
  .error-content h1 {
    font-size: clamp(4rem, 30vw, 8rem);
    text-shadow: 2px 2px 0px #f1d859, 4px 4px 0px rgba(0, 0, 0, 0.1);
  }

  .btn-home {
    width: 100%;
    max-width: 280px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .error-content h1,
  .error-content h2,
  .error-content p,
  .btn-home {
    animation: none;
  }

  .error-content::before,
  .error-content::after {
    animation: none;
  }

  .btn-home::before {
    display: none;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .error-content h1 {
    text-shadow: 2px 2px 0px #000;
    color: var(--color-primary);
  }

  .btn-home {
    border-width: 3px;
    box-shadow: #000 -3px 3px;
  }

  .btn-home:hover {
    box-shadow: #000 -6px 6px;
  }
}

.hidden {
  display: none;
}
