/* ============================================================
   ARIO — 02 HEADER
   Site Header · Brand (logo only) · Nav Links · Register Button
   User Dropdown Menu · Nav User Name
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(232, 236, 243, .8);
  will-change: transform;
  isolation: isolate;
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, var(--blue-500) 30%, var(--yellow-500) 50%,
    var(--blue-500) 70%, transparent 100%);
  background-size: 200% 100%;
  animation: headerRainbow 6s linear infinite;
  opacity: .55;
}
@keyframes headerRainbow { to { background-position: 200% 0; } }

/* ============================================================
   NAV — logo · links (near logo) · actions
   ============================================================ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.0rem;
  height: 96px;
}

/* ---------- Brand (logo only) ---------- */
.brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.brand-logo-ring {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg,
      #3b82f6 0%, #60a5fa 25%, #F59E0B 50%, #60a5fa 75%, #3b82f6 100%);
  background-size: 300% 300%;
  animation: logoRingFlow 7s ease infinite;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(59, 130, 246, .32), 0 0 0 3px rgba(255, 255, 255, .95);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1), box-shadow .4s;
  flex-shrink: 0;
}
@keyframes logoRingFlow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.brand-logo-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px dashed rgba(59, 130, 246, .45);
  animation: ringSpin 20s linear infinite;
  pointer-events: none;
}

@keyframes ringSpin { to { transform: rotate(360deg); } }

.brand-logo {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #ffffff;
  object-fit: contain;
  padding: 2px;
  transform: scale(1.15);
  transition: transform .4s cubic-bezier(.4, 0, .2, 1);
  display: block;
}
.brand:hover .brand-logo-ring {
  transform: scale(1.06);
  box-shadow:
    0 14px 34px rgba(59, 130, 246, .48),
    0 0 0 3px rgba(255, 255, 255, .95),
    0 0 0 8px rgba(59, 130, 246, .14);
}
.brand:hover .brand-logo { transform: scale(1.22); }

/* ============================================================
   NAV LINKS — packed close to the logo
   ============================================================ */
.nav-links {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  justify-content: flex-start;
  flex-wrap: nowrap;
  padding-inline-start: .35rem;
}

.nav-link {
  font-family: var(--font-fa);
  font-weight: 700;
  color: var(--text-soft);
  font-size: .88rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 12px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .5);
  border: 1.5px solid rgba(232, 236, 243, .95);
  transition: all .3s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
  line-height: 1.2;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, .12),
    rgba(245, 158, 11, .08) 60%, transparent);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  border-radius: inherit;
}
.nav-link:hover {
  color: var(--blue-700);
  background: #fff;
  border-color: rgba(59, 130, 246, .3);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(59, 130, 246, .18), inset 0 1px 0 rgba(255, 255, 255, 1);
}
.nav-link:hover::before { opacity: 1; }
.nav-link > * { position: relative; z-index: 1; }

.nav-actions { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }

/* Legacy nav-user classes kept for backward-compat but hidden */
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .55rem .35rem 1rem !important;
  border-radius: 100px !important;
  font-size: .88rem !important;
}
.nav-user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
  display: grid; place-items: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: .82rem;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, .5);
}

/* ---------- Register Button — Solid Blue + hover shine ---------- */
.btn-register {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem !important;
  font-family: var(--font-fa) !important;
  font-size: .88rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  line-height: 1.2;
  color: #fff !important;
  background: #3b82f6;
  border: none;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  overflow: hidden;
  z-index: 1;
  transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .35s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn-register::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
    transparent 30%,
    rgba(255, 255, 255, .55) 50%,
    transparent 70%);
  transform: translateX(-100%);
  transition: transform .75s;
  pointer-events: none;
}
.btn-register:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(59, 130, 246, .55), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-register:hover::before { transform: translateX(100%); }

/* ============================================================
   USER DROPDOWN MENU
   ============================================================ */
.nav-user-dropdown {
  position: relative;
  display: inline-block;
}

.nav-user-caret {
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  opacity: .85;
  flex-shrink: 0;
}
.nav-user-dropdown.is-open .nav-user-caret,
.nav-user[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
}

.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 170px;
  padding: .3rem;
  border-radius: 12px;
  background: #fff;
  border: 1.5px solid var(--border);
  box-shadow:
    0 14px 34px rgba(15, 23, 42, .14),
    0 0 0 1px rgba(255, 255, 255, .7) inset;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(.97);
  transform-origin: top left;
  transition: opacity .22s, transform .25s, visibility .25s;
  z-index: 999;
}
.nav-user-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.nav-user-menu::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 16px;
  width: 9px;
  height: 9px;
  background: #fff;
  border-left: 1.5px solid var(--border);
  border-top: 1.5px solid var(--border);
  transform: rotate(45deg);
  border-top-left-radius: 2px;
}

