/* Variables de colores extendidas */
:root {
  --azul-oscuro: #0a192f;
  --azul-medio: #112240;
  --azul-claro: #64ffda;
  --azul-neon: #00bfff;
  --texto-claro: #ccd6f6;
  --texto-oscuro: #8892b0;
  --rojo-neon: #ff2e6c;
  --verde-neon: #00ff9d;
  --purple-neon: #bd00ff;
  --cyan-hologram: #00f3ff;
  --matrix-green: #00ff4c;
  --hologram-blue: #00a2ff;
  --golden: #ffd700;
}

/* Estilos generales optimizados */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", monospace;
}

html {
  overflow: hidden;
  height: 100%;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background-color: var(--azul-oscuro);
  color: var(--texto-claro);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 15px;
  perspective: 1000px;
  overscroll-behavior-y: none;
  scroll-snap-type: y proximity;
}

/* Para PC/Laptop: eliminar scroll vertical */
@media (min-width: 1024px) {
  body {
    overflow-y: hidden;
    padding: 20px;
  }

  #main-content {
    overflow-y: auto;
    max-height: calc(100vh - 100px);
    width: 100%;
  }
}

/* Fondo con efecto 3D optimizado */
.cyber-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: linear-gradient(
    135deg,
    #0a192f 0%,
    #0d1f3a 50%,
    #112240 100%
  );
  overflow: hidden;
}

.grid-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(100, 255, 218, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 255, 218, 0.03) 1px, transparent 1px);
  background-size: 25px 25px;
  background-position: center center;
  transform-style: preserve-3d;
  animation: gridMove 20s infinite linear;
}

@keyframes gridMove {
  0% {
    transform: translateZ(0) rotateX(0) rotateY(0);
  }
  100% {
    transform: translateZ(0) rotateX(360deg) rotateY(360deg);
  }
}

/* Efecto de conexiones neuronales optimizado */
.neural-network {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
}

.neural-node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--cyan-hologram);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan-hologram), 0 0 20px var(--cyan-hologram);
}

.neural-connection {
  position: absolute;
  background: linear-gradient(
    to right,
    rgba(0, 243, 255, 0.3),
    rgba(0, 243, 255, 0.1)
  );
  transform-origin: 0 0;
  height: 1px;
}

/* Animación de carga mejorada */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--azul-oscuro);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.holographic-loader {
  width: 180px;
  height: 180px;
  position: relative;
  transform-style: preserve-3d;
  animation: hologramRotate 8s infinite linear;
}

.holo-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 2px solid transparent;
  border-top: 2px solid var(--azul-claro);
  border-radius: 50%;
  animation: spin 2s infinite linear;
  box-shadow: 0 0 15px var(--azul-claro);
}

.holo-ring:nth-child(2) {
  border-top: 2px solid var(--azul-neon);
  animation-duration: 3s;
  width: 140px;
  height: 140px;
  top: 20px;
  left: 20px;
}

.holo-ring:nth-child(3) {
  border-top: 2px solid var(--purple-neon);
  animation-duration: 4s;
  width: 100px;
  height: 100px;
  top: 40px;
  left: 40px;
}

.holo-ring:nth-child(4) {
  border-top: 2px solid var(--cyan-hologram);
  animation-duration: 5s;
  width: 60px;
  height: 60px;
  top: 60px;
  left: 60px;
}

