/* =========================================================
   barra.css — SUNOTI BAR 100% aislado (sin interferencias)
   Todo está scoped a .sunoti-bar / .sunoti-bar__spacer y .sunoti-bar-bottom
   No toca body, html, #feed, .site-header, :root, etc.
   ========================================================= */

/* Variables SOLO dentro de la barra */
.sunoti-bar{
  --sb-blue:#1E90FF;
  --sb-bg: rgba(255,255,255,.96);
  --sb-border: rgba(0,0,0,.10);
  --sb-shadow: 0 10px 24px rgba(0,0,0,.12);
  --sb-h: 64px;
  --sb-radius: 16px;
  --sb-text: rgba(0,0,0,.78);
}

/* Aislar box-sizing sólo dentro del componente */
.sunoti-bar,
.sunoti-bar *{
  box-sizing: border-box;
  
}

/* Barra estática arriba con absolute */
.sunoti-bar{
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  background: var(--sb-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--sb-border);
  box-shadow: none;
  z-index:9999;
}

/* Spacer TOP */
.sunoti-bar__spacer{
  height: calc(var(--sb-h) + 10px);
}

/* Inner base */
.sunoti-bar__inner{
  height: var(--sb-h);
  padding: 10px 12px;
}

/* =========================
   DESKTOP INNER (igual)
   ========================= */
