/* =================================
   VARIABLES Y ESTILOS GLOBALES
================================== */
:root {
  --color-fondo: #0D1117;
  --color-fondo-seccion: #161B22;
  --color-borde: #30363D;
  --color-texto-principal: #E6EDF3;
  --color-texto-secundario: #8B949E;
  --color-acento-rojo: #D73A49;
  --color-acento-azul: #2F81F7;
  --font-titulos: 'Montserrat', sans-serif;
  --font-cuerpo: 'Lato', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-cuerpo);
  color: var(--color-texto-principal);
  background-color: var(--color-fondo);
  overflow-x: hidden;
  text-align: center;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

img {
  pointer-events: none;
  user-drag: none;
  -webkit-user-drag: none;
  max-width: 100%;
  height: auto;
}

/* =================================
   PANTALLA DE CARGA Y FONDO
================================== */
#loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-fondo);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-in-out;
}
.loading-logo {
  width: 120px;
  animation: spin 2s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.video-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -3;
}
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* CAMBIO: Aumenté la opacidad para mejorar el contraste del texto */
  background: rgba(13, 17, 23, 0.8);
  z-index: -2;
}

/* =================================
   HEADER Y NAVEGACIÓN
================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 5%;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid var(--color-borde);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
}
.header-logo {
  height: 40px;
  width: auto;
}
.main-nav a {
  color: var(--color-texto-secundario);
  text-decoration: none;
  font-weight: bold;
  margin-left: 20px;
  transition: color 0.3s ease;
}
.main-nav a:hover, .main-nav a:focus {
  color: var(--color-texto-principal);
}
.nav-button {
  background-color: var(--color-acento-azul);
  color: white !important;
  padding: 10px 20px;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}
.nav-button:hover {
  background-color: #58a6ff;
}

/* =================================
   CONTENIDO PRINCIPAL (HERO)
================================== */
.main-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 1;
}
.main-content h1 {
  font-family: var(--font-titulos);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: var(--color-texto-principal);
  text-shadow: 0 0 20px rgba(47, 129, 247, 0.5);
  margin-bottom: 10px;
}
.main-content .slogan {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: var(--color-texto-secundario);
  margin-bottom: 30px;
  font-weight: bold;
}
.buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.button {
  display: inline-block;
  padding: 15px 35px;
  border-radius: 8px;
  font-family: var(--font-cuerpo);
  font-size: 18px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
}
.button.primary {
  background-color: var(--color-acento-rojo);
  color: white;
  box-shadow: 0 0 15px rgba(215, 58, 73, 0.4);
}
.button.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 20px rgba(215, 58, 73, 0.6);
}
.button.secondary {
  background-color: transparent;
  color: var(--color-texto-principal);
  border: 2px solid var(--color-borde);
}
.button.secondary:hover {
  background-color: var(--color-borde);
  color: white;
}

/* =================================
   SECCIONES Y TARJETAS
================================== */
.spacer {
  height: 20vh;
}
.section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto 50px auto;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.section.show {
  opacity: 1;
  transform: translateY(0);
}
.section h2 {
  font-family: var(--font-titulos);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin-bottom: 20px;
  color: var(--color-texto-principal);
}
.section-description {
  font-size: 1.1rem;
  color: var(--color-texto-secundario);
  max-width: 800px;
  margin: 0 auto 40px auto;
  line-height: 1.6;
}

