/* Base */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0a0f1a;
  color: #fff;
}

/* Canvas del globo */
#globeCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 0;
}

/* Selector de idioma (si lo usas) */
#language-selector {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
}
#language-selector select {
  background: rgba(0,0,0,.65);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
  font-size: .95rem;
}

/* Tooltip */
#tooltip {
  position: absolute;
  z-index: 40;
  display: none;
  max-width: 240px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,.75);
  color: #fff;
  font-size: 14px;
  pointer-events: none;
  -webkit-font-smoothing: antialiased;
}

/* ===== Modal de idiomas (España) ===== */
/* Suaviza la desaparición */
/* Mantén la transición si quieres */
#homeBtn, .home-btn {
  transition: opacity .2s ease, transform .2s ease;
  will-change: opacity, transform;
  transform: translateZ(0);
}

/* Fase de desvanecido (animación) */
#homeBtn.hide-home,
.home-btn.hide-home {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none; /* no clics durante fade-out */
}

/* Después del fade-out, oculto de verdad */
#homeBtn.invisible,
.home-btn.invisible {
  visibility: hidden;
}



/* Botón flotante (lupa) */
.lang-fab-btn {
  position: fixed;
  top: 16px;            /* lejos del botón de inicio (que está a la izquierda) */
  right: 16px;
  z-index: 10001;       /* por encima del homeBtn (10k) y del canvas */
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: #141922cc;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, opacity .18s ease, background .12s ease, border-color .12s ease;
}
.lang-fab-btn:hover { 
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.28);
  background: #1a2030cc;
}
.lang-fab-btn:active { transform: translateY(0); }

body.not-scrollable {
  overflow-y: hidden;
  height: 100vh;
}





/* Tema claro (si lo usas) */
body.theme-light .lang-fab-btn {
  background: #f2f2f2cc;
  color: #000;
  border-color: rgba(0,0,0,.2);
}
body.theme-light .lang-fab-btn:hover {
  background: #fff;
  border-color: rgba(0,0,0,.35);
}

/* En móvil, un pelín más grande para ser “tappable” */
@media (max-width: 768px) {
  .lang-fab-btn { width: 48px; height: 48px; }
}

/* Animaciones suaves para el modal existente */
.body-lang-blurred-modal { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.body-lang-blurred-modal.lang-modal-active { opacity: 1; pointer-events: auto; }



/* Cuando el modal está abierto: bloquea scroll e interacción del globo */
body.modal-open { overflow: hidden; }
body.modal-open #globeCanvas { pointer-events: none; }
/* El primer botón del grid ocupa toda la fila */
.modal .grid > .btn-lang:first-child {
  grid-column: 1 / -1;
}

/* Overlay con blur */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hidden { display: none; }

/* Caja del modal en B/N elegante */
.modal {
  position: relative;
  width: min(760px, 92vw);
  padding: 24px 22px 20px;
  border-radius: 18px;
  background: #0c0f14;
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}

.modal h2 {
  margin: 0 42px 18px 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .2px;
}

/* Grid de botones */
.modal .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Botones de idioma */
.btn-lang {
  appearance: none;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: #141922;
  color: #fff;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.btn-lang:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.28);
  background: #1a2030;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.btn-lang:active {
  transform: translateY(0);
}

/* Botón cerrar */
.btn-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14);
  background: #141922;
  color: #fff;
  font-size: 20px;
  line-height: 34px;
  text-align: center;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn-close:hover {
  background: #1a2030;
  border-color: rgba(255,255,255,.28);
}
/* === Modal lista de idiomas (contenedor y panel) === */
.body-lang-blurred-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;                /* siempre en flujo; apertura por opacidad */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.9);
}

.body-lang-blurred-modal.lang-modal-active .langs-list {
  animation: showLangsModal 0.5s ease-out forwards;
}
.body-lang-blurred-modal .langs-list.closing-langs-list {
  animation: showLangsModalInverted .5s forwards;
}

