/*
 * PromptShare: the shared site chrome on this page (nav, promo strip, footer, shared upgrade modal).
 *
 * PORTED from soundlabs/css/chrome.css (owner-approved, shipped) with three mechanical changes, recorded here
 * because a port nobody can audit is a copy nobody trusts:
 *   1. the page fence `body.soundlabs-page` → `body.promptshare-page`;
 *   2. the app fence `.sl-app/.sl-layer/.sl-seo` → `.ps-app/.ps-layer/.ps-landing`;
 *   3. SoundLabs' two `display:none` rules for `.nav-links` and `.auth-buttons` are NOT ported — D8.2 gives
 *      PromptShare the whole shared nav, for guests and members alike.
 *   4. The Prompt Keeper launcher is hidden ON THIS PAGE (see the rule at the end of this file). D8.2: "Ask
 *      Keeper = a sidebar row + a ⌘K entry, never a floating bubble over the app… Page-scoped CSS only."
 *      Round 3's occlusion property found the bubble painted over the phone FAB — the only New prompt a phone
 *      has. The widget itself is untouched; the rail row and the palette entry still open it.
 * Everything else is byte-for-byte what SoundLabs ships, so the nav, footer and upgrade modal render on this
 * page exactly as they do on that one, with no Bootstrap and no inline nav re-skin. Do not add app styles here.
 */

:root {
  --bg-primary: #0D0C1D;
  --bg-secondary: rgba(255, 255, 255, 0.05);
  --bg-tertiary: rgba(255, 255, 255, 0.08);
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --text-muted: #6B7280;
  --text-color: #E5E7EB;
  --border-color: rgba(255, 255, 255, 0.1);
  --primary-color: #8B5CF6;
  --secondary-color: #EC4899;
  --success-color: #10B981;
  --error-color: #EF4444;
  --transition: 0.3s ease;
  --transition-speed: 0.3s;
  --glass-background: rgba(255, 255, 255, 0.05);
  --glass-background-hover: rgba(255, 255, 255, 0.08);
}

