/* Profile Sidebar - Reusable Component */
.profile-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.profile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 95vw);
  height: 100vh;
  background: #111;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top-left-radius: 2rem;
  border-bottom-left-radius: 2rem;
}

.profile-sidebar.active {
  transform: translateX(0);
}

/* Header */
.profile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-sidebar-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-sidebar-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.profile-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.profile-sidebar-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-user-meta-section {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.user-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.625rem 0.875rem;
  transition: all 0.2s ease;
}

.user-meta-item:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

/* Plan-specific colors */
.user-meta-item.plan-free {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.85);
}

.user-meta-item.plan-basic {
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(59,130,246,0.08));
  border-color: rgba(59,130,246,0.35);
  color: #60a5fa;
}

.user-meta-item.plan-plus {
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.08));
  border-color: rgba(139,92,246,0.35);
  color: #a78bfa;
}

.user-meta-item.plan-pro {
  background: linear-gradient(135deg, rgba(255,122,24,0.15), rgba(255,122,24,0.08));
  border-color: rgba(255,122,24,0.35);
  color: #ff9333;
}

.user-meta-item.plan-teams {
  background: linear-gradient(135deg, rgba(57,217,138,0.15), rgba(57,217,138,0.08));
  border-color: rgba(57,217,138,0.35);
  color: #39d98a;
}

/* Member chip color */
.user-meta-item.member-chip {
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(139,92,246,0.06));
  border-color: rgba(139,92,246,0.25);
  color: #a78bfa;
}

/* User ID chip color */
.user-meta-item.user-id-item {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.75);
}

.user-meta-item i {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  flex-shrink: 0;
  color: currentColor;
  opacity: 0.9;
}

.user-meta-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.profile-sidebar-close {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
  border-radius: 8px;
}

.profile-sidebar-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f6f6f6;
}

.profile-sidebar-close svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

/* Menu */
.profile-sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.profile-sidebar-menu::-webkit-scrollbar {
  width: 6px;
}

.profile-sidebar-menu::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.profile-sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.profile-sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: #f6f6f6;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #ff7a18;
}

.profile-menu-item svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.5;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.profile-menu-item:hover svg {
  color: #ff7a18;
}

.profile-menu-item.has-dropdown {
  position: relative;
}

.profile-menu-item .dropdown-icon {
  margin-left: auto;
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.profile-menu-item.expanded .dropdown-icon {
  transform: rotate(180deg);
}

/* Submenu */
.profile-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0, 0, 0, 0.2);
}

.profile-submenu.expanded {
  max-height: 300px;
}

.profile-submenu-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.5rem 0.875rem 3.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

.profile-submenu-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ff7a18;
}

.profile-submenu-item svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.profile-submenu-item:hover svg {
  color: #ff7a18;
}

/* Footer */
.profile-sidebar-footer {
  margin-top: auto;
  padding: 0 1.5rem 1.5rem 1.5rem;
  /* No border-top here, keep simple */
}

.profile-billing-btn {
  appearance: none;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  background: rgba(255,255,255,0.10);
  border: 2.5px solid rgba(120,120,120,0.14);
  border-radius: 16px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.16);
  text-decoration: none;
  margin-bottom: 1.1rem;
}

.profile-billing-btn:hover {
  background: #222;
  color: #ff7a18;
  transform: translateY(-2px);
}

.profile-billing-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.profile-signout-btn {
  appearance: none;
  border: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2.2rem;
  background: #ff5d5d;
  border: 1px solid #ff5d5d;
  border-radius: 999px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(255,93,93,0.18);
}

.profile-signout-btn:hover {
  background: #ff3535;
  border-color: #ff3535;
  transform: translateY(-1px);
}

.profile-signout-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
}

.profile-footer-action-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 1.1rem;
}

.profile-footer-action {
  width: 160px;
  height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.10);
  border: 2.5px solid rgba(120,120,120,0.14);
  border-radius: 16px;
  color: #fff;
  cursor: pointer;
  transition: background 0.16s, border 0.16s, color 0.12s, transform 0.12s;
  font-size: 1.65rem;
  box-shadow: 0 2px 16px 0 rgba(0,0,0,0.16);
  outline: none;
  position: relative;
  padding: 0.3rem 0.25rem 0.1rem 0.25rem;
}
.profile-footer-action:focus, .profile-footer-action:hover {
  background: #222;
  color: #ff7a18;
  transform: translateY(-3px) scale(1.065);
}
.profile-footer-action i[data-lucide] {
  font-size: 2.45rem;
  display: flex;
  line-height: 1;
  margin-top: 2px;
}
.profile-footer-action .action-label {
  font-size: 1.12rem;
  font-weight: 700;
  color: #fff;
  margin-top: 8px;
  letter-spacing: 0.019em;
  text-align: center;
  line-height: 1.08;
  text-decoration: none !important;
}

a.profile-footer-action {
  text-decoration: none !important;
}

