/* Only truly global modules — page-specific CSS is loaded via head_links.php */
@import url('minimal-table.css');
@import url('navegador.css');
@import url('index.css');
@import url('footer.css');
@import url('breadcrumb.css');

/* Estilos generales */
body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: -40%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url('/public/images/logo_fondo.png');
  background-size: contain;
  /* o 'cover' si prefieres que rellene todo aunque recorte */
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: var(--link-color);
  font-weight: bold;
}

/* Encabezado Premium con Glassmorphism */
header {
  background-color: rgba(33, 33, 33, 0.85);
  /* var(--header-bg) pero con transparencia para glassmorphism */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  padding: 1vh 0;
  margin-bottom: 2vh;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

/* Títulos - Unified Hierarchy */
h1,
.titulo {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 0.5em;
  margin-top: 0;
  line-height: 1.1;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

h2,
.subtitulo {
  font-size: clamp(1.4rem, 3.2vw, 2.2rem);
  font-weight: 800;
  margin-top: 0em;
  margin-bottom: 0em;
  line-height: 1.2;
  color: #ff8a00;
  /* Accent color for secondary titles */
}

h3,
.titulo_tres {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-weight: 700;
  margin-top: 1.25em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h4 {
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 700;
  margin-top: 1em;
  margin-bottom: 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.linea {
  border: none;
  border-top: 1px solid #ccc;
  margin: 2vw 0 1vw;
}

/* Variables de color */
:root {
  --bg-color: #212121e6;
  --text-color: #f0f0f0;
  --header-bg: #212121;
  --footer-bg: #212121e6;
  --link-color: #ffffff;
  --accent-color: #d94f5c;
  --color-green: #00a878;
  --color-red: #ff2600;
  --color-button: #fdffff;
  --color-black: #000;
  --search-hover-color: #f0f0f0;
}

.search-and-alphabet {
  display: flex;
  justify-content: space-between;
  /* Divide el espacio entre el buscador y las letras */
  align-items: center;
  /* Alinea verticalmente el buscador y las letras */
}

.search-container {
  width: 100%;
  /* Ajusta el ancho del buscador */
  height: 100%;
}

.search-container input {
  width: 95%;
  /* Asegura que el buscador ocupe el 100% del espacio disponible en su contenedor */
  font-size: 1.1vw;
  border-radius: 0.5vw;
  padding: 10px 15px 10px 15px;
  outline: none;
  border: none;
  background-color: var(--footer-bg);
  color: var(--text-color);
  font-weight: 550;
  transition: 0.3s ease-in-out;
  box-shadow: 0 0 0 5px transparent;
}

.search-container input:hover,
.search-container input:focus {
  box-shadow: 0 0 0 2px var(--search-hover-color);
}

.search-container span {
  position: absolute;
  left: 0;
  top: 0;
  padding: 13px 15px;
  color: #333;
  font-size: 16px;
  font-weight: 600;
  text-shadow: -1px -1px 0 #f1f1f1, 1px -1px 0 #f1f1f1, -1px 1px 0 #f1f1f1,
    1px 1px 0 #f1f1f1;
  transition: 0.3s ease-in-out;
  pointer-events: none;
}

.search-container input:focus+span,
.search-container input:valid+span {
  transform: translateY(-12px) translateX(-5px) scale(0.95);
  transition: 0.3s ease-in-out;
}

.alphabet-nav {
  text-align: right;
  /* Alinea las letras a la derecha */
}

.alphabet-nav a {
  margin: 0 0.5vw;
  /* Mantiene el espacio entre las letras */
  font-size: 1.5vw;
  cursor: pointer;
}

/* Letra activa en la navegación del abecedario */
.alphabet-nav a.active-letter {
  text-decoration: underline;
  font-weight: bold;
}

/* Tablas */
.team-table,
.player-table {
  font-size: 1vw;
  width: 100%;
}

/* Contenedor */
.container {
  margin: 0 5%;
}

/* Texto justificado premium */
.justificado,
.seo-intro {
  text-align: justify;
  text-justify: inter-word;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  margin-top: 0;
  margin-bottom: 1.5rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.justificado_dos {
  /* Unifying with global standard */
  text-align: justify;
  text-justify: inter-word;
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  line-height: 1.7;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

br {
  margin-bottom: -10px;
  /* espacio después del salto de línea */
}

ul .justificado {
  margin-bottom: 0.5rem;
  /* Reduce el espacio entre elementos */
  line-height: 1.4;
  /* Compacta el texto un poco más */
}

.lista-propuesta {
  margin-left: 2%;
  padding-left: 1rem;
}

/* Responsividad */
@media (max-width: 768px) {

  /* Headings already handled by clamp(), but we fine-tune spacing */
  h1,
  .titulo {
    margin-bottom: 0.8rem;
  }

  h2,
  .subtitulo {
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
  }

  h3,
  .titulo_tres {
    margin-top: 1rem;
  }

  footer {
    font-size: 3.5vw;
    padding: 1.5vh 5vw;
  }

  .search-and-alphabet {
    margin-top: -15px;
    margin-bottom: 10px;
  }

  #search-input {
    padding: 0.75vw;
    font-size: 2vw;
  }

  .alphabet-nav a {
    margin: 0 0.5vw;
    /* Mantiene el espacio entre las letras */
    font-size: 1.5vw;
  }

  .lista-propuesta {
    margin-left: 1%;
    margin-top: 0;
  }
}

@media (max-width: 480px) {

  /* Ajustes para el texto justificado en pantallas pequeñas */
  .justificado,
  .justificado_dos,
  .seo-intro {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.2rem;
  }

  h1,
  .titulo {
    font-size: 1.5rem;
  }

  h2,
  .subtitulo {
    font-size: 1.25rem;
  }

  h3,
  .titulo_tres {
    font-size: 1.1rem;
  }

  h4 {
    font-size: 1rem;
  }

  ul .justificado {
    margin-bottom: 0.2vw;
    /* Reduce el espacio entre elementos */
    line-height: 1.4;
    /* Compacta el texto un poco más */
  }
}

/* Estilo específico para iPad y tablets */
@media (min-width: 769px) and (max-width: 1024px) {
  .titulo {
    font-size: 5vw;
    /* Menor que móvil, mayor que escritorio */
    margin: 1vh 5vw;
    /* Espaciado elegante */
  }
}

/* Tema claro: redefine variables */
body.light-mode {
  --bg-color: #f8f9fa;
  --text-color: #2b2b2b;
  --header-bg: #ffffff;
  --footer-bg: #ffffff;
  --link-color: #2b2b2b;
  --search-hover-color: #333;
}

body.light-mode header {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}