/* ==========================================================================
   NAVIGATION - Header, Sidebar, Footer
   ========================================================================== */

/* === SITE HEADER === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-bg-dark);
  border-bottom: 3px solid var(--color-primary);
  z-index: var(--z-header);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: var(--space-md);
}

/* === LOGO === */
.site-header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.site-header__logo svg {
  height: 28px;
  width: auto;
  max-width: 120px;
}

/* === SIDEBAR TOGGLE (mobile) === */
.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--color-text-inverse);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-toggle svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: var(--z-sidebar);
  transform: translateX(-100%);
  transition: transform var(--transition-base);
}

.sidebar--open {
  transform: translateX(0);
}

/* === SIDEBAR OVERLAY (mobile) === */
.sidebar-overlay {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: calc(var(--z-sidebar) - 1);
}

.sidebar-overlay--visible {
  opacity: 1;
  visibility: visible;
}

/* === SIDEBAR NAVIGATION === */
.sidebar__nav {
  padding: var(--space-lg);
}

.sidebar__section {
  margin-bottom: var(--space-xl);
}

.sidebar__section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
  padding: 0 var(--space-sm);
}

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

.sidebar__link {
  display: block;
  padding: var(--space-sm) var(--space-sm);
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar__link:hover {
  color: var(--color-primary);
  background: rgba(0, 173, 239, 0.05);
}

.sidebar__link--active {
  color: var(--color-primary);
  background: rgba(0, 173, 239, 0.1);
  font-weight: var(--font-weight-bold);
}

/* === SITE FOOTER === */
.site-footer {
  background: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-xl) 0;
  margin-top: auto;
}

.site-footer__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
}

.site-footer__logo {
  opacity: 0.7;
}

.site-footer__logo svg {
  height: 20px;
  width: auto;
  max-width: 100px;
}

.site-footer__links {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.site-footer__links a:hover {
  color: var(--color-text-inverse);
}

.site-footer__copyright {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.5);
}

/* === PAGE LAYOUT === */
.page-content {
  padding-top: var(--header-height);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* === DESKTOP STYLES === */
@media (min-width: 1024px) {
  /* Hide mobile toggle on desktop */
  .sidebar-toggle {
    display: none;
  }

  /* Sidebar always visible on desktop */
  .sidebar {
    transform: translateX(0);
  }

  /* Hide overlay on desktop */
  .sidebar-overlay {
    display: none;
  }

  /* Offset page content for sidebar */
  .page-content {
    margin-left: var(--sidebar-width);
  }

  /* Footer also offset */
  .site-footer {
    margin-left: var(--sidebar-width);
  }

  /* Body never locked on desktop */
  body.sidebar-open {
    overflow: auto;
  }
}

/* === TABLET/MOBILE RESPONSIVE === */
@media (max-width: 1023px) {
  .site-footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

/* === HOME PAGE - No Sidebar === */
.page-home .sidebar,
.page-home .sidebar-overlay,
.page-home .sidebar-toggle {
  display: none !important;
}

.page-home .page-content {
  margin-left: 0;
}

.page-home .site-footer {
  margin-left: 0;
}