:where(body.promptshare-page) :where(:not(.ps-app, .ps-app *, .ps-layer, .ps-layer *, .ps-landing, .ps-landing *)) {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html:has(body.promptshare-page),
body.promptshare-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.promptshare-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

:where(body.promptshare-page) a:where(:not(.ps-app *, .ps-layer *, .ps-landing *)) {
  color: inherit;
  text-decoration: none;
}

:where(body.promptshare-page) :where(button, input, select, textarea):where(:not(.ps-app *, .ps-layer *, .ps-landing *)):focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ---- Navigation ---- */
:where(body.promptshare-page) .nav-container {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #0D0C1D !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}

:where(body.promptshare-page) .nav-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: 4rem;
  background-color: #0D0C1D !important;
}


:where(body.promptshare-page) .nav-link {
  padding: 0.5rem 0.75rem;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 0.375rem;
  transition: background-color var(--transition-speed), color var(--transition-speed);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

:where(body.promptshare-page) .nav-link:hover {
  background-color: var(--glass-background-hover);
  color: var(--text-color);
}

:where(body.promptshare-page) .nav-link.active { background-color: rgba(255, 255, 255, 0.08); }

:where(body.promptshare-page) .nav-item.nav-dropdown { position: relative; display: inline-block; }
:where(body.promptshare-page) .nav-dropdown-toggle { cursor: pointer; }

:where(body.promptshare-page) .dropdown-arrow {
  margin-left: 0.4em;
  font-size: 0.7em;
  transition: transform var(--transition-speed) ease;
  display: inline-block;
  vertical-align: middle;
}

:where(body.promptshare-page) .nav-dropdown-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 200px;
  padding: 0.5rem 0;
  background: #0D0C1D;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(5px);
  pointer-events: none;
  transition: opacity var(--transition-speed) ease, visibility var(--transition-speed) ease, transform var(--transition-speed) ease;
}

:where(body.promptshare-page) .nav-item.nav-dropdown:hover > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

:where(body.promptshare-page) .nav-item.nav-dropdown:hover > .nav-dropdown-toggle .dropdown-arrow { transform: rotate(180deg); }

:where(body.promptshare-page) .nav-dropdown-item {
  display: block;
  padding: 0.6rem 1.2rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

:where(body.promptshare-page) .nav-dropdown-item:hover,
:where(body.promptshare-page) .nav-dropdown-item:focus,
:where(body.promptshare-page) .nav-dropdown-item.active {
  background-color: var(--secondary-color);
  color: var(--text-color);
  text-decoration: none;
}

:where(body.promptshare-page) .mobile-menu-button {
  display: block;
  background: none;
  border: none;
  color: var(--text-color);
  padding: 0.5rem;
  cursor: pointer;
  transition: opacity var(--transition-speed);
  margin-left: auto;
  z-index: 51;
}

:where(body.promptshare-page) .mobile-menu-button:hover { opacity: 0.8; }

:where(body.promptshare-page) .mobile-menu {
  display: none;
  position: fixed;
  top: 4rem;
  left: 0;
  right: 0;
  background: #0D0C1D !important;
  backdrop-filter: blur(12px);
  padding: 1rem 0;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform var(--transition-speed) ease-out;
  z-index: 49;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:where(body.promptshare-page) .mobile-menu.active { transform: translateY(0); display: block; }

:where(body.promptshare-page) .mobile-menu .nav-link:not(.sub-link),
:where(body.promptshare-page) .mobile-menu .mobile-submenu-toggle {
  display: block;
  padding: 0.9rem 1.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  color: var(--text-color);
}

:where(body.promptshare-page) .mobile-submenu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:where(body.promptshare-page) .mobile-submenu {
  background-color: rgba(0, 0, 0, 0.1);
  padding-left: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease-out;
}

:where(body.promptshare-page) .mobile-submenu .sub-link {
  display: block;
  padding: 0.75rem 1.5rem 0.75rem 2.5rem;
  text-align: left;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

:where(body.promptshare-page) .mobile-menu .auth-buttons-mobile {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 1.5rem 1.5rem 1rem;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
}

:where(body.promptshare-page) .nav-logo-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0.25rem 0;
  margin-right: 1rem;
}

:where(body.promptshare-page) .nav-logo-img {
  height: 2.5rem;
  width: auto;
  max-height: calc(100% - 0.5rem);
  transition: height var(--transition-speed) ease;
  display: block;
}

@media (min-width: 910px) {
  :where(body.promptshare-page) .mobile-menu-button { display: none !important; }
  :where(body.promptshare-page) .mobile-menu { display: none !important; }
  :where(body.promptshare-page) .nav-links {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    margin-right: auto;
  }
  :where(body.promptshare-page) .nav-link { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
  :where(body.promptshare-page) .auth-buttons {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
  }
  :where(body.promptshare-page) .nav-content { height: 4rem; }
  :where(body.promptshare-page) .nav-logo-img { height: 64px; }
  :where(body.promptshare-page) .nav-logo-link { margin-right: 1rem; }
}

:where(body.promptshare-page) .profile-icon,
:where(body.promptshare-page) .submit-icon { padding: 10px !important; }
:where(body.promptshare-page) .profile-menu.show { background: #0D0C1D !important; }

/* ---- Site buttons (nav auth buttons, mobile menu) ---- */
:where(body.promptshare-page) .button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

:where(body.promptshare-page) .button-primary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

:where(body.promptshare-page) .button-primary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  color: var(--text-color);
  text-decoration: none;
}

:where(body.promptshare-page) .button-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

:where(body.promptshare-page) .button-secondary:hover {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
  text-decoration: none;
}

:where(body.promptshare-page) .button-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
}

:where(body.promptshare-page) .button-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  text-decoration: none;
}

:where(body.promptshare-page) .mobile-menu .button { width: 100%; padding: 0.75rem 0.5rem; font-size: 1rem; }
:where(body.promptshare-page) .mobile-menu .button-primary { background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.3); }
:where(body.promptshare-page) .mobile-menu .button-outline { border: 1px solid rgba(255, 255, 255, 0.3); background: transparent; }

/* ---- Promo strip ---- */
:where(body.promptshare-page) .banner-container {
  width: 100%;
  background: #0D0C1D !important;
  position: relative;
  overflow: hidden;
  z-index: 60;
}

:where(body.promptshare-page) .banner-content { margin: 0 auto; position: relative; z-index: 10; }

:where(body.promptshare-page) .banner-link {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  text-decoration: none;
  color: var(--text-color);
  background: var(--glass-background);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

:where(body.promptshare-page) .banner-link:hover { opacity: 0.9; color: var(--text-color); }

/* ---- Footer ----
   The old sheet's `.footer-description { color: #6B7280 }` leak (03 L3, 3.2:1 contrast) is deliberately NOT ported:
   the footer now uses its own site-wide description colour, as on every other page. */
:where(body.promptshare-page) .footer-v2 {
  background: #0D0C1D !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  margin: 0 !important;
}

/*
 * D8.2, page-scoped: Ask Keeper is a rail row and a command-palette entry here, never a bubble floating over
 * the app. `promptkeeper/widget.css` positions `.pk-launcher` fixed at the bottom-right, where it sat on top of
 * the phone FAB and of the last row's Copy button. Hidden only on this page, only visually — the element stays
 * in the DOM so `actions.openKeeper()` can still click it, which is how the rail row and ⌘K open the chat.
 *
 * NOT `:where(body.promptshare-page)`. That was the first attempt, and it did nothing at all: `:where()` has
 * zero specificity, so the rule weighed the same as the widget's own `.pk-launcher`, and the widget's
 * stylesheet loads after this one. The occlusion property is what found it — the launcher was still sitting on
 * the FAB, in a build whose notes said the bubble had been dealt with. The class selector on `body` is the
 * scope; it is one point of specificity more than the widget, and nothing outside this page is touched.
 */
body.promptshare-page .pk-launcher { display: none; }
