/* ============================================================
   GP – Gamer Profession | Navegación estilo Instagram
   Componente compartido: navbar superior (desktop) + barra
   inferior de pestañas (móvil), pensado para reemplazar el
   navbar/sidebar de cada página sin tocar su contenido interno.
   Se apoya en las variables ya definidas en design-system.css.
   ============================================================ */

/* ── Topbar (desktop) ─────────────────────────────────────── */
.ig-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  z-index: 500;
  background: rgba(0,0,0,0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border, #1a1a2e);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 18px;
}

.ig-logo {
  font-family: var(--display, 'Syne', sans-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
  background: var(--grad-gp-text, linear-gradient(135deg,#8B5CF6,#00D4FF));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ig-search-wrap { flex: 1; max-width: 360px; }

.ig-search {
  width: 100%;
  background: var(--surface, #08080f);
  border: 1px solid var(--border, #1a1a2e);
  border-radius: 20px;
  padding: 8px 14px 8px 34px;
  color: var(--t1, #F0F0FF);
  font-family: var(--ui, 'Rajdhani', sans-serif);
  font-size: 13px;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2350507A' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  transition: border-color 0.15s;
}
.ig-search:focus { border-color: var(--purple, #8B5CF6); }

.ig-icons {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ig-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  text-decoration: none;
  color: var(--t1, #F0F0FF);
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}
.ig-icon-btn:hover { background: var(--elevated, #0d0d18); }
.ig-icon-btn.ig-active { color: var(--cyan, #00D4FF); }
.ig-icon-btn svg { width: 21px; height: 21px; display: block; }
/* Brillo morado — llama la atención hacia /gol-semana, mismo patrón de
   "ondas" que el botón flotante de WhatsApp (gp-wa-pulse) pero en
   morado de marca. Se apaga en estado disabled (pre-lanzamiento) para
   no invitar a tocar algo que todavía rebota. */
.ig-icon-btn.ig-glow-purple {
  animation: ig-gs-pulse 2.2s ease-out infinite;
}
.ig-icon-btn.ig-glow-purple.ig-disabled {
  animation: none;
}
@keyframes ig-gs-pulse {
  0% { box-shadow: 0 0 0 0 rgba(139,92,246,0.55); }
  70% { box-shadow: 0 0 0 14px rgba(139,92,246,0); }
  100% { box-shadow: 0 0 0 0 rgba(139,92,246,0); }
}
.ig-more-btn svg { width: 19px; height: 19px; display: block; }

.ig-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 15px; height: 15px;
  padding: 0 3px;
  background: var(--red, #FF3D57);
  border-radius: 999px;
  font-family: var(--mono, monospace);
  font-size: 9px;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #000;
}

.ig-wallet-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--purple-faint, rgba(139,92,246,0.07));
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 999px;
  padding: 5px 14px 5px 10px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--purple-lt, #A78BFA);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
}
.ig-wallet-pill:hover { background: var(--purple-glow, rgba(139,92,246,0.2)); }
.ig-wallet-dot { width: 7px; height: 7px; background: var(--purple, #8B5CF6); border-radius: 50%; flex-shrink: 0; }
.ig-wallet-pill.ig-active { border-color: var(--cyan, #00D4FF); background: rgba(0,212,255,0.1); color: var(--cyan, #00D4FF); }
.ig-wallet-pill.ig-active .ig-wallet-dot { background: var(--cyan, #00D4FF); }

.ig-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--t1, #F0F0FF);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ig-avatar:hover { background: var(--elevated, #0d0d18); }
.ig-avatar svg { width: 21px; height: 21px; display: block; }
.ig-avatar.ig-active { color: var(--cyan, #00D4FF); }

.ig-more-wrap { position: relative; }

.ig-more-menu {
  position: absolute;
  top: 48px; right: 0;
  min-width: 220px;
  background: var(--surface, #08080f);
  border: 1px solid var(--border, #1a1a2e);
  border-radius: 14px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 600;
}
.ig-more-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: var(--ui, 'Rajdhani', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--t2, #9090B8);
  text-decoration: none;
  transition: all 0.15s;
}
.ig-more-menu a:hover { background: var(--elevated, #0d0d18); color: var(--t1, #F0F0FF); }
.ig-more-menu a.ig-more-current { color: var(--cyan, #00D4FF); background: rgba(0,212,255,0.08); font-weight: 700; }
.ig-more-ic { display: inline-flex; width: 17px; height: 17px; flex-shrink: 0; }
.ig-more-ic svg { width: 100%; height: 100%; }

/* ── Bottombar (móvil, estilo app Instagram) ─────────────── */
.ig-bottombar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 56px;
  z-index: 500;
  background: rgba(0,0,0,0.96);
  border-top: 1px solid var(--border, #1a1a2e);
  align-items: center;
  justify-content: space-around;
}
.ig-bb-item {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  position: relative;
  text-decoration: none;
  color: var(--t2, #9090B8);
  font-size: 22px;
}
.ig-bb-item.ig-active { color: var(--cyan, #00D4FF); }
.ig-bb-avatar-wrap .ig-avatar-sm { width: 26px; height: 26px; }
.ig-bb-ic { display: inline-flex; }
.ig-bb-ic svg { width: 24px; height: 24px; }
.ig-bb-wallet { flex-direction: column; gap: 1px; }
.ig-bb-wallet .ig-bb-ic svg { width: 20px; height: 20px; }
.ig-bb-wallet-txt { font-family: var(--mono, monospace); font-size: 9px; font-weight: 700; color: inherit; }

/* ── Ajuste de contenido: compensar la barra inferior en móvil ──
   El topbar nuevo ocupa el mismo espacio que el navbar viejo que
   reemplaza (misma altura, mismo lugar fijo/reservado), así que no
   hace falta padding-top adicional. La bottom bar sí es nueva, así
   que en móvil se reserva espacio abajo para que no tape contenido. */
@media (max-width: 860px) {
  .ig-nav-active { padding-bottom: 56px; }
}

/* En desktop, ocultar barra inferior; en móvil, simplificar topbar */
@media (max-width: 860px) {
  .ig-bottombar { display: flex; }
  .ig-search-wrap { display: none; }
  /* El wallet ya se ve completo (ícono + monto) en la barra inferior,
     así que en el topbar móvil se oculta del todo en vez de mostrar
     sólo el puntito morado sin el monto (confuso). */
  .ig-wallet-pill { display: none; }
  .ig-icons .ig-icon-btn[data-path="/feed"],
  .ig-icons .ig-icon-btn[data-path="/clips"],
  .ig-icons .ig-icon-btn[data-path="/config-reto"] { display: none; }
  /* /gol-semana NO se oculta acá a propósito: a diferencia de /feed y
     /clips, no tiene un equivalente en la bottombar — si se ocultara
     también del topbar móvil, quedaría sin ninguna forma de llegar ahí
     desde la navegación en mobile. */
}

/* ── Panel de notificaciones (compartido, cualquier página) ── */
.ig-notif-panel {
  position: fixed;
  top: 64px; right: 16px;
  width: 340px; max-width: calc(100vw - 24px);
  max-height: 70vh;
  background: var(--surface, #08080f);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(139,92,246,0.05);
  z-index: 900;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.ig-notif-panel.open { display: flex; }
.ig-notif-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border, #1a1a2e); flex-shrink: 0;
}
.ig-notif-panel-title { font-family: var(--display, 'Syne', sans-serif); font-size: 14px; font-weight: 700; color: var(--t1, #F0F0FF); }
.ig-notif-leer-todas {
  background: none; border: none; cursor: pointer;
  font-family: var(--mono, monospace); font-size: 10px; color: var(--purple-lt, #A78BFA);
}
.ig-notif-panel-list { overflow-y: auto; }
.ig-notif-loading, .ig-notif-empty {
  padding: 32px 16px; text-align: center;
  font-family: var(--ui, 'Rajdhani', sans-serif); font-size: 13px; color: var(--t2, #9090B8);
}
.ig-notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border, #1a1a2e);
  cursor: pointer; transition: background 0.15s;
}
.ig-notif-item:last-child { border-bottom: none; }
.ig-notif-item:hover { background: var(--elevated, #0d0d18); }
.ig-notif-item.ig-notif-no-leida { background: rgba(139,92,246,0.06); }
.ig-notif-icon { font-size: 18px; flex-shrink: 0; }
.ig-notif-content { flex: 1; min-width: 0; }
.ig-notif-titulo { font-family: var(--ui, 'Rajdhani', sans-serif); font-size: 13px; font-weight: 700; color: var(--t1, #F0F0FF); }
.ig-notif-msg { font-family: var(--ui, 'Rajdhani', sans-serif); font-size: 12.5px; color: var(--t2, #9090B8); margin-top: 2px; }
.ig-notif-tiempo { font-family: var(--mono, monospace); font-size: 9px; color: #50507A; margin-top: 4px; }
.ig-notif-delete {
  background: none; border: none; cursor: pointer; color: #50507A;
  font-size: 11px; padding: 2px 4px; flex-shrink: 0;
}
.ig-notif-delete:hover { color: var(--red, #FF3D57); }

@media (max-width: 860px) {
  /* El bell sólo vive en el topbar (arriba) incluso en móvil, así que el
     panel se ancla arriba también en vez de como hoja inferior. */
  .ig-notif-panel { top: 64px; right: 12px; left: 12px; width: auto; max-height: 60vh; }
}

/* ── Grid estilo Instagram para perfiles (reutilizable) ───── */
.ig-profile-header {
  display: flex;
  gap: 40px;
  align-items: center;
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--border, #1a1a2e);
  margin-bottom: 22px;
}
.ig-profile-avatar {
  width: 130px; height: 130px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--grad-gp, linear-gradient(135deg,#8B5CF6,#00D4FF));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display, 'Syne', sans-serif);
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  border: 3px solid rgba(139,92,246,0.35);
  overflow: hidden;
}
.ig-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ig-profile-info { flex: 1; min-width: 0; }
.ig-profile-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ig-profile-username { font-family: var(--display, 'Syne', sans-serif); font-size: 22px; font-weight: 700; color: var(--t1, #F0F0FF); }
.ig-profile-actions { display: flex; gap: 8px; }
.ig-profile-stats { display: flex; gap: 32px; margin-bottom: 14px; }
.ig-profile-stat { font-family: var(--ui, 'Rajdhani', sans-serif); font-size: 14px; color: var(--t1, #F0F0FF); }
.ig-profile-stat b { font-family: var(--display, 'Syne', sans-serif); margin-right: 5px; }
.ig-profile-bio { font-family: var(--ui, 'Rajdhani', sans-serif); font-size: 13.5px; color: var(--t2, #9090B8); line-height: 1.5; max-width: 480px; }

.ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.ig-grid-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--surface, #08080f);
  cursor: pointer;
}
.ig-grid-item img, .ig-grid-item video {
  width: 100%; height: 100%; object-fit: cover;
}
.ig-grid-item .ig-grid-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  opacity: 0;
  transition: opacity 0.15s;
  font-family: var(--ui, 'Rajdhani', sans-serif);
  font-weight: 700;
  color: #fff;
  font-size: 13px;
}
.ig-grid-item:hover .ig-grid-overlay { opacity: 1; }

/* ── Responsive: perfil estilo app móvil ──────────────────── */
@media (max-width: 700px) {
  .ig-profile-header { gap: 18px; padding: 18px 0; flex-wrap: wrap; }
  .ig-profile-avatar { width: 84px; height: 84px; font-size: 26px; }
  .ig-profile-top { margin-bottom: 10px; }
  .ig-profile-username { font-size: 17px; }
  .ig-profile-stats { gap: 18px; }
  .ig-profile-stat { font-size: 12px; }
  .ig-profile-bio { font-size: 12.5px; }
  .ig-grid { gap: 2px; }
}

/* ── Pre-lanzamiento: destinos deshabilitados (más pálidos, no ocultos) ──
   El usuario ve que la opción existe pero no puede tocarla todavía —
   evita que tenga que adivinar cuál sí funciona. El click se intercepta
   en JS (_wireDisabledClicks) y muestra el popup de abajo en vez de
   navegar. */
.ig-icon-btn.ig-disabled,
.ig-wallet-pill.ig-disabled,
.ig-bb-item.ig-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ig-icon-btn.ig-disabled:hover,
.ig-bb-item.ig-disabled:hover { background: transparent; }
.ig-icon-btn.ig-disabled.ig-active,
.ig-bb-item.ig-disabled.ig-active { color: inherit; } /* nunca resaltar en cyan algo deshabilitado, aunque coincida con la página actual */

/* ── Popup "muy pronto" ─────────────────────────────────────────── */
.ig-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(3,3,10,0.75);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.ig-popup-card {
  max-width: 320px;
  width: 100%;
  background: var(--surface, #08080f);
  border: 1px solid rgba(139,92,246,0.35);
  border-radius: 18px;
  padding: 28px 22px 22px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.ig-popup-cerrar {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--elevated, #0d0d18);
  color: var(--t2, #9090B8);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ig-popup-cerrar:hover { color: var(--t1, #F0F0FF); }
.ig-popup-emoji { font-size: 34px; margin-bottom: 12px; }
.ig-popup-titulo {
  font-family: var(--display, 'Syne', sans-serif);
  font-size: 17px; font-weight: 800;
  color: var(--t1, #F0F0FF);
  margin-bottom: 8px;
}
.ig-popup-texto {
  font-family: var(--ui, 'Rajdhani', sans-serif);
  font-size: 13.5px;
  color: var(--t2, #9090B8);
  line-height: 1.55;
}