.sunoti-bar__inner--desktop{
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile TOP (nuevo) */
.sunoti-bar__inner--mobileTop{
  display: none; /* se activa en <=800px */
}

/* Brand */
.sunoti-bar__brand{
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sunoti-bar__logo{
  height: 36px;
  width: auto;
  display: block;
}

/* Search (desktop) */
.sunoti-bar__search{
  flex: 1;
  min-width: 160px;
  display: flex;
  align-items: center;
}

/* Clave anti-overflow cuando el contenedor se estrecha */
.sunoti-bar__searchInput{
  min-width: 0;
}

.sunoti-bar__searchForm{
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,.04);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.sunoti-bar__searchInput{
  flex: 1;
  height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0 14px;
  font-size: 16px;
  color: #111;
}

.sunoti-bar__searchForm:focus-within{
  border-color: rgba(30,144,255,.55);
  box-shadow: 0 0 0 4px rgba(30,144,255,.14);
  background: rgba(30,144,255,.06);
}

.sunoti-bar__searchBtn{
  width: 52px;
  height: 44px;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sb-blue);
  color: #fff;
}

/* Acciones (desktop) */
.sunoti-bar__actions{
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botón tipo app */
.sunoti-bar__btn{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  border: 1px solid #fff;
  text-decoration: none;
  user-select: none;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease, border-color .12s ease;
  color: var(--sb-text);
}

.sunoti-bar__btn:hover{
  transform: translateY(-1px);
  background: rgba(30,144,255,.08);
  border-color: rgba(30,144,255,.24);
  color: var(--sb-blue);
}

.sunoti-bar__btn:active{
  transform: translateY(0);
}

/* Botón idioma */
.sunoti-bar__lang{ position: relative; }
.sunoti-bar__btn--lang{ color: var(--sb-blue); }

/* Dropdown */
.sunoti-bar__dropdown{
  display: none;
  position: absolute;
  right: 0;
  top: 54px;
  width: 260px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  overflow: hidden;
  z-index: 60;
}

.sunoti-bar__dropdownTitle{
  padding: 12px 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: rgba(0,0,0,.02);
  color: #111;
}

.sunoti-bar__list{
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.sunoti-bar__item{ margin: 0; padding: 0; }

.sunoti-bar__link{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: #111;
}

.sunoti-bar__link:hover{
  background: rgba(30,144,255,.10);
  color: #0b4ea2;
}

.sunoti-bar__pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(255,255,255,.92);
  color: #111;
}

.sunoti-bar__item.is-active .sunoti-bar__link{
  background: rgba(30,144,255,.12);
}
.sunoti-bar__item.is-active .sunoti-bar__pill{
  border-color: rgba(30,144,255,.45);
  color: var(--sb-blue);
}

/* FIX Font Awesome (Cloudflare JS -> SVG) SOLO dentro de la barra */
.sunoti-bar .sunoti-bar__btn svg,
.sunoti-bar .sunoti-bar__btn i,
.sunoti-bar .sunoti-bar__searchBtn svg,
.sunoti-bar .sunoti-bar__searchBtn i{
  color: currentColor !important;
}

.sunoti-bar .sunoti-bar__btn svg,
.sunoti-bar .sunoti-bar__searchBtn svg{
  fill: currentColor !important;
}
.sunoti-bar .sunoti-bar__btn svg path,
.sunoti-bar .sunoti-bar__searchBtn svg path{
  fill: currentColor !important;
}

/* En buscar, siempre blanco */
.sunoti-bar .sunoti-bar__searchBtn{
  color: #fff !important;
}

/* =========================================================
   MOBILE TOP BAR (<=800px)
   ========================================================= */
@media (max-width: 800px){
  .sunoti-bar{ --sb-h: 60px; }

  /* Mostrar mobile TOP, ocultar desktop */
  .sunoti-bar__inner--desktop{ display: none; }
  .sunoti-bar__inner--mobileTop{
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--sb-h);
    padding: 10px 10px;
  }

  /* Logo izquierda */
  .sunoti-bar__brand--mobileTop{
    flex: 0 0 auto;
  }
  .sunoti-bar__logo--mobileTop{
    height: 28px;
    width: auto;
    display: block;
    border-radius: 5px;
  }

  /* Search abierto ocupa todo el medio */
  .sunoti-bar__search--mobileTop{
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Ajuste compacto mobile */
  .sunoti-bar__searchForm--mobileTop{
    height: 42px;
  }
  .sunoti-bar__searchForm--mobileTop .sunoti-bar__searchInput{
    height: 42px;
    font-size: 15px;
  }
  .sunoti-bar__searchForm--mobileTop .sunoti-bar__searchBtn{
    width: 48px;
    height: 42px;
  }

  /* Botón idioma derecha (sin huecos) */
  .sunoti-bar__lang--mobileTop{
    flex: 0 0 auto;
  }

  /* Dropdown en mobile: mantener dentro y por encima */
  .sunoti-bar__lang--mobileTop .sunoti-bar__dropdown{
    top: 54px;
    right: 0;
  }

  .sunoti-bar__spacer{ height: calc(var(--sb-h) + 10px); }
}

@media (max-width: 420px){
  .sunoti-bar__inner--mobileTop{
    gap: 8px;
    padding: 10px 8px;
  }
  .sunoti-bar__logo--mobileTop{
    height: 26px;
  }
}

/* =========================================================
   FIX: evitar superposición con la admin bar (solo admin)
   ========================================================= */
.admin-bar .sunoti-bar{
  top: 32px !important;
}
.admin-bar .sunoti-bar__spacer{
  height: calc(var(--sb-h) + 10px + 32px) !important;
}

@media (max-width: 782px){
  .admin-bar .sunoti-bar{
    top: 46px !important;
  }
  .admin-bar .sunoti-bar__spacer{
    height: calc(var(--sb-h) + 10px + 46px) !important;
  }
}

/* =========================================================
   SUNOTI BAR — 3 estados (TOP BAR):
   - TOP: absolute (default)
   - UP:  fixed (clase .sunoti-bar--fixed)
   - DOWN: hidden (clase .sunoti-bar--hidden)
   ========================================================= */
.admin-bar .sunoti-bar{ --sb-adminTop: 32px; }
@media (max-width: 782px){
  .admin-bar .sunoti-bar{ --sb-adminTop: 46px; }
}

.sunoti-bar{
  top: var(--sb-adminTop, 0px);
  transition: transform .18s ease, opacity .18s ease;
  will-change: transform;
}

.sunoti-bar.sunoti-bar--fixed{
  position: fixed !important;
  top: var(--sb-adminTop, 0px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
}

.sunoti-bar.sunoti-bar--hidden{
  transform: translateY(-120%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Animación más suave y sin parpadeos */
.sunoti-bar{
  transition: transform .28s ease, opacity .28s ease !important;
  transform: translateZ(0);
}
.sunoti-bar.sunoti-bar--fixed{
  transition: transform .28s ease, opacity .28s ease !important;
}
.sunoti-bar.sunoti-bar--hidden{
  transform: translate3d(0,-120%,0) !important;
  opacity: 0 !important;
}

/* =========================================================
   SUNOTI BAR BOTTOM (MOBILE, siempre visible)
   ========================================================= */

.sunoti-bar-bottom{
  --sbb-blue:#1E90FF;
  --sbb-bg: rgba(255,255,255,.96);
  --sbb-border: rgba(0,0,0,.10);
  --sbb-shadow: 0 10px 24px rgba(0,0,0,.12);
  --sbb-text: rgba(0,0,0,.78);
  --sbb-h: 62px;

  display: none; /* solo mobile */
}

.sunoti-bar-bottom,
.sunoti-bar-bottom *{
  box-sizing: border-box;
}

@media (max-width: 800px){
  .sunoti-bar-bottom{
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    background: var(--sbb-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--sbb-border);
    box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sunoti-bar-bottom__inner{
    height: var(--sbb-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0; /* SIN espacios vacíos */
    padding: 8px 8px;
  }

  .sunoti-bar-bottom__btn{
    flex: 1 1 0;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    user-select: none;

    border-radius: 14px;
    background: rgba(255,255,255,.92);
    border: 1px solid #fff;
    color: var(--sbb-text);

    transition: transform .12s ease, background .12s ease, border-color .12s ease;
  }

  .sunoti-bar-bottom__btn:hover{
    transform: translateY(-1px);
    background: rgba(30,144,255,.08);
    border-color: rgba(30,144,255,.24);
    color: var(--sbb-blue);
  }

  .sunoti-bar-bottom__btn:active{
    transform: translateY(0);
  }

  /* FIX Font Awesome dentro de bottom */
  .sunoti-bar-bottom .sunoti-bar-bottom__btn svg,
  .sunoti-bar-bottom .sunoti-bar-bottom__btn i{
    color: currentColor !important;
  }
  .sunoti-bar-bottom .sunoti-bar-bottom__btn svg{
    fill: currentColor !important;
  }
  .sunoti-bar-bottom .sunoti-bar-bottom__btn svg path{
    fill: currentColor !important;
  }
}


/* =========================================================
   BOTON CREAR BIOGRAFIA (aislado y pegado al idioma)
   ========================================================= */
.sunoti-bar__createLangGroup{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sunoti-bar__createBtn,
.sunoti-bar__createBtn:link,
.sunoti-bar__createBtn:visited{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  background: #4CAF51;
  border: 0;
  box-shadow: none;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sunoti-bar__createBtn:hover,
.sunoti-bar__createBtn:focus,
.sunoti-bar__createBtn:focus-visible,
.sunoti-bar__createBtn:visited:hover{
  background: #4CAF51;
  border: 0;
  box-shadow: none;
  color: #fff;
  transform: none;
  outline: none;
}

.sunoti-bar__createBtn:active,
.sunoti-bar__createBtn:visited:active{
  background: #3f9843;
  color: #fff;
  transform: none;
}

.sunoti-bar .sunoti-bar__createBtn svg,
.sunoti-bar .sunoti-bar__createBtn i{
  color: currentColor !important;
}

.sunoti-bar .sunoti-bar__createBtn svg{
  fill: currentColor !important;
}

.sunoti-bar .sunoti-bar__createBtn svg path{
  fill: currentColor !important;
}

@media (max-width: 800px){
  .sunoti-bar__createLangGroup--mobileTop{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .sunoti-bar__createBtn--mobileTop{
    padding: 0 12px;
    font-size: 13px;
    max-width: 190px;
  }
}

@media (max-width: 520px){
  .sunoti-bar__createBtn--mobileTop{
    padding: 0 10px;
    font-size: 12px;
    max-width: none;
    white-space: nowrap;
  }
}


/* =========================================================
   STREAMS EN VIVO — botón rojo con punto REC y pulso
   ========================================================= */
.sunoti-bar__btn--streams,
.sunoti-bar-bottom__btn--streams{
  background: rgba(255,255,255,.92) !important;
  border-color: #fff !important;
  color: #e11919 !important;
}

.sunoti-bar__btn--streams:hover,
.sunoti-bar__btn--streams:focus,
.sunoti-bar-bottom__btn--streams:hover,
.sunoti-bar-bottom__btn--streams:focus{
  background: rgba(225,25,25,.08) !important;
  border-color: rgba(225,25,25,.24) !important;
  color: #c91515 !important;
}

.sunoti-live-dot,
.sunoti-live-dot--bottom{
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e11919;
  box-shadow: 0 0 0 0 rgba(225,25,25,.45);
}

.sunoti-live-dot::after,
.sunoti-live-dot--bottom::after{
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(225,25,25,.55);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  animation: sunoti-live-ping 1.6s ease-out infinite;
}

@keyframes sunoti-live-ping{
  0%{
    transform: translate(-50%, -50%) scale(0.95);
    opacity: 0;
  }
  18%{
    opacity: .85;
  }
  70%{
    opacity: .22;
  }
  100%{
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}
