:root {
  --bg-default: #1c1c28; /* Fondo principal oscuro */
  --bg-card: rgba(40, 40, 60, 0.4); /* Fondo de tarjeta base */
  --bg-card-hover: rgba(60, 60, 90, 0.5); /* Fondo de tarjeta al pasar el ratón */
  --color-text-primary: #f0f0f0; /* Color de texto principal */
  --color-text-secondary: #aaa; /* Color de texto secundario/footer */
  --shadow-dark: 0 8px 25px rgba(0, 0, 0, 0.35), inset 0 1px 10px rgba(255, 255, 255, 0.05); /* Sombra de tarjeta base */
  --shadow-hover: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 2px 15px rgba(255, 255, 255, 0.08); /* Sombra de tarjeta al pasar el ratón */

  /* Paletas por servicio (se mantienen) */
  --bg-jellynas: #2e1a38;
  --bg-navinas: #1a2e1a;
  --bg-deemixnas: #1a2c2e;
  --bg-booknas: #2e261a;

  --title-default: #00d1ff;
  --title-jellynas: #b088d8;
  --title-navinas: #4cd964;
  --title-deemixnas: #00d1ff;
  --title-booknas: #f4c542;

  --icon-jellynas: #9b59b6;
  --icon-navinas: #1db954;
  --icon-deemixnas: #00d1ff;
  --icon-booknas: #f4c542;
}

/* 🎨 Animación de fondo sutil para un toque futurista */
@keyframes backgroundPan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

* {
  box-sizing: border-box;
  text-decoration: none;
  margin: 0;
  padding: 0;
}

/* --- Configuración base y footer --- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Fuente más moderna */
  
  /* *** CÓDIGO ACTUALIZADO: Degradado solo con tonos oscuros *** */
  background: linear-gradient(135deg, #101018 0%, #282838 50%, var(--bg-default) 100%);
  background-size: 200% 200%; 
  animation: backgroundPan 30s ease infinite; /* Mantenemos la animación */
  /* ********************************************************** */
  
  color: var(--color-text-primary);
  padding: 20px;
  overflow-x: hidden;
}

main {
  flex-grow: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

footer {
  margin-top: auto;
  padding: 15px;
  font-size: 0.9em;
  color: var(--color-text-secondary);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05); /* Separador sutil */
}

a {
  color: inherit;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--title-default);
}

/* --- Estilos de cabecera (Header) --- */
header {
  text-align: center;
  margin-bottom: 60px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 20px;
}

header h1 {
  font-size: 2.2em;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05); /* Efecto "glass" */
  backdrop-filter: blur(15px);
  padding: 12px 30px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 10px rgba(0, 209, 255, 0.5); /* Resplandor sutil */
  color: var(--title-default);
  display: inline-block;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin: 0 auto;
  letter-spacing: 2px;
}

header h1:hover {
  box-shadow: 0 0 30px rgba(0, 209, 255, 0.3);
  transform: translateY(-2px);
}

.back-button {
  font-size: 1.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  vertical-align: middle;
  border-radius: 50%; /* Botón circular */
  transition: all 0.3s ease;
  color: var(--color-text-primary);
  opacity: 0.8;
}

.back-button:hover {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* --- Tarjetas de servicio (Cards) --- */
.cards {
  display: grid;
  /* Permite 4 columnas en escritorio, con un min de 240px */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
  gap: 30px;
  width: 100%;
  max-width: 1100px; /* Aumentado para mejor distribución */
  margin: 0 auto;
  padding: 20px 0;
  justify-items: center;
}

.card {
  background: var(--bg-card);
  border-radius: 24px;
  width: 100%;
  max-width: 250px; /* Aumentado para más espacio */
  /* Altura dinámica ya que eliminamos aspect-ratio */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between; /* Clave para que los botones se queden abajo */
  text-align: center;
  color: var(--color-text-primary);
  padding: 30px; /* Aumentado para más espacio interior */
  font-weight: 600;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: var(--shadow-dark);
  backdrop-filter: blur(12px);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), background 0.3s ease;
  position: relative;
  overflow: hidden;
  min-height: 300px; /* Altura mínima para uniformidad visual */
}

/* ✨ Efecto de borde dinámico (Pseudo-elemento) */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(45deg, #444, #888);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.15;
  transition: opacity 0.3s ease;
}

