/* ═══════════════════════════════════════════════════════════
   KS Content Access — Header User Menu
   Injected into .ks-header__actions
   ═══════════════════════════════════════════════════════════ */

.ksca-uh {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: "Futura", "Cairo", sans-serif;
}

/* ── Logged-OUT: login icon button ─────────────────── */
.ksca-uh-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(115, 138, 167, .35);
  background: transparent;
  color: #738aa7;
  cursor: pointer;
  text-decoration: none;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.ksca-uh-login:hover {
  background: #738aa7;
  color: #fff;
  border-color: #738aa7;
  transform: translateY(-1px);
}
.ksca-uh-login svg { width: 19px; height: 19px; }

/* ── Logged-IN: avatar + name button ───────────────── */
.ksca-uh-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border: 1.5px solid rgba(115, 138, 167, .25);
  border-radius: 999px;
  background: #fff;
  color: #545454;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .18s, box-shadow .2s, transform .15s;
}
[dir="rtl"] .ksca-uh-btn { padding: 5px 5px 5px 12px; }
.ksca-uh-btn:hover {
  border-color: rgba(115, 138, 167, .55);
  box-shadow: 0 4px 14px rgba(115, 138, 167, .16);
  transform: translateY(-1px);
}

.ksca-uh-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #738aa7, #5c7592);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.ksca-uh-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ksca-uh-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ksca-uh-caret {
  width: 12px;
  height: 12px;
  stroke: #738aa7;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  transition: transform .25s;
  flex-shrink: 0;
}
.ksca-uh.is-open .ksca-uh-caret { transform: rotate(180deg); }

/* ── Dropdown ──────────────────────────────────────── */
.ksca-uh-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #E5E0D4;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(52, 44, 44, .06), 0 24px 48px -12px rgba(115, 138, 167, .28);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.97);
  transform-origin: top right;
  transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1), visibility 0s linear .2s;
  z-index: 9999;
}
[dir="rtl"] .ksca-uh-menu { transform-origin: top left; }
.ksca-uh.is-open .ksca-uh-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.ksca-uh-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid #F0EBDF;
  margin-bottom: 6px;
}
.ksca-uh-head .ksca-uh-avatar { width: 38px; height: 38px; font-size: 15px; }
.ksca-uh-head-info { overflow: hidden; }
.ksca-uh-head-name { font-size: 13.5px; font-weight: 600; color: #342C2C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ksca-uh-head-email { font-size: 11.5px; color: #94A3B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ksca-uh-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #545454;
  text-decoration: none;
  transition: background .15s, color .15s;
  cursor: pointer;
}
.ksca-uh-item:hover { background: #F4ECDC; color: #342C2C; }
.ksca-uh-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .7; }
.ksca-uh-item.is-logout { color: #C55A5A; }
.ksca-uh-item.is-logout:hover { background: #FEF3F3; }

/* Responsive */
@media (max-width: 768px) {
  .ksca-uh-name { display: none; }
  .ksca-uh-btn { padding: 5px; }
  [dir="rtl"] .ksca-uh-btn { padding: 5px; }
  .ksca-uh-caret { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ksca-uh-menu, .ksca-uh-caret { transition: none !important; }
}