.container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.card {
  background: var(--color-fondo-seccion);
  padding: 25px;
  border-radius: 10px;
  border: 1px solid var(--color-borde);
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--color-acento-azul);
}
.card h3 {
  font-family: var(--font-titulos);
  margin-bottom: 15px;
  color: var(--color-texto-principal);
}
.card p {
  font-size: 16px;
  color: var(--color-texto-secundario);
  margin-bottom: 20px;
  flex-grow: 1; 
}
.card .image-container {
  width: 100%;
  height: 180px;
  margin-bottom: 20px;
  border-radius: 8px;
  background-color: rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.card .button {
  width: 100%;
  margin-top: auto;
}

.faction-card {
  background-color: var(--color-fondo-seccion);
  border-radius: 10px;
  border: 1px solid var(--color-borde);
  padding: 25px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.faction-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.faction-card img {
  height: 120px;
  width: 120px;
  border-radius: 50%;
  object-fit: contain;
  margin-bottom: 20px;
  background-color: rgba(255,255,255,0.05);
  padding: 10px;
}
.faction-card h3 {
  font-family: var(--font-titulos);
  font-size: 1.5rem;
  color: var(--color-texto-principal);
  margin-bottom: 10px;
}
.faction-card p {
  color: var(--color-texto-secundario);
  line-height: 1.5;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
  border-radius: 8px;
  margin-bottom: 20px;
}
.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* =================================
   GALERÍA DE LA COMUNIDAD
================================== */
.gallery-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}
.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-borde);
  height: 280px;
  background-color: var(--color-fondo);
}
.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease-in-out;
}
.gallery-item:hover .gallery-image {
  transform: scale(1.1);
}
.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  padding: 40px 20px 15px 20px;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}
.gallery-author {
  color: white;
  font-weight: bold;
  font-size: 16px;
  text-align: left;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}
.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* =================================
   SECCIÓN DE NOTICIAS (MEJORADA)
================================== */
/* CAMBIO: Se aplica flexbox al contenedor de noticias para alinear las tarjetas */
#noticias .container {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch; /* Fuerza a todas las tarjetas a tener la misma altura */
    gap: 30px;
}

.news-card {
  background: var(--color-fondo-seccion);
  border-radius: 10px;
  border: 1px solid var(--color-borde);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
  /* CAMBIO: Flex-basis para controlar el tamaño base de las tarjetas */
  flex: 1 1 350px;
}
.news-card:hover {
  transform: translateY(-5px);
  border-color: var(--color-acento-azul);
}
.news-card .image-container {
  height: 200px;
  flex-shrink: 0; /* Evita que la imagen se encoja */
}
.news-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Permite que esta área ocupe el espacio sobrante */
}
.news-date {
  font-size: 14px;
  color: var(--color-texto-secundario);
  margin-bottom: 8px;
  text-align: left;
}
.news-title {
  font-family: var(--font-titulos);
  font-size: 1.5rem;
  color: var(--color-texto-principal);
  margin-bottom: 15px;
  text-align: left;
}
.news-description {
    color: var(--color-texto-secundario);
    text-align: left;
    line-height: 1.6;
    flex-grow: 1; /* Empuja el botón hacia abajo */
}
.news-content .button {
  margin-top: 20px; /* Espacio entre la descripción y el botón */
  width: 100%;
}

/* =================================
   BOTÓN FLOTANTE DE AYUDA
================================== */
.floating-help-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: #5865F2;
  color: white;
  display: flex;
  align-items: center;
  padding: 10px;
  border-radius: 50%;
  text-decoration: none;
  font-weight: bold;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}
.floating-help-button:hover {
  transform: scale(1.1);
  border-radius: 16px;
}
.floating-help-button img {
  width: 32px;
  height: 32px;
}
.floating-help-button span {
  display: none;
  margin-left: 8px;
  font-size: 16px;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.3s ease;
}
.floating-help-button:hover span {
  display: inline;
  max-width: 150px; /* Anima la aparición del texto */
}

/* =================================
   FOOTER
================================== */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  background-color: var(--color-fondo-seccion);
  color: var(--color-texto-secundario);
  border-top: 1px solid var(--color-borde);
}
.footer-logo {
  width: 80px;
  margin-bottom: 15px;
}
.site-footer p {
  margin-bottom: 15px;
}
.social-links a {
  margin: 0 10px;
  display: inline-block;
}
.social-links img {
  width: 32px;
  height: 32px;
  transition: transform 0.3s ease;
}
.social-links img:hover {
  transform: scale(1.2);
}

/* =================================
   PESTAÑAS (TABS) Y TIENDA
================================== */
.tab-buttons {
  overflow: hidden;
  border: 1px solid var(--color-borde);
  background-color: var(--color-fondo);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}
