/* Foreway — Avatar Menu (popover) */
/* Premium card under the avatar button.  */

:root{
  --acc-bg: #fff;
  --acc-border: #e6e9f0;
  --acc-shadow: 0 18px 44px rgba(0,0,0,.12);
  --acc-muted: #8a94a2;
  --acc-text: #111827;
  --acc-text-2: #374151;
  --acc-hover: #f8fafc;
  --gold: #d4af37;
}

/* ---------- Container & animation ---------- */

#account-menu-wrapper{ position:relative; }

/* Account Dropdown — default hidden but interactive */
.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  
  background: var(--acc-bg);
  border: 1px solid var(--acc-border);
  border-radius: 14px;
  box-shadow: var(--acc-shadow);

  width: 340px;
  max-width: 92vw;
  z-index: 1900;
  overflow: hidden;

  /* ✅ Only hide visually — not removed from layout */
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}

/* ✅ Visible when open */
.account-dropdown.open,
.account-dropdown[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  display: block; /* ✅ ensure shown */
}


/* caret */
.account-dropdown::before{
  content:"";
  position:absolute;
  top:-8px; right: 22px;
  width: 16px; height: 16px;
  background: var(--acc-bg);
  border-left: 1px solid var(--acc-border);
  border-top: 1px solid var(--acc-border);
  transform: rotate(45deg);
  border-top-left-radius: 4px;
}

/* ---------- Header (avatar + name/email + Profile chip) ---------- */

.account-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px 8px;
}

.account-id{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 0;
}

.account-thumb{
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f3f4f6;
  border: 2px solid var(--gold);    /* subtle gold ring */
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.account-thumb img{
  width:100%; height:100%;
  object-fit:cover;
}

#account-thumb-initial{
  font-weight: 800;
  color:#374151;
  font-size: .95rem;
  line-height:1;
  display:grid;
  place-items:center;
}

.account-meta{
  display:flex;
  flex-direction:column;
  min-width: 0;
}

.account-name{
  font-weight: 800;
  font-size: .98rem;
  line-height:1.2;
  color: var(--acc-text);
}

.account-email{
  font-size: .84rem;
  color: #6b7280;
  line-height:1.2;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 6px 10px;
  border-radius: 9999px;
  border: 1px solid #e5e7eb;
  font-weight: 700;
  font-size: .84rem;
  color: #374151;
  text-decoration: none;
}
.profile-link:hover{ background: var(--acc-hover); }

/* divider between header and list */
.account-dropdown .divider{
  height:1px; background: var(--acc-border); margin: 8px 0 6px;
}

/* ---------- List items (Notifications / Settings…) ---------- */

.account-list{ list-style:none; margin:0; padding: 4px 6px 6px; }

.account-list li{ margin:2px 0; }

.account-dropdown ul li a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 12px;     /* hit area ≥44px */
  border-radius: 10px;
  text-decoration:none;
  font-weight: 700;
  font-size: 15px;
  color: var(--acc-text-2);
  transition: background .12s ease, transform .08s ease;
}

.account-dropdown ul li a:hover{ background: var(--acc-hover); }
.account-dropdown ul li a:active{ transform: translateY(1px) scale(.99); }

/* right chevron for "nav" rows */
.account-dropdown .nav a::after{
  content: "›";
  opacity: .4;
  font-size: 18px;
  margin-left: 12px;
}

/* optional tiny badge dot (e.g., notifications) */
.badge-dot{
  display:inline-block;
  width:8px; height:8px;
  border-radius:9999px;
  background:#ef4444;
  margin-left:8px;
}

/* ---------- Footer (Log out) ---------- */

.account-footer{
  border-top: 1px solid var(--acc-border);
  background: linear-gradient(180deg, transparent, #fff 40%);
  padding: 6px 6px 10px;
}

.account-footer .logout-link{
  display:block;
  padding: 10px 12px;        /* same as other rows */
  border-radius: 10px;
  text-decoration:none;
  color: var(--acc-text-2);
  font-weight: 600;          /* same tone as items */
  font-size: 15px;           /* same size as items */
  line-height: 1.2;
  transition: background .12s ease, transform .08s ease;
}
.account-footer .logout-link:hover{ background: var(--acc-hover); }
.account-footer .logout-link:active{ transform: translateY(1px) scale(.99); }

/* ---------- Accessibility ---------- */

.account-dropdown a:focus-visible,
.profile-link:focus-visible{
  outline: 2px solid #166534;
  outline-offset: 2px;
  border-radius: 10px;
}

/* === Dropdown OPEN state === */
.account-dropdown.open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
