/* =========================================================
   AConfession Header SVG UI
   Path: public_html/assets/css/header-svg.css
   Scope: top header only.
   Notes: fixed-size SVG icons + non-overlapping mobile header.
   ========================================================= */

.app-topbar.acf-svg-topbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 120 !important;
  isolation: isolate;
  height: calc(52px + env(safe-area-inset-top)) !important;
  min-height: calc(52px + env(safe-area-inset-top)) !important;
  padding: env(safe-area-inset-top) 10px 0 !important;
  display: block !important;
  border-bottom: 1px solid rgba(255,255,255,.075);
  background: rgba(7,10,18,.93);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  overflow: visible;
}

.acf-svg-topbar *,
.acf-header-menu * {
  box-sizing: border-box;
}

/* Brand: fixed right block. Logo is optional and never reserves space when missing. */
.acf-svg-topbar .acf-header-brand {
  position: absolute !important;
  right: 10px;
  left: auto;
  top: env(safe-area-inset-top);
  height: 52px;
  width: 176px;
  max-width: 176px !important;
  min-width: 0;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  direction: rtl;
  overflow: hidden;
  z-index: 3;
  order: initial !important;
}

.acf-svg-topbar .acf-header-brand.no-logo {
  width: 156px;
  max-width: 156px !important;
}

.acf-header-logo {
  flex: 0 0 30px;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(255,255,255,.13);
  background:
    radial-gradient(circle at 50% 15%, rgba(124,58,237,.18), transparent 58%),
    rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}

.acf-header-logo img,
.acf-header-logo .acf-header-svg-img {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  object-fit: contain !important;
  display: block !important;
}

.acf-svg-topbar .brand-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 1px;
  text-align: right;
  overflow: hidden;
}

.acf-svg-topbar .brand-copy b {
  display: block;
  width: 100%;
  max-width: 100% !important;
  margin: 0;
  color: #fff;
  font-size: 13.1px;
  font-weight: 950;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acf-svg-topbar .brand-copy small {
  display: block;
  width: 100%;
  max-width: 100% !important;
  margin: 0;
  color: #9aa7bd;
  font-size: 8.6px;
  font-weight: 750;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Center menu button: fixed size icon button, never follows SVG intrinsic size. */
.acf-header-menu-toggle {
  position: absolute !important;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 8px);
  transform: translateX(-50%);
  z-index: 4;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  padding: 0 !important;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.13);
  background:
    radial-gradient(circle at 50% 12%, rgba(6,182,212,.19), transparent 57%),
    rgba(255,255,255,.050);
  color: #e5f6ff;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 10px 24px rgba(0,0,0,.20);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.acf-header-menu-toggle:active {
  transform: translateX(-50%) scale(.94);
}

.acf-header-menu-toggle[aria-expanded="true"] {
  border-color: rgba(6,182,212,.38);
  background:
    radial-gradient(circle at 50% 18%, rgba(124,58,237,.27), transparent 60%),
    rgba(6,182,212,.10);
}

.acf-menu-ico,
.acf-menu-fallback,
.acf-header-menu-toggle .acf-header-svg-img {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block !important;
  object-fit: contain !important;
}

.acf-menu-fallback {
  font-size: 18px;
  line-height: 16px;
  text-align: center;
  font-weight: 950;
  color: #dbeafe;
}

.acf-header-menu-toggle .acf-menu-ico-up,
.acf-header-menu-toggle .acf-menu-fallback.acf-menu-ico-up {
  display: none !important;
}

.acf-header-menu-toggle[aria-expanded="true"] .acf-menu-ico-down,
.acf-header-menu-toggle[aria-expanded="true"] .acf-menu-fallback.acf-menu-ico-down {
  display: none !important;
}

.acf-header-menu-toggle[aria-expanded="true"] .acf-menu-ico-up,
.acf-header-menu-toggle[aria-expanded="true"] .acf-menu-fallback.acf-menu-ico-up {
  display: block !important;
}

/* Left actions: fixed icon buttons. SVGs are icons, not images with their own dimensions. */
.acf-svg-topbar .acf-header-actions {
  position: absolute !important;
  left: 10px;
  right: auto;
  top: env(safe-area-inset-top);
  height: 52px;
  max-width: 166px;
  display: inline-flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  direction: ltr;
  min-width: 0;
  overflow: visible;
  z-index: 5;
  order: initial !important;
}

.acf-header-icon-btn,
.acf-header-login,
.acf-svg-topbar .acf-header-user-chip {
  flex: 0 0 auto;
  border-color: rgba(255,255,255,.13) !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.080), rgba(255,255,255,.038)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  overflow: visible;
}