.tab-button {
  background-color: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 20px;
  transition: background-color 0.3s;
  color: var(--color-texto-secundario);
  font-size: 16px;
  font-weight: bold;
}
.tab-button:hover {
  background-color: var(--color-fondo-seccion);
}
.tab-button.active {
  background-color: var(--color-acento-azul);
  color: white;
}
.tab-content {
  display: none;
  padding: 20px;
  border: 1px solid var(--color-borde);
  border-radius: 8px;
  background-color: var(--color-fondo-seccion);
  animation: fadeIn 0.5s;
  text-align: left; /* CAMBIO: Alinea el texto de las tablas a la izquierda */
}
@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}
.tab-content h3, .tab-content h4 {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 15px;
}
.tab-content p {
    text-align: center;
    margin-bottom: 20px;
}
.shop-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--color-texto-principal);
    margin-bottom: 20px;
}
.shop-table th, .shop-table td {
    padding: 12px 15px;
    border: 1px solid var(--color-borde);
}
.shop-table thead {
    background-color: var(--color-fondo);
    font-family: var(--font-titulos);
}
.shop-table tbody tr:nth-child(even) {
    background-color: rgba(0,0,0,0.2);
}
.shop-table tbody tr:hover {
    background-color: var(--color-borde);
}

/* =================================
   MODALS (VENTANAS EMERGENTES)
================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
  animation: fadeIn 0.3s;
}
.modal-content {
  background-color: var(--color-fondo-seccion);
  margin: 10% auto;
  padding: 30px;
  border: 1px solid var(--color-borde);
  width: 90%; /* CAMBIO: Más flexible en móviles */
  max-width: 600px;
  border-radius: 10px;
  position: relative;
  box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}
.modal-content .button {
    margin-top: 25px;
}
.close-button {
  color: var(--color-texto-secundario);
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 35px;
  font-weight: bold;
}
.close-button:hover,
.close-button:focus {
  color: var(--color-texto-principal);
  text-decoration: none;
  cursor: pointer;
}

/* =================================
   DISEÑO RESPONSIVE
================================== */
@media (max-width: 768px) {
  .site-header { padding: 10px 5%; }
  .header-container {
    /* CAMBIO: Logo a la izquierda, botón a la derecha en móviles */
    justify-content: space-between;
  }
  .main-nav { display: none; } /* Oculta el menú de texto */
  .nav-button {
    display: inline-block; /* Asegura que el botón de Discord se vea */
    margin-left: auto; /* Empuja el botón a la derecha */
  }
  .floating-help-button:hover span, .floating-help-button span {
    display: none;
  }
  /* CAMBIO: Reduce el tamaño de los títulos en móviles */
  .section h2 {
    font-size: clamp(1.8rem, 8vw, 2.2rem);
  }
  .tab-buttons {
    flex-direction: column; /* Apila los botones de la tienda */
  }
}

/* =================================
   ESTILOS PARA CONTADOR DE DISCORD
================================== */
.discord-counter {
  background-color: rgba(13, 17, 23, 0.5);
  border: 1px solid var(--color-borde);
  padding: 10px 25px;
  border-radius: 50px;
  margin-top: 20px;
  backdrop-filter: blur(5px);
  margin-bottom: 30px; /* <-- AÑADE ESTA LÍNEA */
}

.discord-counter p {
  font-size: 1rem;
  font-weight: bold;
  color: var(--color-texto-secundario);
  letter-spacing: 1px;
}

.discord-counter #member-count {
  color: #58D68D; /* Un color verde para resaltar */
  font-size: 1.2rem;
  vertical-align: middle;
}


/* =================================
   ESTILOS PARA NOTICIAS DESDE DISCORD
================================== */
#news-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 40px;
}

.news-card-discord {
  background: var(--color-fondo-seccion);
  border: 1px solid var(--color-borde);
  border-radius: 10px;
  display: flex;
  gap: 25px;
  overflow: hidden;
  text-align: left;
  transition: transform 0.3s ease;
}
.news-card-discord:hover {
    transform: scale(1.02);
}

.news-image-discord {
  width: 200px;
  height: 200px;
  object-fit: cover;
  flex-shrink: 0;
}

