/*
  HEADER REWRITE - NON-AUTH
  A completely self-contained, isolated CSS solution for the non-authenticated header.
  - Uses BEM-like naming convention to avoid conflicts.
  - Relies on modern Flexbox for layout.
  - Contains all styles for header, nav, buttons, and mobile sidebar.
*/

:root {
  --nh-primary: #3B82F6;
  --nh-primary-hover: #2563EB;
  --nh-bg: #0F172A;
  --nh-bg-2: #111827;
  --nh-text: #F8FAFC;
  --nh-text-secondary: #CBD5E1;
  --nh-border: rgba(148, 163, 184, 0.12);
  --nh-surface: rgba(30, 41, 59, 0.5);
  --nh-hover: rgba(59, 130, 246, 0.12);
  --nh-radius: 12px;
  --nh-height: 80px;
  --nh-height-mobile: 70px;
  --nh-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --nh-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

.nonauth-header-wrapper,
.nonauth-header-wrapper * {
  box-sizing: border-box;
}

/* 2. HEADER LAYOUT
------------------------------------ */
.nonauth-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  height: var(--nh-height);
  font-family: var(--nh-font);
}

.nonauth-header {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(17, 24, 39, 0.98) 100%);
  border-bottom: 1px solid var(--nh-border);
  box-shadow: var(--nh-shadow);
  padding: 0 24px;
}

.nonauth-header__inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 3. HEADER COMPONENTS
------------------------------------ */
.nonauth-header__logo {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--nh-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.025em;
  flex-shrink: 0;
}
.nonauth-header__logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.nonauth-header__nav {
  display: flex;
  justify-content: center;
  flex: 1;
}

.nonauth-header__nav-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2.25rem;
}
.nonauth-header__nav-item {
  list-style: none;
}

.nonauth-header__nav-link {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  color: var(--nh-text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  white-space: nowrap;
  height: var(--nh-height);
  border-radius: 10px;
}
.nonauth-header__nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  width: 0;
  height: 3px;
  background: var(--nh-primary);
  margin: 0 auto;
}
.nonauth-header__nav-link:hover,
.nonauth-header__nav-item.active .nonauth-header__nav-link {
  color: var(--nh-text);
  background: var(--nh-hover);
}
.nonauth-header__nav-link:hover::after,
.nonauth-header__nav-item.active .nonauth-header__nav-link::after {
  width: 100%;
}


.nonauth-header__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nonauth-header__btn {
  border: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--nh-radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  white-space: nowrap;
}
.nonauth-header__btn--secondary {
  border-color: var(--nh-border);
  color: var(--nh-text-secondary);
  background: rgba(17, 24, 39, 0.2);
}
.nonauth-header__btn--secondary:hover {
  border-color: var(--nh-text-secondary);
  color: var(--nh-text);
  background: var(--nh-surface);
}
.nonauth-header__btn--primary {
  background: linear-gradient(135deg, var(--nh-primary) 0%, var(--nh-primary-hover) 100%);
  border-color: var(--nh-primary);
  color: white;
}
.nonauth-header__btn--primary:hover {
  background: linear-gradient(135deg, var(--nh-primary-hover) 0%, var(--nh-primary) 100%);
  border-color: var(--nh-primary-hover);
}


/* 4. MOBILE & SIDEBAR
------------------------------------ */
.nonauth-header__mobile-toggle {
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 2px solid var(--nh-border);
  border-radius: var(--nh-radius);
  color: var(--nh-text-secondary);
  cursor: pointer;
}

.nonauth-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
}
.nonauth-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.nonauth-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: #111827;
  background-color: #111827;
  border-right: 1px solid var(--nh-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  z-index: 9998;
  display: flex;
  flex-direction: column;
}
.nonauth-sidebar.active {
  transform: translateX(0);
}

/* Force solid opaque background for sidebar */
.nonauth-sidebar {
  background: #111827 !important;
  background-color: #111827 !important;
}

.nonauth-sidebar__header {
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--nh-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nh-height-mobile);
  flex-shrink: 0;
  background: #111827;
}
.nonauth-sidebar__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--nh-text);
  text-decoration: none;
}
.nonauth-sidebar__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: var(--nh-radius);
  color: var(--nh-text-secondary);
  cursor: pointer;
}
.nonauth-sidebar__nav {
  list-style: none;
  margin: 0;
  padding: 1rem;
  flex: 1;
  overflow-y: auto;
}
.nonauth-sidebar__nav-item {
  list-style: none;
}
.nonauth-sidebar__nav-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  color: var(--nh-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--nh-radius);
}
.nonauth-sidebar__nav-link:hover,
.nonauth-sidebar__nav-item.active .nonauth-sidebar__nav-link {
  color: var(--nh-text);
  background: var(--nh-hover);
}
.nonauth-sidebar__nav-item.active .nonauth-sidebar__nav-link {
  border-left: 3px solid var(--nh-primary);
}
.nonauth-sidebar__nav-icon {
  width: 24px;
  height: 24px;
  margin-right: 1rem;
  opacity: 0.8;
}
.nonauth-sidebar__actions {
  padding: 1.5rem;
  border-top: 1px solid var(--nh-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #0F172A;
}


/* 5. RESPONSIVE BREAKPOINTS
------------------------------------ */
@media (max-width: 991px) {
  .nonauth-header-wrapper {
    height: var(--nh-height-mobile);
  }
  .nonauth-header__nav,
  .nonauth-header__actions {
    display: none;
  }
  .nonauth-header__mobile-toggle {
    display: flex;
  }
}

/* Ensure header offset always applies, more specific to beat other styles */
html body {
  padding-top: var(--nh-height) !important;
}
@media (max-width: 991px) {
  html body {
    padding-top: var(--nh-height-mobile) !important;
  }
}