.body-lang-blurred-modal .langs-list {
  position: relative;
  width: 60vw;
  max-height: 400px;
  overflow-y: auto !important; 
  padding: 10px 25px 20px;
  border: 1px solid #ccc;
  border-radius: 20px;
  background: #000;
  box-shadow:
    inset 0 0 6px 2px rgba(255,255,255,.05),
    0 2px 6px rgba(255,255,255,.04),
    0 0 8px 2px rgba(255,255,255,.04),
    0 0 12px 3px rgba(255,255,255,.03);
  transition: box-shadow .5s ease, width .15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.body-lang-blurred-modal .langs-list:hover {
  box-shadow:
    inset 0 0 10px 3px rgba(255,255,255,.07),
    0 4px 12px rgba(255,255,255,.05),
    0 0 10px 3px rgba(255,255,255,.05),
    0 0 20px 5px rgba(255,255,255,.06);
}

.body-lang-blurred-modal .langs-list .langs-list-flex {
  width: 100%;
  padding: 0 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Cierre (X) */
div.body-lang-blurred-modal div.langs-list {
    max-height: 400px;
    position: relative;
    width: 60vw;
    overflow-x: hidden;
    margin: 0;
    padding: 10px 25px 20px;
    border: 1px solid #cccccc; 
    border-radius: 20px;
    background-color: #000000;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    gap: 5px;
    box-shadow:
    inset 0 0 6px 2px rgba(255, 255, 255, 0.05),   /* brillo interior muy suave */
    0 2px 6px rgba(255, 255, 255, 0.04),           /* sombra exterior ligera */
    0 0 8px 2px rgba(255, 255, 255, 0.04),         /* resplandor medio fino */
    0 0 12px 3px rgba(255, 255, 255, 0.03);        /* halo exterior muy sutil */


    transition: box-shadow 0.5s ease, width .15s ease;
}
div.body-lang-blurred-modal div.langs-list div.close-langs-container {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    text-wrap: wrap;
}

div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    cursor: pointer;
    transition: background-color .3s ease, transform .2s ease;
    width: 32px;                  /* ⇦ ancho fijo */
    height: 32px;                 /* ⇦ alto igual al ancho */
    display: flex;
    justify-content: center;      /* ⇦ centra horizontalmente */
    align-items: center;          /* ⇦ centra verticalmente */
    border: 1px solid #5C5C5C;
    background-color: #121212;
    border-radius: 50%;
    box-sizing: border-box;
}

div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn .fa-xmark {
    transition: transform .3s ease;
    font-size: 16px;              /* ⇦ tamaño ajustado */
    color: #fff;
}

div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn:hover .fa-xmark {
    transform: rotate(90deg);
}


/* Título + buscador */
div.body-lang-blurred-modal div.langs-list div.langs-modal-title-container {
  width: 100%;
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,.5);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  justify-content: center;
}
div.body-lang-blurred-modal div.langs-list div.langs-modal-title-container h2 {
  margin: 0;
  text-align: center;
  color: #fff;
  font-size: 25px;
  font-weight: 700;
  text-transform: uppercase;
}

#searchLang {
  width: 100%;
  box-sizing: border-box;   /* 👈 evita que se salga del contenedor */
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.35);
  color: #eee;
  border-radius: 10px;
  outline: none;
  transition: box-shadow .2s ease, border-color .2s ease;
}
#searchLang::placeholder { color: #aaa; }
#searchLang:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}


/* Evita clic en ocultos por filtro */
#langsList .lang-link[style*="display: none"] { pointer-events: none; }

/* Fila de idioma */
#langsList .lang-link {
  text-decoration: none;
  width: 100%;
}
#langsList .lang-option {
  box-sizing: border-box; /* hace que el padding se incluya dentro del ancho */
  width: 100%;
  padding: 10px 15px;
  border-radius: 10px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  cursor: pointer;
  transition: background-color .3s ease;
}
#langsList .lang-option.lang-link-active { background: #636363; }
#langsList .lang-option:hover:not(.lang-link-active) { background: #333; }

#langsList .left-lang-option-side {
  width: 50%;
  padding: 5px 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
}
#langsList .left-lang-option-side .lang-option-label { color: #fff; font-size: 15px; }
#langsList .left-lang-option-side .country-option-label { color: #fff; font-size: 13px; text-transform: uppercase; opacity: .7; }

#langsList .right-lang-option-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
#langsList .flag-img-container {
  position: relative;
  width: 70px;
  height: 40px;
  overflow: hidden;
  border-radius: 1px;
}
#langsList .right-lang-option-side img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
#langsList .lang-label-modal-img {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .5s ease-in-out;
}
/* Scrollbar solo del modal de idiomas */
.body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar {
  width: 8px;
}
.body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar-track {
  background: transparent;
}
.body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar-thumb {
  background-color: rgba(255,255,255,0.25);
  border-radius: 4px;
}
.body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255,255,255,0.4);
}

/* Variante para modo claro */
body.theme-light .body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.45);
}
body.theme-light .body-lang-blurred-modal .langs-list .langs-list-flex::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0,0,0,0.6);
}