@keyframes hologramRotate {
  0% {
    transform: rotateY(0) rotateX(20deg);
  }
  100% {
    transform: rotateY(360deg) rotateX(20deg);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loader-text {
  margin-top: 25px;
  font-size: 0.9rem;
  color: var(--azul-claro);
  letter-spacing: 2px;
  text-shadow: 0 0 10px var(--azul-claro);
  animation: pulseText 2s infinite alternate;
}

@keyframes pulseText {
  0% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

/* Contenedor principal mejorado */
#main-content {
  display: none;
  width: 100%;
  max-width: 900px;
  opacity: 0;
  transition: opacity 0.8s ease-in;
  transform-style: preserve-3d;
  flex: 1;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 60px;
  overflow: hidden;
}

.header {
  text-align: center;
  margin-bottom: 15px;
  padding: 10px;
  position: relative;
}

h1 {
  color: var(--azul-claro);
  font-size: 2.2rem;
  text-shadow: 0 0 10px rgba(100, 255, 218, 0.5);
  letter-spacing: 3px;
  margin-bottom: 8px;
  word-wrap: break-word;
  position: relative;
  display: inline-block;
}

h1::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--azul-claro),
    transparent
  );
  animation: titleScan 3s linear infinite;
}

@keyframes titleScan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.subtitle {
  color: var(--texto-oscuro);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

/* Botón de reclutamiento mejorado */
.reclutamiento-btn {
  display: block;
  margin: 15px auto;
  padding: 14px 32px;
  background: transparent;
  color: var(--azul-claro);
  border: 1px solid var(--azul-claro);
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
  letter-spacing: 1.5px;
  max-width: 300px;
  width: 100%;
  text-transform: uppercase;
}

.reclutamiento-btn:hover {
  background-color: rgba(100, 255, 218, 0.1);
  box-shadow: 0 0 20px var(--azul-claro);
  transform: translateY(-2px) scale(1.02);
}

.reclutamiento-btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(100, 255, 218, 0.4),
    transparent
  );
  transition: 0.5s;
  z-index: -1;
}

.reclutamiento-btn:hover:before {
  left: 100%;
}

/* Nuevo efecto de partículas doradas */
.golden-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.golden-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: var(--golden);
  border-radius: 50%;
  opacity: 0;
  animation: golden-float 15s infinite linear;
  box-shadow: 0 0 5px var(--golden);
}

@keyframes golden-float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-20px) translateX(20px) rotate(360deg);
    opacity: 0;
  }
}

/* Editor de código mejorado */
#editor-container {
  display: none;
  width: 100%;
  border: 1px solid var(--azul-claro);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(100, 255, 218, 0.3);
  opacity: 0;
  transform: translateY(15px) rotateX(5deg);
  transition: all 0.4s ease;
  position: relative;
  z-index: 2;
  background: rgba(10, 25, 47, 0.9);
  margin: 0 auto;
  height: 350px;
  transform-style: preserve-3d;
}

.editor-container-hologram {
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  background: linear-gradient(
    45deg,
    rgba(100, 255, 218, 0.05),
    rgba(0, 191, 255, 0.05),
    rgba(189, 0, 255, 0.05)
  );
  z-index: -1;
  filter: blur(5px);
  opacity: 0.5;
  transform: translateZ(-10px);
  animation: holoPulse 6s infinite alternate;
}

@keyframes holoPulse {
  0% {
    opacity: 0.3;
  }
  100% {
    opacity: 0.7;
  }
}

.editor-header {
  background: linear-gradient(
    to right,
    rgba(17, 34, 64, 0.9),
    rgba(10, 25, 47, 0.9)
  );
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--azul-claro);
  position: relative;
}

.editor-title {
  font-size: 0.95rem;
  color: var(--azul-claro);
  display: flex;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: center;
}

.editor-title::before {
  content: ">";
  margin-right: 8px;
  color: var(--verde-neon);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

#editor {
  background-color: rgba(10, 25, 47, 0.8);
  padding: 15px;
  height: calc(350px - 45px);
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
  font-size: 13px;
  line-height: 1.4;
  color: var(--texto-claro);
  overflow-wrap: break-word;
  word-wrap: break-word;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 2;
}

/* Barra de desplazamiento personalizada */
#editor::-webkit-scrollbar {
  width: 6px;
}

#editor::-webkit-scrollbar-track {
  background: var(--azul-medio);
  border-radius: 10px;
}

