/*
 * SoundLabs: shared site chrome on this page (nav, promo strip, footer, shared upgrade modal).
 *
 * The old css/soundlabs.css styled the shared chrome (dark #0D0C1D nav, system font, button look).
 * Those rules are ported here verbatim so the nav, footer and upgrade modal render exactly as before
 * (verified with before/after pixel diffs, docs/11-frontend-foundation-report.md), but every global
 * rule is now fenced away from the app (.sl-app, .sl-layer, .sl-seo), so nothing leaks into SoundLabs
 * components and nothing in the app depends on these rules. 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.soundlabs-page) :where(:not(.sl-app, .sl-app *, .sl-layer, .sl-layer *, .sl-seo, .sl-seo *)) {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html:has(body.soundlabs-page),
body.soundlabs-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.soundlabs-page {
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

:where(body.soundlabs-page) a:where(:not(.sl-app *, .sl-layer *, .sl-seo *)) {
  color: inherit;
  text-decoration: none;
}

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

/* ---- Navigation ---- */
:where(body.soundlabs-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.soundlabs-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.soundlabs-page) .nav-links { display: none; }
:where(body.soundlabs-page) .auth-buttons { display: none; }

:where(body.soundlabs-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.soundlabs-page) .nav-link:hover {
  background-color: var(--glass-background-hover);
  color: var(--text-color);
}

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

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

:where(body.soundlabs-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.soundlabs-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.soundlabs-page) .nav-item.nav-dropdown:hover > .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

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

:where(body.soundlabs-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.soundlabs-page) .nav-dropdown-item:hover,
:where(body.soundlabs-page) .nav-dropdown-item:focus,
:where(body.soundlabs-page) .nav-dropdown-item.active {
  background-color: var(--secondary-color);
  color: var(--text-color);
  text-decoration: none;
}

:where(body.soundlabs-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.soundlabs-page) .mobile-menu-button:hover { opacity: 0.8; }

:where(body.soundlabs-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.soundlabs-page) .mobile-menu.active { transform: translateY(0); display: block; }

:where(body.soundlabs-page) .mobile-menu .nav-link:not(.sub-link),
:where(body.soundlabs-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.soundlabs-page) .mobile-submenu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

:where(body.soundlabs-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.soundlabs-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.soundlabs-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.soundlabs-page) .nav-logo-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0.25rem 0;
  margin-right: 1rem;
}

:where(body.soundlabs-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.soundlabs-page) .mobile-menu-button { display: none !important; }
  :where(body.soundlabs-page) .mobile-menu { display: none !important; }
  :where(body.soundlabs-page) .nav-links {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    margin-right: auto;
  }
  :where(body.soundlabs-page) .nav-link { padding: 0.5rem 0.75rem; font-size: 0.9rem; }
  :where(body.soundlabs-page) .auth-buttons {
    display: flex !important;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
  }
  :where(body.soundlabs-page) .nav-content { height: 4rem; }
  :where(body.soundlabs-page) .nav-logo-img { height: 64px; }
  :where(body.soundlabs-page) .nav-logo-link { margin-right: 1rem; }
}

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

/* ---- Site buttons (nav auth buttons, mobile menu) ---- */
:where(body.soundlabs-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.soundlabs-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.soundlabs-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.soundlabs-page) .button-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

:where(body.soundlabs-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.soundlabs-page) .button-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-color);
}

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

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

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

:where(body.soundlabs-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.soundlabs-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.soundlabs-page) .footer-v2 {
  background: #0D0C1D !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  margin: 0 !important;
}
