/* ==============================
   Estilos específicos para 404
   ============================== */

/* Hero de 404 con altura completa e imagen de fondo */
.error-hero {
  position: relative;
  height: 100vh;
  margin-top: -100px;
  padding-top: 100px;

  /* Fondo: degradado + imagen */
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url("../img/404-bg.jpg") no-repeat center center;
  background-size: cover;

  /* Centrado de contenido */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  overflow: hidden;
}

/* Efecto de partículas/estrellas en el fondo */
.error-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("../img/particles.png") repeat;
  background-size: 1000px 1000px;
  opacity: 0.2;
  animation: float 120s linear infinite;
  pointer-events: none;
}

@keyframes float {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 1000px 1000px;
  }
}

.error-hero__content {
  max-width: 800px;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.error-code {
  font-size: 12rem;
  font-weight: 900;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #ffa500, #ff005e);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
  text-shadow: 0 0 40px rgba(255, 165, 0, 0.5);
  line-height: 0.8;
  animation: pulse 2s ease-in-out infinite alternate;
  position: relative;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 40px rgba(255, 165, 0, 0.5));
  }
  100% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 60px rgba(255, 165, 0, 0.8));
  }
}

.error-title {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #fff;
  font-weight: 700;
}

.error-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: #ccc;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.error-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.btn-secondary {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: transparent;
  color: #fff;
  text-decoration: none;
  border: 2px solid transparent;
  background-image: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0)), linear-gradient(90deg, #ffa500, #ff005e);
  background-origin: border-box;
  background-clip: content-box, border-box;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffa500, #ff005e);
  transition: left 0.3s ease;
  z-index: -1;
  border-radius: 50px;
}

.btn-secondary:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(255, 0, 94, 0.3);
}

.btn-secondary:hover::before {
  left: 0;
}

/* Elementos decorativos flotantes */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-element {
  position: absolute;
  width: 4px;
  height: 4px;
  background: linear-gradient(90deg, #ffa500, #ff005e);
  border-radius: 50%;
  animation: floatUp 8s linear infinite;
}

.floating-element:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
  animation-duration: 6s;
}

.floating-element:nth-child(2) {
  left: 20%;
  animation-delay: 2s;
  animation-duration: 8s;
}

.floating-element:nth-child(3) {
  left: 30%;
  animation-delay: 4s;
  animation-duration: 7s;
}

.floating-element:nth-child(4) {
  left: 70%;
  animation-delay: 1s;
  animation-duration: 9s;
}

.floating-element:nth-child(5) {
  left: 80%;
  animation-delay: 3s;
  animation-duration: 6s;
}

.floating-element:nth-child(6) {
  left: 90%;
  animation-delay: 5s;
  animation-duration: 8s;
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(1);
    opacity: 0;
  }
}

/* Glitch effect para el código 404 */
.error-code.glitch {
  animation: glitch 1s linear infinite;
}

@keyframes glitch {
  2%,
  64% {
    transform: translate(2px, 0) skew(0deg);
  }
  4%,
  60% {
    transform: translate(-2px, 0) skew(0deg);
  }
  62% {
    transform: translate(0, 0) skew(5deg);
  }
}

.error-code.glitch:before,
.error-code.glitch:after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.error-code.glitch:before {
  animation: glitch-1 0.5s linear infinite;
  background: linear-gradient(90deg, #ffa500, #ff005e);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: -1;
}

.error-code.glitch:after {
  animation: glitch-2 0.5s linear infinite;
  background: linear-gradient(90deg, #ff005e, #ffa500);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  z-index: -2;
}

@keyframes glitch-1 {
  0%,
  14%,
  15%,
  49%,
  50%,
  99%,
  100% {
    transform: translate(0, 0);
  }
  1%,
  13% {
    transform: translate(-2px, 0);
  }
  16%,
  48% {
    transform: translate(2px, 0);
  }
}

@keyframes glitch-2 {
  0%,
  20%,
  21%,
  62%,
  63%,
  99%,
  100% {
    transform: translate(0, 0);
  }
  1%,
  19% {
    transform: translate(2px, 0);
  }
  22%,
  61% {
    transform: translate(-2px, 0);
  }
}

/* Responsive para la página 404 */
@media screen and (max-width: 992px) {
  .error-code {
    font-size: 8rem;
  }

  .error-title {
    font-size: 2.5rem;
  }

  .error-subtitle {
    font-size: 1.1rem;
  }
}

@media screen and (max-width: 768px) {
  .error-hero {
    margin-top: 0;
    padding-top: 100px;
    height: 100vh;
  }

  .error-code {
    font-size: 6rem;
  }

  .error-title {
    font-size: 2rem;
  }

  .error-subtitle {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 280px;
  }
}

@media screen and (max-width: 576px) {
  .error-code {
    font-size: 4.5rem;
  }

  .error-title {
    font-size: 1.8rem;
  }

  .error-subtitle {
    font-size: 0.9rem;
  }
}
