/**
 * PhotoXED Liquid Glass System
 * Darker header + footer enforced.
 * All glass surfaces use backdrop-filter + subtle borders.
 */

.px-glass {
  background: var(--bg-glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

/* Header — darker per spec, fixed like footer (sticky breaks under overflow-x:hidden on html/body) */
body.px-app .px-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-glass-strong);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: saturate(200%) blur(32px);
  -webkit-backdrop-filter: saturate(200%) blur(32px);
  padding: var(--safe-top) max(12px, var(--safe-right)) 0 max(12px, var(--safe-left));
  height: var(--header-height);
  min-height: unset;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.px-header-right {
  display: flex;
  align-items: center;
}

body.px-app {
  padding-top: var(--header-height);
}

.px-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#pxHeaderLogo {
  cursor: pointer;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--px-text-primary, #f5f5f7);
  transition: transform 0.2s cubic-bezier(0.23, 1, 0.32, 1);
}

#pxHeaderLogo:hover {
  transform: scale(1.1);
}

.px-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Header Auth buttons (Enter / Exit) */
.px-header-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  font-weight: 700;
  padding: 11.5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--tx);
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.px-header-auth-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.px-header-auth-btn:active {
  background: rgba(255, 255, 255, 0.22);
}

.px-brand {
  display: flex;
  align-items: center;
  /* Reset any old text gradient/weavy styles */
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  animation: none;
}

.px-brand-logo {
  height: 19px;
  width: auto;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}

/* Footer — Modern iOS/Swift-style glass segmented tabs */
body.px-app .px-footer {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 1000;
  isolation: isolate;
  background: var(--chrome-glass-bg);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: var(--chrome-glass-filter);
  -webkit-backdrop-filter: var(--chrome-glass-filter);
  padding-bottom: var(--safe-bottom);
  padding-top: 0;
  height: var(--segbar-height);
  min-height: unset;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.px-segbar {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  width: 100%;
  height: var(--chrome-bar-height);
  min-height: var(--chrome-bar-height);
  box-sizing: border-box;
  padding: 6px 12px;
}

.px-seg {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 5px 8px;
  min-width: 0;
  min-height: 0;
  height: auto;
  align-self: stretch;
  box-sizing: border-box;
  color: var(--tx3);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.2px;
  border-radius: 10px;
  transition:
    color 220ms var(--ease),
    background-color 160ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.px-seg .ic {
  --ic-size: 25px;
  flex: 0 0 25px;
  margin: 0;
  transform: none;
  opacity: 0.75;
}

.px-seg > span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 11px;
  height: 11px;
  margin: 0;
  padding: 0;
  line-height: 1;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.px-seg.active {
  color: var(--tx);
  background: rgba(255, 255, 255, 0.10);
  padding: 5px 8px;
}

.px-seg.active .ic {
  opacity: 1;
  transform: none;
}

.px-seg:active {
  opacity: 0.72;
  transition: opacity 60ms linear;
}

/* Cards & surfaces */
.px-card {
  background: var(--bg-glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Message sheet base (detailed in templates/msg-sheet.css) */
.px-ms-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--chrome-glass-bg);
  backdrop-filter: var(--chrome-glass-filter);
  -webkit-backdrop-filter: var(--chrome-glass-filter);
  opacity: 0;
  transition: opacity 420ms var(--ease-out);
  pointer-events: auto;
}

.px-ms {
  position: fixed;
  top: var(--header-height, 0px);
  left: 0;
  right: 0;
  bottom: var(--sheet-bottom, var(--segbar-height));
  z-index: 210;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0.7rem;
  pointer-events: none;
}

.px-ms[aria-hidden="false"] {
  pointer-events: auto;
}

.px-ms-backdrop,
.px-msCard {
  pointer-events: auto;
}

@media (min-width: 768px) {
  .px-ms {
    align-items: flex-end;
    padding: 0 0.7rem;             /* keep consistent side margins on tablet */
  }

  .px-brand-logo {
    height: 24px;
  }
}