@import 'https://fonts.googleapis.com/css?family=Inconsolata';

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #000000;
  background-image: radial-gradient(#11581E, #041607), url("https://media.giphy.com/media/oEI9uBYSzLpBK/giphy.gif");
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  font-family: 'Inconsolata', Helvetica, sans-serif;
  font-size: 1.5rem;
  color: rgba(128, 255, 128, 0.8);
  text-shadow:
      0 0 1ex rgba(51, 255, 51, 1),
      0 0 2px rgba(255, 255, 255, 0.8);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  overflow-x: hidden;
  padding-top: 1vh;
}

.noise {
  pointer-events: none;
  position: fixed;
  width: 100%;
  height: 100%;
  background-image: url("https://media.giphy.com/media/oEI9uBYSzLpBK/giphy.gif");
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  z-index: -1;
  opacity: 0;
  transition: opacity 2s ease;
}

.noise.visible {
  opacity: .02;
}

.overlay {
  pointer-events: none;
  position: fixed;
  width: 100%;
  height: 100%;
  background:
      repeating-linear-gradient(
      180deg,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0.3) 50%,
      rgba(0, 0, 0, 0) 100%);
  background-size: auto 4px;
  z-index: 1;
  opacity: 0;
  transition: opacity 1s ease;
}

.overlay.visible {
  opacity: 1;
}

.overlay::before {
  content: "";
  pointer-events: none;
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
      0deg,
      transparent 0%,
      rgba(32, 128, 32, 0.2) 2%,
      rgba(32, 128, 32, 0.8) 3%,
      rgba(32, 128, 32, 0.2) 3%,
      transparent 100%);
  background-repeat: no-repeat;
  animation: scan 7.5s linear 0s infinite;
  opacity: 0;
  transition: opacity 1s ease;
}

.overlay.visible::before {
  opacity: 1;
}

@keyframes scan {
  0%        { background-position: 0 -100vh; }
  35%, 100% { background-position: 0 100vh; }
}

.terminal {
  box-sizing: inherit;
  width: 90vw;
  max-width: 1000px;
  padding: 1.5rem 2rem 2rem 2rem;
  text-transform: uppercase;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  min-height: 80vh;
  margin-top: 0.5rem;
  position: relative;
  z-index: 1;
}

.terminal > * {
  transition: opacity 0.1s ease;
}

.output {
  color: rgba(128, 255, 128, 0.8);
  text-shadow:
      0 0 1px rgba(51, 255, 51, 0.4),
      0 0 2px rgba(255, 255, 255, 0.8);
  position: relative;
}

.output::before {
  content: "> ";
  opacity: 1;
}

a {
  color: #fff;
  text-decoration: none;
}

a::before {
  content: "";
}

a::after {
  content: "";
}

.errorcode {
  color: white;
}

/* Modification du style du titre principal */
h1 .errorcode {
  font-size: 2.2em;
  display: block;
  margin-bottom: 0;
  color: #ffffff;
  text-shadow: 
    0 0 10px rgba(51, 255, 51, 1),
    0 0 20px rgba(51, 255, 51, 0.8),
    0 0 30px rgba(51, 255, 51, 0.6);
}

/* Style pour les titres de sections */
h3 .errorcode {
  font-size: 1.2em;
  margin: 15px 0;
  color: #ffffff;
  text-shadow: 
    0 0 10px rgba(51, 255, 51, 1),
    0 0 20px rgba(51, 255, 51, 0.8),
    0 0 30px rgba(51, 255, 51, 0.6);
}

@media (max-width: 844px) {  /* iPhone 15 et similaires */
  body {
    font-size: 0.8rem;
    padding-top: 0;
  }
  
  .terminal {
    padding: 0.8rem;
    width: 100vw;
    margin: 0;
    min-height: 100vh;
  }

  h1 .errorcode {
    font-size: 2rem !important;  /* Plus grand */
    margin-top: 0.3rem;
  }

  h3 .errorcode {
    font-size: 1.5rem !important;  /* Plus grand */
    margin: 8px 0;
  }

  .output {
    font-size: 1.2rem !important;  /* Plus grand */
    margin: 2px 0;
  }

  .output a {
    font-size: 1.2rem !important;  /* Plus grand */
  }
}