.acf-header-icon-btn {
  position: relative;
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid !important;
  place-items: center;
}

.acf-header-icon-btn img,
.acf-header-icon-btn .acf-header-svg-img,
.acf-header-login img,
.acf-header-login .acf-header-svg-img {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  object-fit: contain !important;
  display: block !important;
  flex: 0 0 18px;
}

.acf-header-icon-btn .acf-header-fallback {
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  color: #dbeafe;
}

.acf-header-icon-btn em {
  inset: -5px auto auto -4px !important;
  min-width: 16px !important;
  height: 16px !important;
  border-radius: 999px;
  border: 2px solid #080b14;
  font-size: 9px !important;
  font-weight: 950;
  z-index: 7;
}

.acf-header-login {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  min-width: 0;
  max-width: 132px;
  padding: 0 10px !important;
  gap: 6px;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 950;
  font-size: 11.5px;
  white-space: nowrap;
}

.acf-header-login span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.acf-svg-topbar .acf-header-user-chip {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  max-width: 72px !important;
  padding: 0 9px !important;
  border-radius: 999px !important;
  color: #eaf2ff;
  font-size: 11.5px;
  font-weight: 950;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden !important;
  text-overflow: ellipsis;
}

/* Drop-down header links */
.acf-header-menu {
  position: sticky;
  top: calc(52px + env(safe-area-inset-top));
  z-index: 116;
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(255,255,255,.075);
  background:
    radial-gradient(220px 80px at 50% 0, rgba(6,182,212,.13), transparent 75%),
    rgba(7,10,18,.95);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  animation: acfHeaderMenuIn .18s ease both;
}

.acf-header-menu[hidden] {
  display: none !important;
}

.acf-header-menu::-webkit-scrollbar {
  display: none;
}

.acf-header-menu a {
  flex: 0 0 auto;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.045);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 850;
  white-space: nowrap;
}

.acf-header-menu a:active {
  transform: scale(.98);
}

.mobile-shell.is-header-menu-open .app-content {
  padding-top: 10px;
}

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

@media (max-width: 400px) {
  .app-topbar.acf-svg-topbar {
    height: calc(50px + env(safe-area-inset-top)) !important;
    min-height: calc(50px + env(safe-area-inset-top)) !important;
    padding-inline: 8px !important;
  }

  .acf-svg-topbar .acf-header-brand {
    right: 8px;
    height: 50px;
    width: 156px;
    max-width: 156px !important;
    gap: 6px;
  }

  .acf-svg-topbar .acf-header-brand.no-logo {
    width: 136px;
    max-width: 136px !important;
  }

  .acf-header-logo {
    flex-basis: 28px;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    border-radius: 12px;
  }

  .acf-header-logo img,
  .acf-header-logo .acf-header-svg-img {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
  }

  .acf-svg-topbar .brand-copy b {
    font-size: 12.4px;
  }

  .acf-svg-topbar .brand-copy small {
    font-size: 8.1px;
  }

  .acf-header-menu-toggle {
    top: calc(env(safe-area-inset-top) + 7px);
    width: 35px !important;
    height: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    min-height: 35px !important;
    max-height: 35px !important;
  }

  .acf-svg-topbar .acf-header-actions {
    left: 8px;
    height: 50px;
    max-width: 150px;
    gap: 4px;
  }

  .acf-header-icon-btn {
    width: 31px !important;
    min-width: 31px !important;
    max-width: 31px !important;
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
  }

  .acf-svg-topbar .acf-header-user-chip {
    max-width: 64px !important;
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    padding-inline: 8px !important;
  }

  .acf-header-login {
    height: 31px !important;
    min-height: 31px !important;
    max-height: 31px !important;
    max-width: 118px;
    padding-inline: 9px !important;
  }

  .acf-header-menu {
    top: calc(50px + env(safe-area-inset-top));
    padding-inline: 8px;
  }
}

@media (max-width: 350px) {
  .acf-svg-topbar .acf-header-brand {
    width: 130px;
    max-width: 130px !important;
  }

  .acf-svg-topbar .acf-header-brand.has-svg-logo {
    width: 140px;
    max-width: 140px !important;
  }

  .acf-svg-topbar .brand-copy small {
    display: none;
  }

  .acf-svg-topbar .acf-header-actions {
    max-width: 132px;
  }

  .acf-svg-topbar .acf-header-user-chip {
    max-width: 56px !important;
  }

  .acf-header-login span {
    max-width: 65px;
  }
}
