/* Vercetti unified top bar — 56px, dark neon.
   Replaces each tool's ad-hoc topbar. */

/* Reserve space at the top of every page for the bar */
body.vpb-active {
  padding-top: calc(56px + env(safe-area-inset-top)) !important;
  box-sizing: border-box;
}

#vpb-root {
  padding-top: env(safe-area-inset-top);
  height: calc(56px + env(safe-area-inset-top));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999998;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) 14px 0 14px;
  background: linear-gradient(180deg, rgba(10, 2, 30, 0.97) 0%, rgba(14, 3, 48, 0.92) 100%);
  border-bottom: 1px solid rgba(255, 44, 177, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 40px rgba(255, 44, 177, 0.06);
}

.vpb-title {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  min-width: 0;
  flex: 1;
}
.vpb-title-brand {
  font-family: 'Audiowide', 'Inter', sans-serif;
  font-size: 15px;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ff2cb1, #2cd2ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  white-space: nowrap;
}
.vpb-title-sep {
  color: rgba(255, 255, 255, 0.25);
  font-size: 14px;
}
.vpb-title-page {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vpb-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.vpb-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  height: 36px;
  border-radius: 999px;
  background: rgba(20, 6, 60, 0.85);
  border: 1px solid rgba(255, 44, 177, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  outline: none;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}
.vpb-pill:hover  { border-color: rgba(255, 44, 177, 0.7); box-shadow: 0 4px 16px rgba(255, 44, 177, 0.25); }
.vpb-pill:active { transform: translateY(1px); }
.vpb-pill[aria-expanded="true"] { border-color: rgba(44, 210, 255, 0.7); box-shadow: 0 0 16px rgba(44, 210, 255, 0.3); }

.vpb-tools .vpb-pill-lbl {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}
.vpb-caret {
  font-size: 14px;
  color: #2cd2ff;
  line-height: 1;
}
.vpb-menu {
  padding: 0 12px;
  min-width: 42px;
  justify-content: center;
}
.vpb-dots {
  font-size: 18px;
  letter-spacing: 2px;
  line-height: 1;
  color: #ff2cb1;
}

/* ---------- Dropdown ---------- */
.vpb-drop {
  position: fixed;
  top: 62px;
  right: 12px;
  min-width: 240px;
  max-width: 300px;
  background: rgba(14, 3, 48, 0.98);
  border: 1px solid rgba(255, 44, 177, 0.38);
  border-radius: 16px;
  padding: 8px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 32px rgba(255, 44, 177, 0.15);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  z-index: 999999;
}
.vpb-drop.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.vpb-drop-tools { right: 62px; }  /* left of the ••• drop position */

.vpb-drop-hd {
  padding: 6px 10px 4px;
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
}

.vpb-mi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .1s ease;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.vpb-mi:hover { background: rgba(255, 44, 177, 0.12); }
.vpb-mi[data-disabled="1"] { opacity: 0.4; cursor: not-allowed; }
.vpb-mi.locked { opacity: 0.55; }
.vpb-mi.soon   { opacity: 0.55; }
.vpb-mi.danger { color: #ff5d7a; }
.vpb-mi.danger:hover { background: rgba(255, 93, 122, 0.15); }

.vpb-lbl { flex: 1; }
.vpb-num {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(44, 210, 255, 0.16);
  color: #2cd2ff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.vpb-tag {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.vpb-tag.lock { background: rgba(255, 93, 122, 0.18); color: #ff8fa3; }

.vpb-sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 4px;
}

.vpb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 44, 177, 0.14), rgba(44, 210, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.vpb-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff2cb1, #2cd2ff);
  color: #0e0330;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.vpb-uwrap { display: flex; flex-direction: column; }
.vpb-uname { font-size: 13px; font-weight: 600; }
.vpb-urole {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

/* ---------- Toast ---------- */
#vpb-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(14, 3, 48, 0.96);
  border: 1px solid rgba(255, 44, 177, 0.4);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999999;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  font-family: 'Inter', sans-serif;
}
#vpb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Hide each tool's built-in topbar (title now lives in ours) ---------- */
body.vpb-active .topbar { display: none !important; }
body.vpb-active .hub-topbar { display: none !important; }
body.vpb-active .sms-topbar,
body.vpb-active .app-topbar { display: none !important; }
/* Wizard header block */
body.vpb-active .drnr-topbar,
body.vpb-active .drnr-header,
body.vpb-active #drnr-topbar { display: none !important; }

/* ---------- Mobile: kill dialer sidebar; bar becomes primary nav ---------- */
@media (max-width: 880px) {
  body.dialer-app .sidebar { display: none !important; }
  body.dialer-app .main    { margin-left: 0 !important; }
  .vpb-title-brand { font-size: 13px; letter-spacing: 2px; }
  .vpb-title-sep   { display: none; }
  .vpb-title-page  { display: none; }
  .vpb-pill { height: 34px; padding: 6px 12px; font-size: 12px; }
  .vpb-tools .vpb-pill-lbl { max-width: 90px; }
  .vpb-drop { min-width: 220px; max-width: calc(100vw - 24px); right: 8px; }
  .vpb-drop-tools { right: 8px; }
}

/* Hide during in-call mode */
body.in-call-mode #vpb-root { display: none; }
body.in-call-mode { padding-top: 0 !important; }