.nav-user-menu-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .7rem;
  border-radius: 9px;
  font-family: var(--font-fa);
  font-size: .82rem;
  font-weight: 700;
  color: var(--ink-700);
  text-decoration: none;
  transition: background .2s, color .2s, transform .2s;
  position: relative;
  z-index: 1;
  line-height: 1.3;
}
.nav-user-menu-item svg {
  width: 14px;
  height: 14px;
  color: var(--text-soft);
  flex-shrink: 0;
  transition: color .2s, transform .25s;
}
.nav-user-menu-item:hover {
  background: linear-gradient(135deg, rgba(59, 130, 246, .1), rgba(124, 58, 237, .07));
  color: var(--blue-700);
  transform: translateX(-2px);
}
.nav-user-menu-item:hover svg {
  color: var(--blue-500);
  transform: scale(1.1);
}

.nav-user-menu-divider {
  height: 1px;
  margin: .25rem .4rem;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, .25), transparent);
}

.nav-user-menu-item-danger { color: #b91c1c; }
.nav-user-menu-item-danger svg { color: #dc2626; }
.nav-user-menu-item-danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, .12), rgba(239, 68, 68, .06));
  color: #991b1b;
}
.nav-user-menu-item-danger:hover svg { color: #dc2626; }

/* موبایل: منو عرض کامل */
@media (max-width: 480px) {
  .nav-user-menu {
    min-width: 160px;
    left: auto;
    right: 0;
    transform-origin: top right;
  }
  .nav-user-menu::before {
    left: auto;
    right: 16px;
  }
}

/* ============================================================
   NAV USER — هم‌اندازه nav-link
   ============================================================ */

.nav-user-btn .nav-user-avatar-ring,
.nav-user-btn .nav-user-avatar-glow {
  display: none !important;
}

.nav-user-btn {
  font-family: var(--font-fa);
  font-weight: 700;
  color: var(--text-soft);
  font-size: .88rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 12px;
  white-space: nowrap;
  background: rgba(255, 255, 255, .5);
  border: 1.5px solid rgba(232, 236, 243, .95);
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  overflow: hidden;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
  min-height: 0;
  width: auto;
  height: auto;
}

.nav-user-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(120deg,
    transparent,
    rgba(147, 197, 253, .55) 50%,
    transparent);
  transform: skewX(-20deg);
  transition: left .7s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
  z-index: 0;
}

.nav-user-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(59, 130, 246, .12),
    rgba(245, 158, 11, .08) 60%, transparent);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  border-radius: inherit;
  z-index: 0;
}

.nav-user-btn > * { position: relative; z-index: 1; }

.nav-user-btn:hover {
  color: var(--blue-700);
  background: #fff;
  border-color: rgba(59, 130, 246, .35);
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(59, 130, 246, .18),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.nav-user-btn:hover::before { left: 160%; }
.nav-user-btn:hover::after  { opacity: 1; }

.nav-user-btn:active { transform: translateY(0) scale(.98); }

.nav-user-btn[aria-expanded="true"] {
  color: var(--blue-700);
  background: #fff;
  border-color: rgba(59, 130, 246, .45);
  box-shadow:
    0 10px 24px rgba(59, 130, 246, .2),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}
.nav-user-btn[aria-expanded="true"]::after { opacity: 1; }

/* Persian user name */
.nav-user-name {
  display: inline-block !important;
  font-family: var(--font-fa) !important;
  font-size: .88rem !important;
  font-weight: 800 !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  max-width: 220px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  position: relative !important;
  z-index: 1 !important;
  padding: 0 !important;
  margin: 0 !important;

  background: linear-gradient(
    120deg,
    #1d4ed8 0%,
    #7c3aed 35%,
    #ec4899 60%,
    #f59e0b 85%,
    #1d4ed8 100%) !important;
  background-size: 250% auto !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
  animation: navNameFlow 7s linear infinite !important;
}

@keyframes navNameFlow {
  0%   { background-position:   0% center; }
  100% { background-position: 250% center; }
}

/* Small caret */
.nav-user-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--text-soft);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), color .25s;
}
.nav-user-caret svg { width: 10px; height: 10px; }

.nav-user-btn[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
  color: var(--blue-600);
}