/* ========================================
   Navbar — Navigation bar + user dropdown menu.
   Edit here for login button position, avatar/nickname display.
   ======================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 40px; height: 60px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: #fff; text-decoration: none;
}
.nav-brand .logo-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed, #ec4899);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

/* Login button (shown when not logged in) */
.btn-login {
  padding: 8px 20px; border-radius: 8px; background: rgba(168, 85, 247, 0.15);
  color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); cursor: pointer;
  font-size: 14px; transition: all 0.3s;
}
.btn-login:hover { background: rgba(168, 85, 247, 0.25); border-color: #a855f7; }

/* Guest entry for pages that mount the shared account shell dynamically. */
.nav-login-btn {
  position: fixed;
  top: 14px;
  right: 22px;
  z-index: 1300;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--rb-line-strong);
  border-radius: 5px;
  background: var(--rb-panel-solid);
  color: var(--rb-text);
  font: inherit;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.nav-login-btn:hover {
  border-color: rgba(167, 139, 250, 0.7);
  background: rgba(139, 92, 246, 0.14);
  color: #fff;
  transform: translateY(-1px);
}
.nav-login-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(155, 108, 255, 0.3), 0 10px 28px rgba(0, 0, 0, 0.18);
}

/* User area (shown when logged in) */
.nav-user-area {
  position: fixed;
  top: 6px;
  right: 34px;
  z-index: 1300;
  display: none;
  align-items: flex-start;
  gap: 26px;
}
.nav-user-area.show { display: flex; }
.nav-purchase-btn {
  height: 38px;
  min-width: 126px;
  /* The label is nowrap dark text on a light pill (Canvas theme); if this
     button were allowed to flex-shrink, the text would overflow the pill
     onto the dark page background and look clipped. Keep it at natural
     size so the label is always fully visible. */
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  /* Keep the purchase action on the same top-navigation baseline as the
     account trigger.  The account area is positioned independently from the
     page content, so a vertical offset makes this control look like a
     floating secondary action instead of part of the nav. */
  margin-top: 0;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.38);
  background:
    linear-gradient(180deg, rgba(24, 32, 34, 0.92), rgba(13, 18, 24, 0.88)),
    radial-gradient(circle at 20% 12%, rgba(74, 222, 128, 0.22), transparent 42%);
  color: #d9f99d;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 0 18px rgba(74, 222, 128, 0.08),
    0 0 18px rgba(74, 222, 128, 0.16);
  transition: all 0.2s ease;
}
.nav-purchase-btn .ui-icon { width: 16px; height: 16px; }
.nav-purchase-btn::before {
  display: none;
}
.nav-purchase-btn:hover {
  border-color: rgba(74, 222, 128, 0.62);
  background:
    linear-gradient(180deg, rgba(28, 40, 38, 0.94), rgba(15, 23, 25, 0.9)),
    radial-gradient(circle at 20% 12%, rgba(74, 222, 128, 0.3), transparent 44%);
  color: #ecfccb;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 0 22px rgba(74, 222, 128, 0.11),
    0 0 24px rgba(74, 222, 128, 0.24);
}
.user-points { display: none; }
.user-avatar-trigger { width: 79px; height: 79px; border-radius: 50%; cursor: pointer; overflow: hidden; border: 3px solid rgba(168, 85, 247, 0.6); transition: none; background-size: cover; background-position: center; box-shadow: 0 0 16px rgba(168, 85, 247, 0.4); transform: none; translate: none; }
.user-avatar-trigger:hover,
.user-avatar-trigger:active { border-color: rgba(168, 85, 247, 0.6); transform: none; translate: none; box-shadow: 0 0 16px rgba(168, 85, 247, 0.4); }

