/* ── nav.css — Shared nav-user-btn pill button & dropdown ──────────────────
   Replaces the old icon-only .nav-user-trigger pattern across all Node.js
   app pages. Design mirrors the WP plugin's homepage.css nav-user-btn so
   both sites share a consistent account menu.
   Loaded by views/partials/head.ejs after every page's own CSS file.
─────────────────────────────────────────────────────────────────────────── */

.nav-user {
  position: relative;
}

/* ── Pill trigger button ──────────────────────────────────────────────── */
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.15s, border-color 0.15s;
}

.nav-user-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

.nav-user-btn[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
}

/* ── Avatar circle ────────────────────────────────────────────────────── */
.nav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue-600, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Name label ───────────────────────────────────────────────────────── */
.nav-user-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Dropdown panel ───────────────────────────────────────────────────── */
.nav-user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
  padding: 6px;
  z-index: 200;
  animation: nav-dd-in 0.12s ease;
}

.nav-user-dropdown.is-open {
  display: block;
}

@keyframes nav-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-user-divider {
  height: 1px;
  background: var(--ink-100, #f1f5f9);
  margin: 4px 0;
}

/* ── Mobile: hide name, show avatar only ──────────────────────────────── */
@media (max-width: 640px) {
  .nav-user-name {
    display: none;
  }
}

/* ── Two-row layout inside nav-user-btn ───────────────────────────────── */
.nav-user-btn--rich {
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
}

/* Body: stacks name on top, credits row below */
.nav-user-btn-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

/* Credits subtitle row */
.nav-user-credits-row {
  font-size: 10.5px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  line-height: 1.2;
}

.nav-credits-divider {
  margin: 0 4px;
  opacity: 0.4;
}

/* Refill / Subscribe inline link */
.nav-refill-link {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition: color 0.12s;
}

.nav-refill-link:hover {
  color: #fff;
  text-decoration: underline;
}

.nav-refill-link[data-refill-action="subscribe"] {
  color: #93c5fd; /* blue-300 — stands out as a call-to-action */
}
.nav-refill-link[data-refill-action="activate"] {
  color: #fca5a5; /* red-300 — signals attention needed */
}

/* ── Mobile: hide credits row from button, show inside dropdown ───────── */
@media (max-width: 640px) {
  .nav-user-credits-row {
    display: none;
  }
}

/* Credits row inside dropdown — hidden on desktop, shown only on mobile */
.nav-user-credits-item,
.nav-credits-divider-line {
  display: none;
}

.nav-user-credits-item {
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 6px;
  font-size: 13px;
  color: #475569;
  gap: 10px;
}

.nav-refill-link--dd {
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  cursor: pointer;
  white-space: nowrap;
}
.nav-refill-link--dd:hover { text-decoration: underline; }
.nav-refill-link--dd[data-refill-action="subscribe"] { color: #2563eb; }
.nav-refill-link--dd[data-refill-action="activate"]  { color: #dc2626; }

@media (max-width: 640px) {
  .nav-user-credits-item {
    display: flex;
  }
  .nav-credits-divider-line {
    display: block;
  }
}

/* ── Shared modal backdrop (nav-upgrade-modal — available on all pages) ── */
.bes-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.bes-modal-backdrop[hidden] {
  display: none !important;
}

.bes-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .18);
  width: 100%;
  max-width: 460px;
}