#editor::-webkit-scrollbar-thumb {
  background: var(--azul-claro);
  border-radius: 10px;
}

/* Controles del editor mejorados */
.editor-controls {
  display: flex;
  justify-content: center;
  margin-top: 15px;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  flex-wrap: wrap;
  width: 100%;
}

.control-btn {
  padding: 8px 15px;
  background: transparent;
  color: var(--texto-claro);
  border: 1px solid var(--azul-medio);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  flex: 1;
  min-width: 110px;
  max-width: 160px;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-btn:hover {
  border-color: var(--azul-claro);
  box-shadow: 0 0 15px rgba(100, 255, 218, 0.4);
  transform: translateY(-2px);
}

.control-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(100, 255, 218, 0.2),
    transparent
  );
  transition: 0.5s;
}

.control-btn:hover::before {
  left: 100%;
}

/* Efecto de escaneo mejorado */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    to right,
    transparent,
    var(--azul-claro),
    transparent
  );
  box-shadow: 0 0 15px var(--azul-claro), 0 0 30px var(--azul-claro);
  animation: scan 3s linear infinite;
  opacity: 0.7;
  pointer-events: none;
  z-index: 10;
  display: none;
}

@keyframes scan {
  0% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(100%);
  }
}

/* Terminal cursor con efecto de energía */
.cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background-color: var(--azul-claro);
  margin-left: 2px;
  animation: blink 1s infinite, energyPulse 2s infinite;
  vertical-align: middle;
  box-shadow: 0 0 5px var(--azul-claro);
  border-radius: 20%;
}

@keyframes energyPulse {
  0%,
  100% {
    box-shadow: 0 0 5px var(--azul-claro);
  }
  50% {
    box-shadow: 0 0 15px var(--azul-claro), 0 0 20px var(--azul-claro);
  }
}

/* Partículas neurales optimizadas */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background-color: var(--cyan-hologram);
  border-radius: 50%;
  opacity: 0;
  animation: particle-float 15s infinite linear;
  box-shadow: 0 0 5px var(--cyan-hologram);
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(-20px) translateX(20px) rotate(360deg);
    opacity: 0;
  }
}

/* Efecto de transición dimensional mejorado */
.dimension-portal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(
    circle,
    var(--cyan-hologram) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  opacity: 0;
  z-index: 9998;
  pointer-events: none;
  transition: all 1s ease-in-out;
}

.portal-active {
  width: 200vmax;
  height: 200vmax;
  opacity: 0.9;
}

/* Nuevo efecto de glitch en texto */
.glitch-text {
  position: relative;
  display: inline-block;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  animation: glitch-effect 3s infinite;
  color: var(--rojo-neon);
  z-index: -1;
}

.glitch-text::after {
  animation: glitch-effect 2s infinite;
  color: var(--cyan-hologram);
  z-index: -2;
}

@keyframes glitch-effect {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-3px, 3px);
  }
  40% {
    transform: translate(-3px, -3px);
  }
  60% {
    transform: translate(3px, 3px);
  }
  80% {
    transform: translate(3px, -3px);
  }
  100% {
    transform: translate(0);
  }
}

/* Pie de página con derechos reservados - MODIFICADO PARA FIJARLO */
.cyber-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 12px 10px;
  color: var(--texto-oscuro);
  font-size: 0.75rem;
  letter-spacing: 1px;
  z-index: 100;
  background: rgba(10, 25, 47, 0.7);
  backdrop-filter: blur(5px);
}

.cyber-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--azul-claro),
    transparent
  );
}

.cyber-footer span {
  color: var(--azul-claro);
  text-shadow: 0 0 5px rgba(100, 255, 218, 0.5);
}

/* Estilo para el botón de copiar */
.copy-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(10, 25, 47, 0.9);
  color: var(--azul-claro);
  padding: 10px 15px;
  border-radius: 4px;
  border: 1px solid var(--azul-claro);
  box-shadow: 0 0 15px rgba(100, 255, 218, 0.5);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.copy-notification.show {
  opacity: 1;
  transform: translateY(0);
}

