/*--------------------------------------------------------------
# 404 Error Page Layout
--------------------------------------------------------------*/

.afel-error-404 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  min-height: 60vh;
  padding: 32px 0;
  margin: 32px 0;
}

.afel-error-404__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: center;
}

.afel-error-404__image {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}

/*--------------------------------------------------------------
# 404 Error Title and Typography
--------------------------------------------------------------*/

.afel-error-404__title {
  margin: 0;
  text-align: center;
  line-height: var(--afel-line-height-tight);
}

.afel-error-404__code {
  display: block;
  font-size: clamp(4rem, 12vw, 8rem);
  font-weight: 600;
  color: var(--afel-brand-color);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 10px;
  animation: bounce 2s infinite;
}

.afel-error-404__subtitle {
  display: block;
  font-size: var(--afel-h2-size);
  font-weight: 600;
  color: var(--afel-primary-text-color);
  margin-bottom: 16px;
}

.afel-error-404__text {
  max-width: 500px;
  margin: 0 auto 24px auto;
}

.afel-error-404__text p {
  font-size: var(--afel-body-size);
  color: var(--afel-secondary-text-color);
  line-height: 1.6;
  margin: 0;
}

/*--------------------------------------------------------------
# 404 Error Actions
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# 404 Error Image/SVG
--------------------------------------------------------------*/

.afel-error-404__image img,
.afel-error-404__image svg {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  opacity: 0.8;
  filter: drop-shadow(var(--afel-shadow-sm));
}

.afel-error-404__image svg {
  color: var(--afel-brand-color);
  animation: float 3s ease-in-out infinite;
}

/*--------------------------------------------------------------
# 404 Error Animations
--------------------------------------------------------------*/

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.afel-error-404__content {
  animation: fadeInLeft 0.8s ease-out;
}

.afel-error-404__image {
  animation: fadeInRight 0.8s ease-out 0.2s both;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/*--------------------------------------------------------------
# 404 Error Background Effects
--------------------------------------------------------------*/

.afel-error-404::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 20%,
      var(--afel-brand-color-bg) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      var(--afel-secondary-color-bg) 0%,
      transparent 50%
    );
  opacity: 0.3;
  z-index: -1;
  border-radius: var(--afel-border-radius-lg);
}

.afel-site-main {
  position: relative;
}

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/

/* Large tablets */
@media (max-width: 1024px) {
  .afel-error-404 {
    gap: 24px;
    padding: 24px 0;
  }

  .afel-error-404__code {
    font-size: clamp(3rem, 10vw, 6rem);
  }

  .afel-error-404__subtitle {
    font-size: var(--afel-h3-size);
  }
}

/* Tablets */
@media (max-width: 768px) {
  .afel-error-404 {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
    padding: 16px 0;
  }

  .afel-error-404__content {
    order: 2;
  }

  .afel-error-404__image {
    order: 1;
    padding: 16px;
  }

  .afel-error-404__image img,
  .afel-error-404__image svg {
    max-height: 250px;
  }

  .afel-error-404__code {
    font-size: clamp(2.5rem, 8vw, 4rem);
  }

  .afel-error-404__subtitle {
    font-size: var(--afel-h4-size);
  }

  .afel-error-404__search .search-form {
    max-width: 350px;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  .afel-error-404 {
    gap: 16px;
    margin: 24px 0;
  }

  .afel-error-404__content {
    gap: 16px;
  }

  .afel-error-404__code {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 4px;
  }

  .afel-error-404__subtitle {
    font-size: var(--afel-h5-size);
    margin-bottom: 10px;
  }

  .afel-error-404__text {
    margin-bottom: 16px;
  }

  .afel-error-404__text p {
    font-size: 0.9rem;
  }

  .afel-error-404__search {
    margin: 16px 0;
  }

  .afel-error-404__search .search-form {
    max-width: 300px;
    flex-direction: column;
  }

  .afel-error-404__search .search-field {
    padding: 10px 16px;
  }

  .afel-error-404__search .search-submit {
    padding: 10px 16px;
  }

  .afel-error-404__button {
    padding: 10px 24px;
    font-size: 0.9rem;
  }

  .afel-error-404__image img,
  .afel-error-404__image svg {
    max-height: 200px;
  }
}

/*--------------------------------------------------------------
# 404 Error Accessibility
--------------------------------------------------------------*/

.afel-error-404 *:focus {
  outline: 2px solid var(--afel-brand-color);
  outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  .afel-error-404__code {
    animation: none;
  }

  .afel-error-404__image svg {
    animation: none;
  }

  .afel-error-404__content,
  .afel-error-404__image {
    animation: none;
  }

  .afel-error-404__button::before {
    display: none;
  }
}

/*--------------------------------------------------------------
# 404 Error Dark Mode Support
--------------------------------------------------------------*/

@media (prefers-color-scheme: dark) {
  .afel-error-404__code {
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.1);
  }
}
