/* =========================================================
   SPLIT SCREEN INTERACTIVO — LEANDRUS.NET
   ========================================================= */

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

body, html {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0c0e12;
}

/* Contenedor Flexbox a pantalla completa */
.split-container {
  position: relative;
  display: flex;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* Paneles base: cada uno ocupa 1 fracción (50% por defecto) */
.split-panel {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  transition: flex 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  overflow: hidden;
}

/* Asignación de fondos con tus imágenes en la raíz */
.panel-race {
  background-image: url('../img/leandrus_simracer.jpg');
}

.panel-code {
  background-image: url('../img/leandrus_coder.jpg');
}


/* Capa de oscurecimiento para lectura de texto */
.panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(12, 14, 18, 0.45);
  transition: background 0.4s ease;
  z-index: 1;
}

/* =========================================================
   INTERACCIÓN AL PASAR EL RATÓN (HOVER)
   ========================================================= */

/* El lado seleccionado se expande fluidamente */
.split-panel:hover {
  flex: 2.2;
}

/* Aclara la mitad activa */
.split-panel:hover .panel-overlay {
  background: rgba(12, 14, 18, 0.2);
}

/* El lado opuesto se atenúa más */
.split-container:has(.split-panel:hover) .split-panel:not(:hover) .panel-overlay {
  background: rgba(12, 14, 18, 0.75);
}

/* =========================================================
   CONTENIDO DE CADA PANEL
   ========================================================= */
.panel-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #ffffff;
  padding: 2rem;
  max-width: 450px;
  transform: translateY(0);
  transition: transform 0.4s ease;
}

.split-panel:hover .panel-content {
  transform: translateY(-8px);
}

.panel-tag {
  display: inline-block;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.85rem;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.panel-race .panel-tag {
  color: #ff3333;
}

.panel-code .panel-tag {
  color: #38bdf8;
}

.panel-content h1 {
  font-size: 3.5rem;
  letter-spacing: 4px;
  font-weight: 900;
  margin-bottom: 0.5rem;
}

.panel-content p {
  font-size: 1rem;
  color: #e2e8f0;
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

/* Botón interactivo */
.btn-portal {
  display: inline-block;
  padding: 0.6rem 1.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  transition: all 0.3s ease;
}

.panel-race:hover .btn-portal {
  background: #e10600;
  border-color: #e10600;
}

.panel-code:hover .btn-portal {
  background: #0284c7;
  border-color: #0284c7;
}

/* =========================================================
   ELEMENTO CENTRAL: LOGO LEANDRUS
   ========================================================= */
.split-brand {
  position: absolute;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(12, 14, 18, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.4rem 1.2rem;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.split-brand strong {
  font-family: "Consolas", monospace;
  letter-spacing: 3px;
  color: #ffffff;
  font-size: 0.9rem;
}

/* =========================================================
   SELECTOR DE IDIOMA FLOTANTE CON BANDERAS
   ========================================================= */
.lang-switch {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.65rem;
  border-radius: 24px;
  backdrop-filter: blur(8px);
}

.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #8b949e;
  text-decoration: none;
  font-family: var(--font-mono, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.15s;
}

.lang-link:hover {
  opacity: 1;
  color: #ffffff;
  transform: translateY(-1px);
}

.lang-link.active {
  opacity: 1;
  color: #ffffff;
}

.flag-icon {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: outline 0.15s ease;
}

.lang-link.active .flag-icon {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

/* =========================================================
   PIE DE PÁGINA LEGAL FLOTANTE (SPLIT FOOTER)
   ========================================================= */
.split-footer {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(12, 14, 18, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  color: #9aa0a6;
}

.split-footer a {
  color: #c9d1d9;
  text-decoration: none;
  transition: color 0.2s;
}

.split-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.split-footer-sep {
  color: rgba(255, 255, 255, 0.2);
}

.split-footer-links {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.legal-short {
  display: none;
}

.legal-full {
  display: inline;
}

/* =========================================================
   ADAPTACIÓN PARA MÓVILES (PANTALLAS TÁCTILES)
   ========================================================= */
@media (max-width: 768px) {
  body, html {
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .split-container {
    flex-direction: column;
    width: 100%;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  /* Cada panel ocupa exactamente el 50% de la pantalla sin scroll */
  .split-panel {
    flex: 1 1 50% !important;
    height: 50% !important;
    min-height: 0;
  }

  .split-panel:hover {
    flex: 1 1 50% !important;
  }

  .panel-content {
    padding: 0.85rem 1.25rem;
    max-width: 360px;
    transform: none !important;
  }

  .split-panel:hover .panel-content {
    transform: none !important;
  }

  .panel-tag {
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    margin-bottom: 0.35rem;
  }

  .panel-content h1 {
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 0.35rem;
  }

  .panel-content p {
    font-size: 0.84rem;
    line-height: 1.35;
    margin-bottom: 0.85rem;
  }

  .btn-portal {
    padding: 0.45rem 1.15rem;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
  }

  /* Despejes para el selector de idiomas arriba y el footer flotante abajo */
  .panel-race .panel-content {
    padding-top: 1.4rem;
  }

  .panel-code .panel-content {
    padding-bottom: 2.2rem;
  }

  /* Marca central: perfectamente alineada en el centro divisorio (50%) */
  .split-brand {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.3rem 0.9rem;
    border-radius: 16px;
  }

  .split-brand strong {
    font-size: 0.78rem;
    letter-spacing: 2.5px;
  }

  .lang-switch {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.5rem;
    gap: 0.45rem;
  }

  .flag-icon {
    width: 18px;
    height: 13px;
  }

  /* Pie de página flotante compacto en móvil sin alterar el flujo flex */
  .split-footer {
    position: absolute;
    bottom: max(0.5rem, env(safe-area-inset-bottom, 0.5rem));
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 1.5rem);
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.3rem 0.75rem;
    border-radius: 14px;
    font-size: 0.65rem;
    line-height: 1.25;
    background: rgba(12, 14, 18, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    text-align: center;
    pointer-events: auto;
    z-index: 20;
  }

  .split-footer-sep-main {
    display: none;
  }

  .split-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-wrap: wrap;
  }

  .legal-full {
    display: none;
  }

  .legal-short {
    display: inline;
  }
}

/* Pantallas móviles muy bajas (p. ej. teléfonos compactos o barras dinámicas extendidas) */
@media (max-width: 768px) and (max-height: 640px) {
  .panel-content h1 {
    font-size: 1.65rem;
    margin-bottom: 0.2rem;
  }
  .panel-content p {
    font-size: 0.78rem;
    margin-bottom: 0.55rem;
    line-height: 1.25;
  }
  .panel-tag {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }
  .btn-portal {
    padding: 0.35rem 0.95rem;
    font-size: 0.76rem;
  }
  .panel-race .panel-content {
    padding-top: 1rem;
  }
  .panel-code .panel-content {
    padding-bottom: 1.8rem;
  }
  .split-footer {
    bottom: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.62rem;
  }
}