/* User dropdown menu */
.user-dropdown { position: absolute; top: calc(100% + 8px); right: 0; min-width: 200px; background: rgba(20, 20, 25, 0.95); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.5); display: none; overflow: hidden; z-index: 200; }
.user-dropdown.show { display: block; animation: fadeInDown 0.2s ease-out; }
.dropdown-header { padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.06); text-align: center; }
.dropdown-header .user-name { font-size: 14px; font-weight: 600; color: #fff; }
.dropdown-header .user-tier { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.dropdown-point-stack {
  display: inline-grid;
  gap: 6px;
  justify-items: start;
  margin-top: 12px;
}
.dropdown-points {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-width: 112px;
  min-height: 26px;
  margin: 0;
  padding: 2px 4px;
  border-radius: 0;
  color: #fff;
  line-height: 1;
  box-shadow: none;
}
.dropdown-points b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 800;
}
.point-label {
  color: rgba(255,255,255,0.66);
  font-size: 12px;
  font-weight: 700;
}
.dropdown-points-personal {
  background: transparent;
  border: 0;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}
.dropdown-points-personal b { color: #fff; }
.dropdown-points-team {
  background: transparent;
  border: 0;
  text-shadow: 0 0 8px rgba(34, 197, 94, 0.42);
}
.dropdown-points-team b { color: #86efac; }
.team-point-mark {
  position: relative;
  width: 20px;
  height: 18px;
  flex: 0 0 20px;
  display: inline-block;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.team-point-mark::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 13px;
  height: 11px;
  border-radius: 3px;
  background: rgba(74, 222, 128, 0.42);
  transform: rotate(-10deg);
}
.team-point-mark::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 14px;
  height: 12px;
  border-radius: 3px;
  background: linear-gradient(135deg, #86efac, #22c55e);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.36);
  transform: rotate(8deg);
}
.dropdown-item { padding: 12px 16px; cursor: pointer; font-size: 13px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 10px; transition: all 0.2s; }
.dropdown-item:hover { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 0; }

@media (max-width: 640px) {
  .navbar { padding: 10px 16px; }
  .nav-login-btn { top: 12px; right: 12px; min-height: 36px; padding: 0 12px; }
  .nav-user-area { top: 6px; right: 12px; gap: 16px; }
  .nav-purchase-btn { height: 34px; min-width: 104px; padding: 0 12px; margin-top: 23px; font-size: 13px; }
}

/* ReactBits-inspired dark skin */
.navbar {
  background: rgba(18, 15, 23, 0.78);
  border-bottom-color: var(--rb-line);
  box-shadow: 0 18px 48px rgba(0,0,0,0.22);
}

.nav-brand {
  color: var(--rb-text);
  letter-spacing: 0;
}

.nav-brand .logo-icon {
  background: linear-gradient(135deg, var(--rb-primary), var(--rb-primary-3));
  color: #fff;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 24px rgba(82,39,255,0.42);
}

.btn-login,
.btn-upload-avatar {
  background: rgba(82,39,255,0.16);
  color: #dad1f6;
  border-color: rgba(139,92,246,0.34);
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
}

.btn-login:hover,
.btn-upload-avatar:hover {
  background: rgba(82,39,255,0.26);
  border-color: rgba(139,92,246,0.62);
  color: #fff;
  box-shadow: 0 0 28px rgba(82,39,255,0.28);
}

.user-avatar-trigger {
  border-color: rgba(139,92,246,0.62);
  background-color: rgba(22,16,38,0.86);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 0 28px rgba(82,39,255,0.32);
}

.user-avatar-trigger:hover {
  border-color: var(--rb-primary-2);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 0 36px rgba(139,92,246,0.46);
}

.user-dropdown {
  background: rgba(18,15,23,0.94);
  border-color: var(--rb-line);
  box-shadow: var(--rb-shadow);
}

.dropdown-header,
.dropdown-divider {
  border-color: var(--rb-line);
  background: rgba(255,255,255,0.018);
}

.dropdown-header .user-tier,
.point-label,
.dropdown-item {
  color: var(--rb-muted);
}

.dropdown-item:hover {
  background: rgba(82,39,255,0.16);
  color: #dad1f6;
}

.dropdown-points-personal {
  text-shadow: 0 0 12px rgba(139,92,246,0.52);
}

.nav-purchase-btn {
  border-color: rgba(52,211,153,0.36);
  background:
    linear-gradient(180deg, rgba(26,36,34,0.9), rgba(12,20,22,0.84)),
    linear-gradient(135deg, rgba(52,211,153,0.18), transparent 58%);
  color: #d1fae5;
}

/* Minimal black pass: subtle ReactBits-style glass and restrained accent */
.navbar {
  background: rgba(13,12,17,0.84);
  border-bottom-color: rgba(255,255,255,0.1);
  box-shadow: 0 12px 30px rgba(0,0,0,0.28);
}

.nav-brand .logo-icon {
  background: linear-gradient(135deg, #1b1622, var(--rb-primary));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 18px rgba(124,58,237,0.22);
}

.btn-login,
.btn-upload-avatar {
  background: rgba(255,255,255,0.06);
  color: rgba(244,244,245,0.86);
  border-color: rgba(139,92,246,0.28);
}

.btn-login:hover,
.btn-upload-avatar:hover {
  background: rgba(139,92,246,0.12);
  border-color: rgba(139,92,246,0.38);
  box-shadow: 0 0 18px rgba(124,58,237,0.14);
}

.user-avatar-trigger {
  border-color: rgba(139,92,246,0.5);
  background-color: rgba(15,14,20,0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 22px rgba(124,58,237,0.18);
}

.user-avatar-trigger:hover {
  border-color: rgba(167,139,250,0.56);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 0 28px rgba(124,58,237,0.24);
}

.user-dropdown {
  background: rgba(17,16,22,0.96);
  border-color: rgba(255,255,255,0.11);
}

.dropdown-header,
.dropdown-divider {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.09);
}

.dropdown-item:hover {
  background: rgba(139,92,246,0.1);
  color: rgba(244,244,245,0.94);
}

.nav-purchase-btn {
  border-color: rgba(52,211,153,0.26);
  background: rgba(13,20,17,0.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 0 18px rgba(52,211,153,0.1);
}

/* Shared account popover aligned with the create workspace controls. */
.user-dropdown {
  top: calc(100% + 12px);
  width: 276px;
  min-width: 276px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(13,12,17,0.98);
  backdrop-filter: blur(24px) saturate(1.15);
  box-shadow: 0 24px 70px rgba(0,0,0,0.56), inset 0 1px 0 rgba(255,255,255,0.035);
}

.user-dropdown.show {
  animation: fadeInDown 0.16s ease-out;
}

.dropdown-header {
  padding: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.018);
  text-align: left;
}

.dropdown-identity {
  min-width: 0;
}

.dropdown-header .user-name {
  overflow: hidden;
  color: var(--rb-text);
  font-size: 15px;
  font-weight: 720;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-header .user-tier {
  margin-top: 3px;
  color: var(--rb-dim);
  font-size: 11px;
}

.dropdown-point-stack {
  width: 100%;
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.dropdown-points {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(255,255,255,0.075);
  border-radius: 6px;
  background: rgba(255,255,255,0.025);
  box-shadow: none;
  text-shadow: none;
}

.dropdown-point-icon,
.dropdown-point-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.dropdown-point-icon {
  display: grid;
  place-items: center;
  color: var(--rb-primary-3);
}

.dropdown-points-team .dropdown-point-icon {
  color: var(--rb-green);
}

.point-label {
  overflow: hidden;
  color: var(--rb-muted);
  font-size: 12px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-points b,
.dropdown-points-personal b,
.dropdown-points-team b {
  color: var(--rb-text);
  font-size: 15px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.dropdown-points-team b {
  color: #86efac;
}

.dropdown-points-daily .dropdown-point-icon {
  color: #c4b5fd;
}

.dropdown-points-daily b {
  color: #ddd6fe;
}

.dropdown-menu {
  padding: 7px;
}

.dropdown-item {
  width: calc(100% - 14px);
  min-height: 42px;
  margin: 0 7px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--rb-muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.dropdown-menu .dropdown-item {
  width: 100%;
  margin: 0;
}

.dropdown-item .ui-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--rb-dim);
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  outline: none;
  background: rgba(124,58,237,0.13);
  color: var(--rb-text);
}

.dropdown-item:hover .ui-icon,
.dropdown-item:focus-visible .ui-icon {
  color: var(--rb-primary-3);
}

.dropdown-divider {
  height: 1px;
  margin: 0 14px 7px;
  border: 0;
  background: rgba(255,255,255,0.08);
}

.dropdown-item-danger {
  margin-bottom: 7px;
}

.dropdown-item-danger:hover,
.dropdown-item-danger:focus-visible {
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
}

.dropdown-item-danger:hover .ui-icon,
.dropdown-item-danger:focus-visible .ui-icon {
  color: #f87171;
}

.user-avatar-trigger {
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--rb-primary-3);
}

.user-avatar-trigger .ui-icon {
  width: 26px;
  height: 26px;
}

.user-avatar-trigger.has-avatar .ui-icon {
  display: none;
}

/* Keep the profile image completely stationary across pointer states. */
.user-avatar-trigger,
.user-avatar-trigger:hover,
.user-avatar-trigger:active {
  transform: none !important;
  translate: none !important;
  transition: none !important;
}

/* Account actions use a deliberate primary/secondary pair: membership leads
   with the brand violet while points stay a quiet utility destination. */
.nav-account-action {
  width: auto;
  min-width: 0;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 0;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  background: #161a1c;
  color: #e5e7eb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  backdrop-filter: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-account-action .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.nav-purchase-btn {
  border-color: rgba(235, 240, 240, .11);
  background: #121618;
  color: #d6d8db;
}

.nav-purchase-btn .ui-icon {
  color: #c4b5fd;
}

.nav-purchase-btn:hover,
.nav-purchase-btn:focus-visible {
  border-color: rgba(216, 181, 107, .5);
  background: #181d20;
  color: #f1f3f2;
  transform: translateY(-1px);
}

.nav-membership-btn {
  border-color: rgba(196, 181, 253, 0.72);
  background: linear-gradient(135deg, #a66cff 0%, #7257ff 52%, #5848e8 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(88,72,232,0.22);
}

.nav-membership-btn:hover,
.nav-membership-btn:focus-visible {
  border-color: rgba(237, 233, 254, 0.82);
  background: linear-gradient(135deg, #b584ff 0%, #806cff 52%, #6557ef 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(88,72,232,0.3);
}

.nav-account-action:focus-visible {
  outline: 3px solid rgba(196, 181, 253, 0.55);
  outline-offset: 2px;
}

@media (max-width: 700px) {
  .nav-account-action {
    width: 38px;
    padding: 0;
    color: transparent !important;
    font-size: 0;
    gap: 0;
  }

  .nav-account-action .ui-icon {
    color: #ddd6fe;
  }

  .nav-membership-btn .ui-icon {
    color: #fff;
  }

}

@media (max-width: 640px) {
  .user-dropdown {
    right: -4px;
    width: min(276px, calc(100vw - 24px));
    min-width: 0;
  }
}

