/* =========================================================================
   Nav compartilhado — importado por inicio.html, admin_trilhas.html e demais
   ========================================================================= */

:root {
  --nav-h: 44px;
  --snav-bg: rgba(255, 255, 255, .95);
  --snav-line: #dfe7f2;
  --snav-ink: #111827;
  --snav-muted: #16213a;
  --navy: #0f224f;
  --blue: #4d7cf0;
  --blue50: #eef4ff;
  --line2: #cfd8e7;
  --nav-active-bg: #e8f0fe;
  --nav-active-ink: #2952c8;
}

/* Barra fixa */
.shared-nav {
  height: var(--nav-h);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 140;
  background: var(--snav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--snav-line);
  display: flex;
  justify-content: center;
}

.shared-nav-inner {
  width: min(1720px, calc(100% - 10px));
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Brand */
.shared-nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font: italic 800 19px Georgia, serif;
  white-space: nowrap;
  color: var(--snav-ink);
  text-decoration: none;
}

.shared-nav-plus {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--blue50);
  border: 1px solid #cfdbff;
  color: var(--blue);
  display: grid;
  place-items: center;
  font: 800 21px Inter, sans-serif;
  flex-shrink: 0;
}

/* Abas */
.shared-nav-tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shared-nav-tab {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 4px;
  padding: 7px 10px;
  color: var(--snav-muted);
  font: 800 12.5px Inter, system-ui, sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s;
}

.shared-nav-tab:hover {
  background: #f4f7fc;
}

.shared-nav-tab .nav-ic {
  font-size: 13px;
  transition: color .14s;
}

.shared-nav-tab.active {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  border-color: #d3e0fb;
}

.shared-nav-tab.active .nav-ic {
  color: var(--nav-active-ink) !important;
}

/* Ícones coloridos por seção (Font Awesome) */
.nav-ic--home    { color: #2563eb; }
.nav-ic--study   { color: #7c3aed; }
.nav-ic--reader  { color: #b45309; }
.nav-ic--search  { color: #0891b2; }
.nav-ic--verses  { color: #d97706; }
.nav-ic--stats   { color: #059669; }
.nav-ic--graph   { color: #db2777; }
.nav-ic--admin   { color: #475569; }

/* Avatar / usuário */
.shared-nav-user {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

.shared-nav-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px 4px 4px;
  cursor: pointer;
  font-weight: 800;
  font-size: 12.5px;
  color: var(--snav-ink);
  transition: background .14s, border-color .14s;
}

.shared-nav-profile:hover,
.shared-nav-profile[aria-expanded="true"] {
  background: #f4f7fc;
  border-color: var(--line2, #cfd8e7);
}

.shared-nav-ava {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f4fb;
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  flex-shrink: 0;
}

.shared-nav-chevron {
  font-size: 13px;
  color: var(--snav-muted);
  transition: transform .2s ease;
}

.shared-nav-profile[aria-expanded="true"] .shared-nav-chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.shared-nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 176px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12), 0 2px 6px rgba(15,23,42,.06);
  padding: 5px;
  z-index: 200;
  animation: navDropdownIn .15s ease both;
}

.shared-nav-dropdown[hidden] { display: none; }

@keyframes navDropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.shared-nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  font: 600 12.5px Inter, system-ui, sans-serif;
  color: #1e293b;
  cursor: pointer;
  text-decoration: none;
  transition: background .13s;
}

.shared-nav-dropdown-item:hover { background: #f4f7fc; }

.shared-nav-dropdown-item i {
  font-size: 16px;
  color: #64748b;
  flex-shrink: 0;
}

.shared-nav-dropdown-item--danger { color: #dc2626; }
.shared-nav-dropdown-item--danger i { color: #dc2626; }
.shared-nav-dropdown-item--danger:hover { background: #fff1f0; }

.shared-nav-dropdown-sep {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Integração com páginas que usam app.css (--header-height: 56px) */
body:has(.shared-nav) {
  padding-top: var(--nav-h) !important;
}

/* Responsivo — esconde abas inativas em mobile */
@media (max-width: 760px) {
  .shared-nav-tab:not(.active) {
    display: none;
  }

  .shared-nav-brand span:not(.shared-nav-plus) {
    display: none;
  }

  .shared-nav-user b {
    display: none;
  }
}