/* Media Queries optimizadas */
@media (min-width: 768px) {
  body {
    padding: 20px;
  }

  h1 {
    font-size: 2.8rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .reclutamiento-btn {
    font-size: 1.1rem;
    padding: 15px 35px;
    max-width: 350px;
    margin: 20px auto;
  }
  #editor-container {
    height: 400px;
  }
  #editor {
    font-size: 15px;
    padding: 25px;
    height: calc(400px - 45px);
  }
  .editor-header {
    padding: 12px 20px;
  }
  .editor-title {
    font-size: 1.05rem;
  }
  .control-btn {
    font-size: 0.9rem;
    padding: 12px 20px;
    min-width: 120px;
    max-width: 180px;
  }
  .cyber-footer {
    font-size: 0.85rem;
    padding: 20px;
  }
  .header {
    margin-bottom: 25px;
    padding: 15px 10px;
  }
  .editor-controls {
    margin-top: 20px;
    gap: 12px;
  }
}

@media (min-width: 1024px) {
  #editor-container {
    max-width: 850px;
  }
  #editor {
    font-size: 15px;
  }
  .editor-controls {
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px 8px;
    justify-content: flex-start;
    scroll-snap-type: y mandatory;
  }

  #main-content {
    margin-bottom: 50px;
    scroll-snap-align: start;
  }

  h1 {
    font-size: 1.7rem;
    letter-spacing: 2px;
    margin-bottom: 5px;
  }
  .header {
    padding: 6px 4px;
    margin-bottom: 8px;
  }

  .subtitle {
    font-size: 0.75rem;
    margin-bottom: 4px;
  }

  #editor-container {
    height: 250px;
  }

  #editor {
    padding: 10px;
    font-size: 11px;
    line-height: 1.3;
    height: calc(250px - 45px);
  }

  .editor-header {
    padding: 6px 10px;
  }

  .editor-title {
    font-size: 0.75rem;
  }

  .control-btn {
    min-width: 90px;
    padding: 6px 8px;
    font-size: 0.7rem;
    margin: 2px;
  }

  .reclutamiento-btn {
    font-size: 0.85rem;
    padding: 8px 16px;
    margin: 10px auto;
  }

  .cyber-footer {
    font-size: 0.65rem;
    padding: 6px;
  }

  /* Reducir partículas en móviles */
  .particle {
    animation-duration: 20s;
  }

  .editor-controls {
    gap: 5px;
    margin-top: 10px;
  }
}

@media (max-height: 600px) and (orientation: portrait) {
  body {
    padding: 8px 6px;
  }

  #editor-container {
    height: 200px;
  }
  #editor {
    height: calc(200px - 45px);
    font-size: 10px;
    padding: 8px;
  }
  .header {
    margin-bottom: 6px;
    padding: 4px;
  }
  h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
  }
  .subtitle {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }
  .reclutamiento-btn {
    margin: 6px auto;
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  .cyber-footer {
    padding: 4px;
  }
  .editor-controls {
    margin-top: 8px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  body {
    padding: 6px 4px;
  }

  #editor-container {
    height: 180px;
  }
  #editor {
    height: calc(180px - 45px);
    font-size: 9px;
    padding: 6px;
  }
  .header {
    margin-bottom: 4px;
    padding: 2px;
  }
  h1 {
    font-size: 1.3rem;
    margin-bottom: 1px;
  }
  .reclutamiento-btn {
    margin: 4px auto;
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  .cyber-footer {
    padding: 2px;
  }
  .editor-controls {
    margin-top: 6px;
    gap: 3px;
  }
  .control-btn {
    min-width: 80px;
    padding: 4px 6px;
    font-size: 0.65rem;
  }
} 

