/* ============================================================
   تدريب — header account corner ([tadreab_account])
   The menu is a <details> element so it needs no JavaScript.
   Namespaced under .tqm-account so it can't collide with a theme.
   ============================================================ */

.tqm-account {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

/* ---- the profile button ----
   Inherits .tdb-btn from the theme's own CSS for padding, radius and
   typography, then overrides only the colours so it reads as a white
   button sitting beside the blue primary one. */

.tqm-account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: #10161f;
  border: 1.5px solid #d5d8dd;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* kill the default disclosure triangle in every engine */
.tqm-account-trigger::-webkit-details-marker { display: none; }
.tqm-account-trigger::marker { content: ""; }

.tqm-account-trigger:hover {
  border-color: #1b4fa0;
  color: #1b4fa0;
  box-shadow: 0 8px 18px rgba(27, 79, 160, 0.16);
  transform: translateY(-2px);
}

.tqm-account-trigger:focus-visible {
  outline: 2px solid #1b4fa0;
  outline-offset: 2px;
}

.tqm-account-icon { flex: none; }

.tqm-account-caret {
  width: 0;
  height: 0;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-bottom-width: 0;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.tqm-account[open] .tqm-account-caret {
  transform: rotate(180deg);
}

/* ---- the dropdown ---- */

.tqm-account-menu {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-start: 0;
  min-width: 200px;
  z-index: 120;
  background: #fff;
  border: 1px solid #e3e5e9;
  border-radius: 12px;
  box-shadow: 0 18px 40px -12px rgba(16, 22, 31, 0.28);
  padding: 8px;
  direction: rtl;
  text-align: right;
}

.tqm-account-name {
  margin: 0;
  padding: 8px 10px 10px;
  border-bottom: 1px solid #eef0f2;
  font-size: 0.82rem;
  font-weight: 700;
  color: #10161f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tqm-account-menu a {
  display: block;
  padding: 9px 10px;
  margin-top: 2px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #46505d;
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.tqm-account-menu a:hover {
  background: #e9eff8;
  color: #123870;
}

.tqm-account-logout {
  margin-top: 6px !important;
  border-top: 1px solid #eef0f2;
  border-radius: 0 0 8px 8px !important;
  color: #8c2020 !important;
}

.tqm-account-logout:hover {
  background: #fdecec !important;
  color: #6d1919 !important;
}

/* ---- mobile ----
   The button keeps its dropdown rather than collapsing into the burger:
   account actions and site navigation are different things, and burying
   "log out" inside a nav menu is where people go looking for it last. */

@media (max-width: 720px) {
  .tqm-account-trigger {
    padding-inline: 14px;
  }
}

@media (max-width: 560px) {
  .tqm-account-trigger {
    padding: 9px 12px;
    font-size: 13px;
    gap: 5px;
  }

  /* label collapses to just the icon so the header still fits */
  .tqm-account-label { display: none; }

  .tqm-account-icon { width: 18px; height: 18px; }

  .tqm-account-menu {
    min-width: 190px;
    /* anchored to the start edge it would hang off a narrow screen */
    inset-inline-start: auto;
    inset-inline-end: 0;
  }
}

@media (max-width: 400px) {
  .tqm-account-menu { min-width: 170px; }
}