/* Pour les plus petits écrans */
@media (max-width: 390px) {
  h1 .errorcode {
    font-size: 1.8rem !important;  /* Plus grand */
  }
}

.popup {
  display: none;
  position: fixed;
  z-index: 2;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
}

.popup-content {
  background-color: #000;
  margin: auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  text-align: center;
  box-shadow:
      0 0 1ex rgba(51, 255, 51, 1),
      0 0 2px rgba(255, 255, 255, 0.8);
}

.close-btn {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}

.close-btn:hover,
.close-btn:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

#password {
  width: 80%;
  padding: 10px;
  margin: 10px 0;
  border: none;
  box-shadow:
      0 0 1ex rgba(51, 255, 51, 1),
      0 0 2px rgba(255, 255, 255, 0.8);
  background-color: #111;
  color: rgba(128, 255, 128, 0.8);
}

#submit-btn {
  padding: 10px 20px;
  background-color: #111;
  color: rgba(128, 255, 128, 0.8);
  border: none;
  box-shadow:
      0 0 1ex rgba(51, 255, 51, 1),
      0 0 2px rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

#submit-btn:hover {
  background-color: rgba(32, 128, 32, 0.8);
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.5s;
}

/* Ajustement de l'espace entre les sections */
.terminal p {
  margin: 5px 0;
}

/* Effet hover pour les liens */
.output a {
  transition: all 0.2s ease;
  position: relative;
  display: inline-block;
}

.output a:hover {
  transform: scale(1.1);
  text-shadow: 
    0 0 5px rgba(51, 255, 51, 1),
    0 0 10px rgba(51, 255, 51, 1),
    2px 2px 2px rgba(0, 0, 0, 0.5);
}

/* Ajout d'effets CRT et glitch */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 2;
  pointer-events: none;
  animation: flicker 0.15s infinite;
}

@keyframes flicker {
  0% { opacity: 0.9; }
  50% { opacity: 1; }
  100% { opacity: 0.9; }
}

/* Effet de distorsion sur les liens */
.output:hover {
  animation: textShadowPulse 0.5s ease-in-out infinite;
}

@keyframes textShadowPulse {
  0% {
    text-shadow: 0 0 4px rgba(51, 255, 51, 0.6),
                 0 0 8px rgba(51, 255, 51, 0.4);
  }
  50% {
    text-shadow: 0 0 4px rgba(51, 255, 51, 1),
                 0 0 18px rgba(51, 255, 51, 0.8);
  }
  100% {
    text-shadow: 0 0 4px rgba(51, 255, 51, 0.6),
                 0 0 8px rgba(51, 255, 51, 0.4);
  }
}

/* Amélioration de l'effet glitch sur les liens */
.output a:hover {
  animation: glitchText 0.2s infinite;
}

@keyframes glitchText {
  0% {
    text-shadow: 2px 0 rgba(255, 0, 0, 0.5),
                -2px 0 rgba(0, 255, 0, 0.5);
    transform: translate(0);
  }
  25% {
    text-shadow: -2px 0 rgba(255, 0, 0, 0.5),
                 2px 0 rgba(0, 255, 0, 0.5);
    transform: translate(1px);
  }
  50% {
    text-shadow: 2px 0 rgba(0, 255, 0, 0.5),
                -2px 0 rgba(255, 0, 0, 0.5);
    transform: translate(0);
  }
  75% {
    text-shadow: -2px 0 rgba(0, 255, 0, 0.5),
                 2px 0 rgba(255, 0, 0, 0.5);
    transform: translate(-1px);
  }
  100% {
    text-shadow: 2px 0 rgba(255, 0, 0, 0.5),
                -2px 0 rgba(0, 255, 0, 0.5);
    transform: translate(0);
  }
}
