/* Portable CSS for App-like Navigation */

body {
  padding-top: 4.1rem; /* Make room for the fixed top navbar on mobile */
}

/* Inject padding to body on desktop to make room for the side rail */
@media (min-width: 640px) {
  body {
    padding-top: 0; /* Reset top padding when nav moves to the side */
    padding-left: 5rem;
  }
}
@media (min-width: 1024px) {
  body {
    padding-left: 14rem; /* Expand for large screens */
  }
}

.global-nav-wrapper {
  font-family: system-ui, -apple-system, sans-serif;
  background-color: #ffffff;
  position: fixed;
  z-index: 50;
  box-sizing: border-box;
  width: 100%;
  
  /* Mobile default: Top Bar */
  top: 0;
  left: 0;
  border-bottom: 1px solid #e2e8f0;
}

.global-nav-wrapper * {
  box-sizing: inherit;
}

.global-nav-content {
  max-width: 48rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
  padding: 0 1rem;
}

/* Brand Logo */
.global-nav-brand {
  display: block; /* Shown on mobile top bar */
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  letter-spacing: -0.025em;
}
.global-nav-brand span.short-text { display: none; }
.global-nav-brand span.full-text { display: block; }

/* Desktop Nav Links Container (Hidden on mobile) */
.global-nav-links {
  display: none;
}

/* Desktop Nav Link Styles */
.global-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.2s ease;
  gap: 0.35rem;
  flex: 1;
  height: 100%;
}

.global-nav-link svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: all 0.2s ease;
}

.global-nav-link:hover, .global-nav-link.active {
  color: #4f46e5; /* Indigo accent */
}

.global-nav-link.active svg {
  fill: #e0e7ff; /* Light indigo fill for active state */
  stroke-width: 2.25;
}

/* Mobile Hamburger Button */
.global-nav-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #0f172a;
  border-radius: 0.375rem;
}
.global-nav-hamburger:hover {
  background-color: #f1f5f9;
}
.global-nav-hamburger svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* Mobile Dropdown Menu */
.global-nav-mobile-menu {
  display: none;
  padding: 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-direction: column;
  gap: 1rem;
}
.global-nav-mobile-menu.active {
  display: flex;
}
.global-nav-mobile-link {
  color: #475569;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem;
  border-radius: 0.375rem;
}
.global-nav-mobile-link:hover, .global-nav-mobile-link.active {
  background-color: #e2e8f0;
  color: #0f172a;
}

/* Tablet Desktop Styles (Narrow Side Rail) */
@media (min-width: 640px) {
  .global-nav-wrapper {
    top: 0;
    bottom: 0;
    left: 0;
    width: 5rem;
    border-top: none;
    border-bottom: none;
    border-right: 1px solid #e2e8f0;
  }
  
  .global-nav-content {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    padding: 1.5rem 0;
    gap: 1rem;
    margin: 0;
  }
  
  .global-nav-brand {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .global-nav-brand span.full-text { display: none; }
  .global-nav-brand span.short-text { display: block; }
  
  .global-nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .global-nav-hamburger {
    display: none;
  }
  .global-nav-mobile-menu {
    display: none !important;
  }
  
  .global-nav-link {
    flex: none;
    width: 4.5rem;
    height: auto;
    min-height: 3.75rem;
    border-radius: 0.75rem;
    gap: 0.25rem;
    padding: 0.5rem 0.125rem;
    text-align: center;
    line-height: 1.1;
  }
  
  .global-nav-link:hover {
    background-color: #f8fafc;
  }
  
  .global-nav-link.active {
    background-color: #e0e7ff;
    color: #4338ca;
  }
  
  .global-nav-link.active svg {
    fill: none; /* Keep desktop clean without filled SVG */
  }
}

/* Desktop Large Styles (Wide Sidebar) */
@media (min-width: 1024px) {
  .global-nav-wrapper {
    width: 14rem;
  }
  
  .global-nav-content {
    align-items: stretch;
    padding: 2rem 1rem;
  }
  
  .global-nav-brand {
    font-size: 1.25rem;
    padding: 0 1rem;
    margin-bottom: 2.5rem;
  }
  
  .global-nav-brand span.full-text { display: block; }
  .global-nav-brand span.short-text { display: none; }
  
  .global-nav-link {
    width: auto;
    height: auto;
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.875rem 1rem;
    font-size: 0.95rem;
    gap: 1rem;
  }
}