.news-content-discord {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.news-content-discord h3 {
  font-family: var(--font-titulos);
  font-size: 1.6rem;
  color: var(--color-texto-principal);
  margin-bottom: 10px;
}

.news-content-discord p {
  color: var(--color-texto-secundario);
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .news-card-discord {
    flex-direction: column;
  }
  .news-image-discord {
    width: 100%;
    height: 180px;
  }
}

/* Estilo para el pie de firma en las noticias */
.news-footer {
  display: block;
  margin-top: 20px;
  padding-top: 15px;
  font-size: 0.8rem; /* Letra más pequeña */
  color: var(--color-texto-secundario);
  border-top: 1px solid var(--color-borde); /* Línea separadora sutil */
  opacity: 0.7; /* Un poco más tenue */
}


/* =================================
   ESTILOS PARA SPOILERS DE DISCORD
================================== */
.spoiler {
  background-color: var(--color-fondo); /* Mismo color que el fondo de la tarjeta */
  color: transparent; /* Oculta el texto haciéndolo transparente */
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  user-select: none; /* Evita que se pueda seleccionar el texto oculto */
}

.spoiler:hover {
  background-color: #2c3138; /* Al pasar el mouse, el fondo cambia un poco */
  color: var(--color-texto-principal); /* Muestra el texto */
}


/* =======================================================
   EFECTO FINAL v3: RESPLANDOR DE BORDE EXTERIOR
======================================================= */

/* 1. Asegura que los botones de facciones estén siempre alineados */
.faction-card {
  display: flex;
  flex-direction: column;
}
.faction-content {
  flex-grow: 1;
}
.faction-card .button {
  width: 100%;
  margin-top: auto;
}

/* 2. EFECTO DE RESPLANDOR (GLOW) */

/* Preparamos todas las tarjetas para el efecto */
.card, .faction-card {
  /* La transición se aplica al box-shadow para que el efecto sea suave */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Efecto AZUL para todas las tarjetas al pasar el mouse */
.card:hover, .faction-card:hover {
  border-color: #58a6ff; /* El borde se vuelve azul claro */
  /* La sombra crea el resplandor exterior fino */
  box-shadow: 0 0 12px 0 rgba(47, 129, 247, 0.7);
}

/* Efecto VERDE específico para la tarjeta de Comisaría Virtual */
#comisaria-card:hover {
  border-color: #00ff7f; /* El borde se vuelve verde claro */
  box-shadow: 0 0 12px 0 rgba(0, 255, 127, 0.7); /* Sombra verde */
}


/* =================================
   ESTILO PARA BOTONES DE POSTULACIÓN
================================== */
.button.postular {
  background-color: var(--color-acento-azul);
  color: white;
  border: 2px solid var(--color-acento-azul);
  box-shadow: 0 0 15px 0 rgba(47, 129, 247, 0.4);
  transition: all 0.3s ease;
}

.button.postular:hover {
  background-color: #58a6ff;
  border-color: #58a6ff;
  box-shadow: 0 0 20px 0 rgba(88, 166, 255, 0.6);
  transform: translateY(-3px);
}


/* =======================================================
   SOLUCIÓN PARA EL FOOTER "ROTO" (STICKY FOOTER)
======================================================= */

/* 1. Hacemos que el body sea un contenedor flexible y ocupe toda la pantalla */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Altura mínima: 100% de la altura de la ventana */
}

/* 2. Le decimos a todo el contenido principal que crezca y ocupe el espacio sobrante */
/* Esto "empuja" al footer hacia el fondo */
main, .section, .spacer {
  flex-grow: 1;
}

/* =======================================================
   SOLUCIÓN FINAL PARA STICKY FOOTER
======================================================= */

/* 1. Preparamos el body para que ocupe toda la pantalla */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

/* 2. Hacemos que el contenedor del contenido crezca */
.content-wrap {
  flex: 1 0 auto; /* Esto obliga al contenido a ocupar todo el espacio vertical disponible */
}

/* 3. El footer simplemente se comporta normal */
.site-footer {
  flex-shrink: 0; /* Evita que el footer se encoja */
}