.card:hover::before {
  opacity: 0.4;
  /* Animación de color de borde sutil */
  animation: borderGlow 4s infinite alternate;
}

@keyframes borderGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.card:hover {
  transform: translateY(-12px); /* Más movimiento */
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-hover);
}

.card i {
  font-size: 3.5em;
  margin-bottom: 20px;
  /* Sombra del icono con resplandor */
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.4));
  transition: transform 0.4s ease;
}

.card:hover i {
  transform: scale(1.1) rotate(5deg); /* Animación del icono */
}

/* Colores de borde para cada tarjeta */
.card.jellynas::before { background: linear-gradient(45deg, var(--icon-jellynas), #e91e63); }
.card.navinas::before { background: linear-gradient(45deg, var(--icon-navinas), #cddc39); }
.card.deemixnas::before { background: linear-gradient(45deg, var(--icon-deemixnas), #673ab7); }
.card.booknas::before { background: linear-gradient(45deg, var(--icon-booknas), #ff9800); }


.card span {
  font-size: 1.3em;
  margin-bottom: 8px;
  color: var(--color-text-primary);
  letter-spacing: 1px;
}

.card small {
  font-size: 0.8em;
  color: var(--color-text-secondary);
  text-transform: none;
  font-weight: normal;
  opacity: 0.8;
  margin-bottom: 10px;
}

.guia-btn {
  margin-top: 10px; 
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 10;
}

.copy-server-link {
  margin-top: 15px; /* Más espacio entre los dos botones */
  padding: 10px 18px; /* Botón más grande y usable */
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: pointer;
  border: 1px solid transparent;
  width: 100%; /* CLAVE: Ocupa todo el ancho de la tarjeta */
}

.copy-server-link:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.02); 
  border-color: rgba(255, 255, 255, 0.3);
}

/* Animación de "click" para los botones de copia */
.copy-server-link:active {
  transform: scale(0.98);
  box-shadow: 0 0 10px currentColor;
}

.jellynas .copy-server-link { border-color: var(--title-jellynas); }
.navinas .copy-server-link { border-color: var(--title-navinas); }
.deemixnas .copy-server-link { border-color: var(--title-deemixnas); }
.booknas .copy-server-link { border-color: var(--title-booknas); }


/* --- Secciones de Instrucciones (Guías) --- */
section {
  margin-bottom: 40px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

section h2 {
  margin-bottom: 25px;
  text-align: center;
  text-transform: uppercase;
  font-size: 1.6em;
  font-weight: 700;
  letter-spacing: 1px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.instructions-block {
  display: flex;
  align-items: center;
  gap: 30px; /* Aumentamos el gap entre texto e imagen */
  margin-bottom: 40px;
  flex-wrap: wrap;
  justify-content: space-around;
}

/* El texto por defecto se pone a la izquierda (orden 1) */
.instructions-text, .instructions-text2 {
  flex: 1 1 350px; /* Permite que el texto sea un poco más ancho */
  animation: fadeInLeft 1s ease-out; /* Animación de entrada de izquierda */
}
@keyframes fadeInLeft {
  0% { opacity: 0; transform: translateX(-20px); }
  100% { opacity: 1; transform: translateX(0); }
}

.instructions-text p, .instructions-text2 p, .instructions-text2 ul {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
}

/* Estilo para las listas dentro de los bloques de texto */
.instructions-text2 ul {
    list-style-type: '⚡'; /* Símbolo moderno */
    padding-left: 20px;
    margin-top: 10px;
}
.instructions-text2 ul li {
    margin-bottom: 5px;
}

/* La imagen por defecto se pone a la derecha (orden 2) */
.instructions-img {
  flex: 0 0 450px; /* Ajustamos el ancho maximo de la imagen */
  text-align: right;
  animation: fadeInRight 1s ease-out; /* Animación de entrada de derecha */
}

@keyframes fadeInRight {
  0% { opacity: 0; transform: translateX(20px); }
  100% { opacity: 1; transform: translateX(0); }
}

.instructions-img img {
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  /* Añadido: cursor para indicar que es clicable */
  cursor: zoom-in;
}

.instructions-img img:hover {
  transform: scale(1.01); 
}

/* Enlaces de descargas */
.links ul {
    list-style: none;
    padding: 0;
    text-align: center;
}
.links li {
    margin: 15px 0; /* Más espacio entre enlaces */
}
.links a {
  font-size: 1.1em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.links a:hover {
  background-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 15px currentColor;
  border-color: currentColor; 
}

/* Botón de copiar ARL */
.copy-button {
  background-color: var(--title-deemixnas);
  color: #0a0a0a;
  border: none;
  padding: 12px 20px; 
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  margin-left: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.copy-button:hover {
  background-color: #00b8e6;
  box-shadow: 0 5px 20px rgba(0, 209, 255, 0.6);
  transform: translateY(-2px);
}

.copy-button:active {
  transform: scale(0.95);
  box-shadow: none;
}

/* --- Colores dinámicos por página (se mantienen igual) --- */
body.jellynas header h1, body.jellynas .back-button, body.jellynas .instructions h2, body.jellynas .links h2, body.jellynas .links a { color: var(--title-jellynas); }
body.navinas header h1, body.navinas .back-button, body.navinas .instructions h2, body.navinas .links h2, body.navinas .links a { color: var(--title-navinas); }
body.deemixnas header h1, body.deemixnas .back-button, body.deemixnas .instructions h2, body.deemixnas .links h2, body.deemixnas .links a { color: var(--title-deemixnas); }
body.booknas header h1, body.booknas .back-button, body.booknas .instructions h2, body.booknas .links h2, body.booknas .links a { color: var(--title-booknas); }

/* ****************************************************** */
/* --- ESTILOS DEL LIGHTBOX (Modal de Imagen) --- */
/* ****************************************************** */

/* Contenedor del modal */
.modal {
  display: none; /* Inicialmente oculto */
  position: fixed;
  z-index: 1000; /* Asegura que esté por encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9); /* Fondo negro semitransparente */
  backdrop-filter: blur(5px);
  padding-top: 60px;
  animation: fadeInModal 0.3s ease;
}

/* Animación de entrada */
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Contenido (la imagen) */
.modal-content {
  margin: auto;
  display: block;
  width: 90%;
  max-width: 900px; /* Tamaño máximo para la imagen en el modal */
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  animation: zoomIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Animación de zoom sutil al abrir */
@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

/* Botón de cerrar */
.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
  opacity: 0.7;
  text-shadow: 0 0 10px rgba(0, 0, 0, 1);
}

.close:hover,
.close:focus {
  color: #fff;
  opacity: 1;
  text-decoration: none;
  transform: rotate(90deg); /* Animación de rotación al pasar el ratón */
}

/* --- Media Queries --- */
@media (max-width: 768px) {
  /* Cards vuelven a ser una sola columna */
  .cards {
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 350px;
  }
  .card {
    max-width: 100%;
    padding: 25px; 
    min-height: auto;
  }
  
  .card i {
    font-size: 3em;
    margin-bottom: 15px;
  }
  
  .card span { font-size: 1.1em; }
  .card small { font-size: 0.75em; }

  .guia-btn {
    font-size: 0.9em;
    margin-top: 10px;
  }
  
  .copy-server-link {
    font-size: 0.8em;
    padding: 8px 15px;
    margin-top: 10px;
  }


  /* Ajustes para las páginas de instrucciones en móvil */
  .instructions-block {
    flex-direction: column; /* Apila el texto y la imagen */
    text-align: center;
    gap: 20px;
  }
  .instructions-text, .instructions-text2 {
    order: 1; /* Texto primero */
    flex: 1 1 100%; 
    text-align: left; 
    animation: none; 
  }
  .instructions-text2 {
      text-align: center; /* Centrar el texto en el bloque sin imagen */
  }
  /* Forzar que el contenido interno de .instructions-text y .instructions-text2 se alinee a la izquierda */
  .instructions-text p, .instructions-text2 p, .instructions-text2 ul {
      text-align: left;
  }
  .instructions-img {
    order: 2; /* Imagen debajo del texto */
    text-align: center;
    flex: 0 0 auto;
    width: 100%;
    animation: none; 
  }
  
  /* Ajuste para el botón deemixnas en móvil */
  .copy-button {
      margin-left: 0;
      width: 100%;
      margin-top: 10px;
  }

  /* Ajuste del modal en móvil (solo aplica a la imagen) */
  .modal-content {
      width: 100%;
      max-width: 95%;
  }
}