/* ================================================================
   navbar.css  —  Secret Maps Navigation Component  v1
   Diseno glassmorphism coherente con la paleta de la web.
   Paleta: bg #1f4037 / accent #f9d423 / glass rgba(255,255,255,.12)
   ================================================================ */

/* ── Contenedor principal ───────────────────────────────────────── */
.sm-navbar {
  display: block;
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(12, 36, 28, 0.92);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.32);
}

/* ── Fila interior ──────────────────────────────────────────────── */
.sm-navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 60px;
}

/* ── Logo ───────────────────────────────────────────────────────── */
.sm-navbar__logo {
  text-decoration: none;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.25px;
  white-space: nowrap;
  flex-shrink: 0;
  /* Degradado de blanco a acento */
  background: linear-gradient(120deg, #ffffff 30%, var(--accent, #f9d423) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: opacity 0.2s;
}
.sm-navbar__logo:hover {
  opacity: 0.88;
}

/* ── Grupo de enlaces centrales ─────────────────────────────────── */
.sm-navbar__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.sm-navbar__link {
  position: relative;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.1px;
  padding: 7px 14px;
  border-radius: 10px;
  transition: color 0.18s, background 0.18s;
}
.sm-navbar__link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* Estado activo: fondo sutil + subrayado acento */
.sm-navbar__link--active {
  color: var(--accent, #f9d423) !important;
  background: rgba(249, 212, 35, 0.10);
}
.sm-navbar__link--active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 14px;
  right: 14px;
  height: 2px;
  background: var(--accent, #f9d423);
  border-radius: 2px;
  opacity: 0.9;
}

/* ── Zona derecha ───────────────────────────────────────────────── */
.sm-navbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Boton cerrar sesion */
.sm-navbar__logout {
  background: rgba(201, 48, 44, 0.80);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, transform 0.15s;
}
.sm-navbar__logout:hover {
  background: rgba(211, 58, 54, 0.95);
  transform: translateY(-1px);
}

/* Chip de usuario */
.sm-navbar__user {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  padding: 4px 12px 4px 4px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  transition: background 0.2s, border-color 0.2s;
  min-width: 0;
  max-width: 180px;
  cursor: pointer;
}
.sm-navbar__user:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(249, 212, 35, 0.35);
}
.sm-navbar__user.sm-navbar__link--active {
  border-color: rgba(249, 212, 35, 0.45);
  background: rgba(249, 212, 35, 0.08);
}
/* El chip de usuario no lleva línea subrayada aunque esté activo */
.sm-navbar__user.sm-navbar__link--active::after {
  display: none;
}

/* Avatar */
.sm-navbar__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
}

/* Nombre de usuario */
.sm-navbar__name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-navbar__user.sm-navbar__link--active .sm-navbar__name {
  color: var(--accent, #f9d423);
}

/* ── Modal global de cierre de sesion ─────────────────────────── */
.logout-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: smLogoutFadeIn 0.18s ease;
}

.logout-modal-backdrop.is-hidden {
  display: none;
}

@keyframes smLogoutFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.logout-modal-card {
  width: min(400px, 100%);
  background: rgba(22, 50, 40, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 28px 24px 22px;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
  animation: smLogoutSlideUp 0.22s cubic-bezier(.34, 1.42, .64, 1);
}

@keyframes smLogoutSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logout-modal-icon {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #f87171;
}

.logout-modal-title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}

.logout-modal-desc {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62);
}

.logout-modal-actions {
  display: flex;
  gap: 10px;
}

.logout-modal-cancel {
  flex: 1;
  justify-content: center;
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.70);
  font-weight: 700;
}

.logout-modal-cancel:hover {
  border-color: rgba(255, 255, 255, 0.40);
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.logout-modal-confirm {
  flex: 1;
  justify-content: center;
  gap: 7px;
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
}

.logout-modal-confirm:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.logout-modal-confirm:active {
  background: #b91c1c;
  border-color: #b91c1c;
}

/* ================================================================
   RESPONSIVO — Movil (max 768px)
   En movil el bottom-nav cubre toda la navegacion.
   ================================================================ */
@media (max-width: 1199px) {

  /* Paginas con cabecera/topbar propia: ocultar navbar entero */
  body[data-page="home"] .sm-navbar,
  body[data-page="amigos"] .sm-navbar,
  body[data-page="favoritos"] .sm-navbar,
  body[data-page="perfil"] .sm-navbar {
    display: none !important;
  }

  /* Reducir altura del navbar en movil cuando se muestra */
  .sm-navbar__inner {
    height: 50px;
  }
}
