/* ========================================
   PUBLIC LAYOUT STYLES
   Clean, modern SaaS design system
   ======================================== */

/* Base Typography & Spacing */
:root {
  --nav-height: 60px;
  --section-spacing: 5rem;
  --container-max: 1200px;
  --transition-base: 0.2s ease;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------
   NAVBAR - Minimal, professional header
   ---------------------------------------- */
.public-navbar {
  height: var(--nav-height);
  padding: 0;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--transition-base);
}

.public-navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.public-navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
}

/* Logo */
.navbar-brand {
  padding: 0;
  margin-right: 3rem;
}

.navbar-brand img {
  height: 36px;
  width: auto;
}

/* Nav Links - Clean, understated */
.public-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.public-nav-link {
  display: block;
  padding: 0.5rem 1rem;
  color: #4b5563;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-base);
}

.public-nav-link:hover {
  color: var(--color-primary);
  background: rgba(35, 118, 124, 0.06);
}

.public-nav-link.active {
  color: var(--color-primary);
  background: rgba(35, 118, 124, 0.08);
}

/* Auth Buttons */
.nav-auth-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.btn-nav-signin {
  padding: 0.5rem 1.25rem;
  color: #374151;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-base);
}

.btn-nav-signin:hover {
  color: var(--color-primary);
  background: rgba(35, 118, 124, 0.06);
}

.btn-nav-cta {
  padding: 0.5rem 1.25rem;
  background: var(--color-primary);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  transition: all var(--transition-base);
}

.btn-nav-cta:hover {
  background: #1c5f64;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(35, 118, 124, 0.25);
}

/* Mobile Toggle */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  background: transparent;
  position: relative;
  z-index: 1060; /* Higher than overlay and sidebar */
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Mobile Menu */
@media (max-width: 991.98px) {
  .public-navbar {
    height: auto;
    min-height: var(--nav-height);
    padding: 1rem 0;
  }

  .navbar-collapse {
    padding: 1.5rem 0 0.5rem;
  }

  .public-nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .public-nav-link {
    padding: 0.75rem 1rem;
  }

  .nav-auth-buttons {
    flex-direction: column;
    margin-left: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .btn-nav-signin,
  .btn-nav-cta {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1.25rem;
  }
}

/* ----------------------------------------
   MAIN CONTENT
   ---------------------------------------- */
.public-main {
  min-height: calc(100vh - var(--nav-height) - 320px);
  padding-top: 0;
}

/* ----------------------------------------
   FOOTER - Streamlined, professional
   ---------------------------------------- */
.public-footer {
  background: #111827;
  color: #9ca3af;
  padding: 4rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 3rem;
}

@media (max-width: 991.98px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }

  .footer-brand-col {
    grid-column: span 2;
  }
}

@media (max-width: 575.98px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-brand-col {
    grid-column: span 1;
  }
}

/* Footer Brand */
.footer-brand-col img {
  height: 40px;
  margin-bottom: 1rem;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.footer-brand-col p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: #9ca3af;
  max-width: 280px;
  margin-bottom: 1.5rem;
}

/* Social Links */
.footer-social {
  display: flex;
  gap: 0.5rem;
}

.footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  text-decoration: none;
  transition: all var(--transition-base);
}

.footer-social-link:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}

/* Footer Columns */
.footer-col h6 {
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.625rem;
}

.footer-links a {
  color: #9ca3af;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: color var(--transition-base);
}

.footer-links a:hover {
  color: #fff;
}

/* Footer Bottom */
.footer-bottom {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright {
  font-size: 1.1rem;
  color: #6b7280;
}

.footer-powered {
  font-size: 1.1rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-powered a {
  color: #9ca3af;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  transition: color var(--transition-base);
}

.footer-powered a:hover {
  color: #fff;
}

.footer-powered img {
  height: 18px;
  opacity: 0.7;
}

@media (max-width: 575.98px) {
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ----------------------------------------
   BACK TO TOP BUTTON
   ---------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-md);
}

.back-to-top:hover {
  background: #1c5f64;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.back-to-top.show {
  display: flex;
}

/* ----------------------------------------
   ACCESSIBILITY
   ---------------------------------------- */
.skip-link {
  position: absolute;
  top: -50px;
  left: 16px;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  z-index: 9999;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 16px;
}

/* Focus Styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ----------------------------------------
   PRINT STYLES
   ---------------------------------------- */
@media print {
  .public-navbar,
  .public-footer,
  .back-to-top {
    display: none !important;
  }

  .public-main {
    padding: 0 !important;
  }
}

/* ----------------------------------------
   MOBILE MENU - Slide from left
   ---------------------------------------- */

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Dark overlay behind mobile menu */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1040; /* Lower than navbar-collapse (1050) */
}

.mobile-menu-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Hamburger to X animation */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  background: transparent;
  position: relative;
  z-index: 1060; /* Higher than overlay and sidebar */
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.toggler-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  position: relative;
}

.toggler-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #374151;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger to X transformation */
.navbar-toggler.active .toggler-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar-toggler.active .toggler-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggler.active .toggler-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Styles */
@media (max-width: 991.98px) {
  .public-navbar {
    height: var(--nav-height);
    padding: 0 1rem;
    z-index: 1055; /* Navbar above overlay */
  }

  .public-navbar .container {
    max-width: 100%;
    padding: 0;
  }

  .navbar-collapse {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    padding: calc(var(--nav-height) + 1rem) 1.5rem 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    z-index: 1050; /* Higher than overlay (1040) */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .navbar-collapse.show {
    left: 0;
  }

  .public-nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
  }

  .public-nav-link {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
  }

  .public-nav-link:hover,
  .public-nav-link.active {
    background: rgba(35, 118, 124, 0.08);
  }

  .nav-auth-buttons {
    flex-direction: column;
    margin-left: 0;
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 0.75rem;
  }

  .btn-nav-signin,
  .btn-nav-cta {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
}

/* Mobile Sidebar Header - Hidden on desktop */
.mobile-sidebar-header {
  display: none;
}

/* Hamburger icon styles */
.toggler-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  position: relative;
}

.toggler-bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #374151;
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

/* Hamburger to X transformation */
.navbar-toggler.active .toggler-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.navbar-toggler.active .toggler-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.navbar-toggler.active .toggler-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Menu Styles */
@media (max-width: 991.98px) {
  .public-navbar {
    height: var(--nav-height);
    padding: 0 1rem;
    z-index: 1055;
  }

  .public-navbar .container {
    max-width: 100%;
    padding: 0;
  }

  .navbar-collapse {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: #fff;
    padding: 0;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    z-index: 1050;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  .navbar-collapse.show {
    left: 0;
  }

  /* Mobile Sidebar Header */
  .mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .mobile-sidebar-logo {
    display: block;
  }

  .mobile-sidebar-logo img {
    height: 32px;
    width: auto;
  }

  .mobile-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    color: #374151;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all var(--transition-base);
  }

  .mobile-close-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #111827;
  }

  .public-nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 1rem 1rem;
  }

  .public-nav-link {
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border-radius: 8px;
  }

  .public-nav-link:hover,
  .public-nav-link.active {
    background: rgba(35, 118, 124, 0.08);
  }

  .nav-auth-buttons {
    flex-direction: column;
    margin-left: 0;
    margin-top: auto;
    padding: 1.25rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    gap: 0.75rem;
  }

  .btn-nav-signin,
  .btn-nav-cta {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }
}
