/* ============================================================
   LAYOUT — Jiva Pulse
   Grid, navbar, sidebar, footer, page shell.
   Glassmorphism Level 3 for navbar.
   ============================================================ */

/* ── Container ── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

/* ── Navbar — Glass Level 3 ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--glass-bg-3);
  backdrop-filter: var(--glass-blur-3);
  -webkit-backdrop-filter: var(--glass-blur-3);
  z-index: var(--z-modal);
  transition: box-shadow var(--ease-fast);
  border-bottom: var(--glass-border-3);
}

.navbar--scrolled {
  box-shadow: var(--glass-shadow-3);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo {
  height: 40px;
  width: auto;
}

.navbar__brand-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

.navbar__link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text-secondary);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--ease-fast);
  letter-spacing: var(--tracking-wide);
}

.navbar__link:hover {
  color: var(--clr-primary);
  background: var(--clr-primary-subtle);
}

.navbar__link.active {
  color: var(--clr-primary);
  background: var(--clr-primary-subtle);
  font-weight: var(--weight-semi);
}

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* Hamburger button */
.navbar__hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  transition: background var(--ease-fast);
}

.navbar__hamburger:hover {
  background: var(--clr-primary-subtle);
}

.navbar__hamburger:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

.navbar__hamburger svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* Mobile menu
   Uses position:absolute (not fixed) so it escapes the navbar's
   backdrop-filter containing-block constraint.
   The navbar is itself fixed, so the menu still anchors to the viewport. */
.navbar__mobile-menu {
  display: none;
  position: absolute;
  top: 100%;          /* flush below the navbar bar */
  left: 0;
  right: 0;
  height: calc(100vh - var(--nav-height));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  z-index: var(--z-overlay);
  padding: var(--sp-6);
  overflow-y: auto;
}

.navbar__mobile-menu.is-open {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.navbar__mobile-link {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  color: var(--clr-text);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--ease-fast);
}

.navbar__mobile-link:hover,
.navbar__mobile-link.active {
  color: var(--clr-primary);
  background: var(--clr-primary-subtle);
}

/* ── Main Content Push ── */
main {
  margin-top: var(--nav-height);
  min-height: calc(100vh - var(--nav-height));
}

/* ── Dashboard Layout (sidebar pages) ── */
.dashboard-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: calc(100vh - var(--nav-height));
}

/* ── Sidebar ── */
.sidebar {
  background: var(--glass-bg-1);
  backdrop-filter: var(--glass-blur-1);
  -webkit-backdrop-filter: var(--glass-blur-1);
  border-right: var(--glass-border-1);
  padding: var(--sp-6) var(--sp-4);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--clr-text-secondary);
  text-decoration: none;
  transition: all var(--ease-fast);
}

.sidebar__link:hover {
  background: var(--clr-primary-subtle);
  color: var(--clr-primary);
}

.sidebar__link.active {
  background: var(--clr-primary-subtle);
  color: var(--clr-primary);
  font-weight: var(--weight-semi);
}

.sidebar__link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Logo Watermark — bottom right, above footer, all pages ── */
#main-content {
  position: relative;
  overflow: hidden;
  z-index: var(--z-base);
}

#main-content::after {
  content: '';
  position: fixed;
  bottom: 0;
  right: 0;
  width: 720px;
  height: 720px;
  background: url('/assets/images/Jiva Logo.png') no-repeat center / contain;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

/* ── Footer ── */
.footer {
  background: linear-gradient(135deg, #474BFB 0%, #A78BFF 50%, #D0B6FF 100%);
  color: rgba(255, 255, 255, 0.65);
  padding: var(--sp-16) 0 var(--sp-8);
  position: relative;
  overflow: hidden;
}

/* Subtle spectrum shimmer on footer top edge */
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0.6;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: var(--sp-10);
}

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer__logo {
  height: 40px;
  width: auto;
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  line-height: var(--leading-normal);
}

.footer__copy {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.45);
  margin-top: var(--sp-4);
}

.footer__heading {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semi);
  color: var(--clr-white);
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  margin-bottom: var(--sp-5);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.footer__link {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color var(--ease-fast);
}

.footer__link:hover {
  color: var(--jiva-teal);
}

.footer__connect {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.footer__social {
  display: flex;
  gap: var(--sp-3);
}

.footer__social-link {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all var(--ease-fast);
}

.footer__social-link:hover {
  background: var(--gradient-primary);
  color: var(--clr-white);
}

.footer__newsletter {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.footer__newsletter-input {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--clr-white);
  flex: 1;
  transition: border-color var(--ease-fast);
}

.footer__newsletter-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.footer__newsletter-input:focus {
  outline: none;
  border-color: var(--jiva-teal);
}

.footer__bottom {
  margin-top: var(--sp-12);
  padding-top: var(--sp-6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.35);
}

/* ── Slim Footer Variant ── */
.footer--slim {
  padding: var(--sp-6) 0;
}

.footer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
}

.footer__bar-left {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
}

.footer--slim .footer__copy {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.55);
  margin: 0;
}

.footer__legal {
  display: flex;
  gap: var(--sp-6);
}

/* ── Section Spacing ── */
.section {
  padding: var(--sp-20) 0;
  position: relative;
}

.section--alt {
  background: var(--clr-surface-alt);
}

/* Hero section with spectrum gradient overlay */
.section--dark {
  background: var(--gradient-hero);
  position: relative;
}

.section--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(126, 207, 179, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 30%, rgba(168, 156, 212, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark p {
  color: var(--clr-white);
}

.section__header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  margin-bottom: var(--sp-12);
}

.section__header h2 {
  margin-bottom: var(--sp-4);
}

.section__header p {
  color: var(--clr-text-secondary);
  font-size: var(--text-md);
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .navbar__links {
    display: none;
  }

  /* Hide "Get Started" on mobile to make room for hamburger */
  .navbar__actions .btn:not(.navbar__hamburger) {
    display: none;
  }

  .navbar__hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-8);
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .section {
    padding: var(--sp-12) 0;
  }
}

@media (max-width: 480px) {
  .footer__bar {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-4);
  }

  .footer__bar-left {
    flex-direction: column;
    gap: var(--sp-3);
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }

  .container {
    padding-inline: var(--sp-4);
  }

  h1 { font-size: var(--text-2xl); }
}