/* === Theme light del modal lista === */
body.theme-light .body-lang-blurred-modal { background: rgba(255,255,255,.9); }
body.theme-light .body-lang-blurred-modal .langs-list {
  background: #fff;
  border: 1px solid #000;
  box-shadow:
    inset 0 0 6px 2px rgba(0,0,0,.05),
    0 2px 6px rgba(0,0,0,.06),
    0 0 8px 2px rgba(0,0,0,.05),
    0 0 12px 3px rgba(0,0,0,.04);
}
body.theme-light .body-lang-blurred-modal .langs-list:hover {
  box-shadow:
    inset 0 0 10px 3px rgba(0,0,0,.07),
    0 4px 12px rgba(0,0,0,.08),
    0 0 10px 3px rgba(0,0,0,.06),
    0 0 20px 5px rgba(0,0,0,.07);
}
body.theme-light .body-lang-blurred-modal .langs-modal-title-container { border-bottom: 1px solid rgba(0,0,0,.5); }
body.theme-light .body-lang-blurred-modal .langs-modal-title-container h2 { color: #000; }

body.theme-light #searchLang {
  background: #fff; color: #000; border: 1px solid rgba(0,0,0,.25);
}
body.theme-light #searchLang::placeholder { color: #555; }
body.theme-light #searchLang:focus { border-color: #000; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }

body.theme-light #langsList .left-lang-option-side .lang-option-label,
body.theme-light #langsList .left-lang-option-side .country-option-label { color: #000; }
body.theme-light #langsList .left-lang-option-side .country-option-label { opacity: .7; }

body.theme-light #langsList .flag-img-container { box-shadow: 0 2px 6px rgba(0,0,0,.25); }
body.theme-light #langsList .lang-label-modal-img { background: rgba(255,255,255,.55); color: #000; }

body.theme-light .body-lang-blurred-modal .close-lang-modal-btn {
  background: #f2f2f2; border: 1px solid #000;
}
body.theme-light .body-lang-blurred-modal .close-lang-modal-btn .fa-xmark { color: #000; }



/* <= 520px: full-width, centrado vertical, con margen superior/inferior */
@media (max-width: 520px){
  /* El overlay centra verticalmente */
  .body-lang-blurred-modal{
    align-items: center !important;   /* centra vertical */
    justify-content: center !important;
    padding: 0 !important;
  }

  /* Panel a todo el ancho, pero con altura limitada y esquinas redondeadas */
  .body-lang-blurred-modal .langs-list{
    width: 100vw !important;          /* pegado a los laterales */
    max-width: none !important;
    max-height: 88vh;                 /* deja aire arriba/abajo */
    margin: 0 !important;
    border-radius: 18px;              /* como en tu captura */
    border-left: 0;
    border-right: 0;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;                 /* el scroll va dentro */
  }

  /* La lista ocupa el espacio restante y hace scroll */
  .body-lang-blurred-modal .langs-list .langs-list-flex{
    flex: 1 1 auto;
    height: 62vh;                     /* altura visible del listado */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-top: 6px;
  }

  /* Ajustes finos */
  div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn{
    right: 10px;
    top: 10px;
  }
  #searchLang{ width: 100%; }
}

/* <= 380px: aún más compacto */
@media (max-width: 380px){
  .body-lang-blurred-modal .langs-list{
    padding-left: 10px;
    padding-right: 10px;
    border-radius: 16px;
  }
  #langsList .lang-option{ padding: 9px 10px; gap: 10px; }
  #langsList .flag-img-container{ width: 48px; height: 28px; }
}

/* Cuando se pega a los laterales (<=520px): reducir a 21x21 */
@media (max-width: 520px){
  div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn{
    width: 21px;
    height: 21px;
  }
  div.body-lang-blurred-modal div.langs-list button.close-lang-modal-btn .fa-xmark{
    font-size: 11px;  /* ajusta si la ves grande/pequeña */
  }
}

/* <=520px: baja el título y deja hueco para la X */
@media (max-width: 520px){
  /* un poco más de aire arriba en el panel */
  div.body-lang-blurred-modal div.langs-list{
    padding-top: 18px;
  }

  /* el título ocupa todo y se alinea al centro */
  div.body-lang-blurred-modal div.langs-list div.langs-modal-title-container h2{
    width: 100%;
    padding-top: 12px;
    text-align: center;
  }
  /* Contenedor scrolleable: menos padding lateral y cero margen extra */
  .body-lang-blurred-modal .langs-list .langs-list-flex{
    margin: 2px 0 0 0;      /* baja un poco el bloque */
    padding: 0 6px 3px;    /* quita aire al fondo */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}
@media (max-width: 520px){
  .body-lang-blurred-modal .langs-list,
  div.body-lang-blurred-modal div.langs-list{
    padding: 8px 15px 8px !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
  }
}


/* Animaciones del modal (pueden ir al final del archivo) */
@keyframes showLangsModal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes showLangsModalInverted {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-10px); }
}
