/* static/css/components/user-menu.css */

.btn-user {
    border-radius: 10px;
    color: var(--text-muted);
    background: #fafbff;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 1.5rem;
    outline: none;
    border: none;
}

.btn-user:hover, .btn-user:focus{
      outline: transparent;
}

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
}

#userMenuDropdown {
  display: none;                 /* hidden until JS toggles */
  position: absolute;
  top: 100%;                     /* sit under the button */
  right: 0;
  min-width: 260px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  background-color: #fff;
  border: 1px solid #eff1f3;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(2, 6, 23, .15);
  z-index: 2000;
  padding: 6px 0;
  margin-top: 0.5rem;
}

/* Optional: round separators look nicer in a menu panel */
#userMenuDropdown hr {
  margin: 6px 0;
  border-color: #eef0f4;
}

/* Keep your existing link styles */
#userMenuDropdown .menu-header {
      font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    padding: 6px 12px;
}

#userMenuDropdown .menu-item {
  display: flex;
    align-items: center;
        justify-content: space-between;
    padding: 10px 12px;
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 14px;
}
#userMenuDropdown .menu-item:hover, #userMenuDropdown .menu-item:focus {
  background: #e9eafb69;
  text-decoration: none;
  color: var(--main-color) !important;
  outline: none;
  border: none;
}

.user-menu:hover .btn-user {
   color: var(--main-color) !important;
   background: rgba(95, 109, 226, .15);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Animate dropdown items (top → down) */
#userMenuDropdown > * {
  animation: fadeDown .24s ease-in-out both;
  will-change: opacity, transform;
}

#userMenuDropdown > *:nth-child(1)  { animation-delay: 0ms; }
#userMenuDropdown > *:nth-child(2)  { animation-delay: 15ms; }
#userMenuDropdown > *:nth-child(3)  { animation-delay: 30ms; }
#userMenuDropdown > *:nth-child(4)  { animation-delay: 45ms; }
#userMenuDropdown > *:nth-child(5)  { animation-delay: 60ms; }
#userMenuDropdown > *:nth-child(6)  { animation-delay: 75ms; }
#userMenuDropdown > *:nth-child(7)  { animation-delay: 90ms; }
#userMenuDropdown > *:nth-child(8)  { animation-delay: 105ms; }
#userMenuDropdown > *:nth-child(9)  { animation-delay: 120ms; }
#userMenuDropdown > *:nth-child(10) { animation-delay: 135ms; }
#userMenuDropdown > *:nth-child(11) { animation-delay: 150ms; }
#userMenuDropdown > *:nth-child(12) { animation-delay: 165ms; }
#userMenuDropdown > *:nth-child(13) { animation-delay: 180ms; }
#userMenuDropdown > *:nth-child(14) { animation-delay: 195ms; }
#userMenuDropdown > *:nth-child(15) { animation-delay: 210ms; }
#userMenuDropdown > *:nth-child(16) { animation-delay: 225ms; }
#userMenuDropdown > *:nth-child(17) { animation-delay: 240ms; }
#userMenuDropdown > *:nth-child(18) { animation-delay: 255ms; }
#userMenuDropdown > *:nth-child(19) { animation-delay: 270ms; }
#userMenuDropdown > *:nth-child(20) { animation-delay: 285ms; }

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  #userMenuDropdown > * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Upgrade panel in user menu */

/* Upgrade card inside the user menu */
#userMenuDropdown .upgrade-card {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(90deg, #606cdf 0%, #7f86e3 45%, #9d9dff 100%);
    border-radius: 10px;
    padding: 1rem;
    margin: 8px 12px;
   transition: transform .22s ease-in-out;
}

/* text block */
#userMenuDropdown .upgrade-content {
  display: flex;
  min-width: 0;
  color: white;
}

#userMenuDropdown .upgrade-content .bi {
  font-size: 1.25rem;
  line-height: 1;
  color: white;
  margin-right: 0.5rem;
}

#userMenuDropdown .upgrade-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: white;
}

/* chevron */
#userMenuDropdown .upgrade-chevron {
  margin-left: auto;
  font-size: 1rem;
  opacity: .75;
  color: white;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #userMenuDropdown .upgrade-card {
    transition: none;
  }
}

/* Mobile: stretch full width */
@media (max-width: 768px) {
  #userMenuDropdown {
    z-index: 9999;
    position: fixed;
    inset: calc(var(--header-h, 64px) + env(safe-area-inset-top)) 0 0 0;
    width: 100vw;
    min-width: 0;
    border-radius: 0;
    max-height: calc(100vh - var(--header-h, 64px) - env(safe-area-inset-top));
    margin-top: 0;
    padding-bottom: 3rem;
  }

  #userMenuDropdown .menu-item{
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }

  #userMenuDropdown .menu-header{
    padding: 1rem 1rem 0.5rem;
  }

  .user-menu {
    margin-left: auto;
  }
}