.profile-invite-card {
  background: rgba(255,255,255,0.93);
  border-radius: 32px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.16);
  margin: 1.2rem 0 1.2rem 0;
  padding: 1.1rem 1.2rem 1.1rem 1.2rem;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.2rem;
  border: none;
  position: relative;
}
.invite-title-modern {
  font-size: 1.23rem;
  font-weight: 800;
  color: #17202a;
  margin-top: 0.12em;
  margin-bottom: 0.43rem;
  letter-spacing: .011em;
  font-family: inherit;
}
.invite-link-row-modern {
  display: flex;
  align-items: center;
  gap: 0.6em;
  width: 100%;
  margin: 0.1em 0 0 0;
}
.invite-link-pill {
  display: block;
  flex: 1 1 auto;
  font-size: 1.09rem;
  border-radius: 22px;
  background: #f6f7fb;
  padding: 0.7em 1.15em;
  border: none;
  color: #222e29;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: inset 0 1.5px 9px rgba(100,120,140,0.03);
  text-align: left;
  overflow-x: auto;
  transition: background .15s;
  user-select: all;
}
.invite-icon-btn {
  width: 38px;
  height: 38px;
  background: #f6f7fb;
  border: 1.5px solid #ececec;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.6em;
  transition: background .17s, border .16s, color .18s;
  cursor: pointer;
  outline: none;
  position: relative;
}
.invite-icon-btn:hover,
.invite-icon-btn:focus {
  background: #f2f9f7;
  border-color: #b6e4d2;
}
.invite-icon-btn.check-success {
  background: #d5fae6;
  border-color: #2ec48b;
}
.invite-icon-btn i[data-lucide] {
  font-size: 1.26rem;
  color: #333;
  vertical-align: middle;
  line-height: 1;
  transition: color 0.12s;
}
.invite-icon-btn.check-success i[data-lucide="check"]{
  color: #2ec48b !important;
}
.copied-msg-modern {
  display: block;
  color: #2ec48b;
  text-align: center;
  margin: 0.7em auto 0 auto;
  font-size: 1rem;
  font-weight: 700;
  opacity:0;
  letter-spacing: 0.031em;
  transition: opacity 0.45s;
  position: relative;
}
.profile-invite-card.show-copied #inviteCopiedMsg, .profile-invite-card.show-copied #inviteCopiedMsg.copied-msg-modern {
  opacity: 1 !important;
  display: block;
}
.send-invite-btn {
  display: block;
  width: 100%;
  margin-top: 0 !important;
  text-decoration: none !important;
  background: #111;
  color: #fff;
  border-radius: 32px;
  font-weight: 800;
  padding: 0.84em 0;
  font-size: 1rem;
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  transition: background .16s,box-shadow .17s;
  text-align: center;
  outline: none;
}
.send-invite-btn:hover,
.send-invite-btn:focus {
  background: #181b1e;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  color: #fff;
  text-decoration: none !important;
}
.send-invite-btn:active {
  background: #222324;
}
@media (max-width: 640px) {
  .send-invite-btn { font-size: .95rem; min-width: 104px; max-width: 99%; }
}
@media (max-width: 640px) {
  .profile-invite-card { padding: 0.99rem 0.5rem 0.95rem 0.5rem; max-width: 98vw; }
  .invite-title-modern { font-size: 1.07rem; }
  .invite-link-modern { font-size: 0.98rem; }
}

/* Responsive */
@media (max-width: 640px) {
  .profile-sidebar {
    width: 100vw;
    max-width: 98vw;
  }
}

.invite-link-bar { width: 100%; position: relative; margin-bottom: 0; }
.invite-link-pill.invite-link-fullwidth {
  width: 100%;
  display: block;
  font-size: 1.09rem;
  border-radius: 22px;
  background: #f6f7fb;
  padding: 0.7em 1.15em 0.7em 46px; /* left padding for icon */
  border: none;
  color: #222e29;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 8px 32px 0 rgba(60,63,110,0.16), 0 1.5px 9px rgba(100,120,140,0.03);
  text-align: left;
  overflow-x: auto;
  transition: background .15s, box-shadow .18s;
  user-select: all;
  min-height: 38px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}
.invite-icon-btn.right-overlay {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: background .13s;
  pointer-events: auto;
  flex-shrink: 0;
}

.invite-icon-btn.right-overlay:active {
  transform: translateY(-50%) scale(0.95);
}

.invite-icon-btn.right-overlay:hover {
  background: #ececec;
}

.invite-icon-btn.right-overlay:focus {
  outline: none;
  background: #ececec;
}

.invite-icon-btn.right-overlay:focus:not(:focus-visible) {
  outline: none;
  background: none;
}

.invite-icon-btn.right-overlay.check-success {
  background: #d5fae6;
}

.invite-icon-btn.right-overlay i[data-lucide] {
  position: relative;
  width: 18px !important;
  height: 18px !important;
  color: #333;
  margin: 0;
  padding: 0;
  transition: opacity .25s, transform .26s cubic-bezier(.76,0,.24,1), color .13s;
  pointer-events: none;
  display: block;
}

.invite-icon-btn.right-overlay i[data-lucide] svg {
  width: 18px !important;
  height: 18px !important;
  display: block;
}

.invite-icon-btn.right-overlay:not(.morphing) #inviteIconLink {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.invite-icon-btn.right-overlay:not(.morphing) #inviteIconCheck {
  opacity: 0;
  transform: rotate(-25deg) scale(0.82);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
}

.invite-icon-btn.right-overlay.morphing #inviteIconLink {
  opacity: 0;
  transform: rotate(23deg) scale(0.76);
}

.invite-icon-btn.right-overlay.morphing #inviteIconCheck {
  opacity: 1;
  color: #2ec48b !important;
  transform: rotate(0deg) scale(1.08);
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
}

.invite-icon-btn.right-overlay.check-success i[data-lucide="check"] {
  color: #2ec48b !important;
}

