/* =========================================================
   WalletForge – Shared Top Navbar
   File: public_html/css/navbar.css
   ========================================================= */

/* ----- Reset for nav elements ----------------------------- */
#wf-navbar *,
#wf-navbar *::before,
#wf-navbar *::after {
  box-sizing: border-box;
  margin: 0;
}

/* ----- Root navbar bar ------------------------------------ */
#wf-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #1a1f2e;
  border: none;
  outline: none;
  box-shadow: none;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

/* Adjust body so sticky nav doesn't overlap content */
body {
  padding-top: 0;
}

/* ----- Inner container ------------------------------------ */
.wf-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
}

/* ----- Logo ----------------------------------------------- */
.wf-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.wf-nav-logo:hover {
  opacity: 0.8;
}
.wf-nav-logo img {
  height: 32px;
  width: auto;
}

/* ----- Center links --------------------------------------- */
.wf-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  flex: 1;
  padding-left: 20px;
}

.wf-nav-links li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(241, 245, 249, 0.75);
  text-decoration: none;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}
.wf-nav-links li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}
.wf-nav-links li a.active {
  background: rgba(255, 140, 33, 0.15);
  color: #ff8c21;
}

/* ----- Right-side actions --------------------------------- */
.wf-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Admin badge link – lives inside .wf-nav-links, PHP only renders for admins */
#adminPanelLink {
  color: #fff !important;
}
#adminPanelLink:hover {
  color: #fff !important;
}

/* User info block – PHP sets style="display:flex" inline when authed */
#userInfo {
  display: none; /* overridden by PHP inline style when logged in */
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
#userName {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f1f5f9;
}
#userRole {
  font-size: 0.7rem;
  color: rgba(241, 245, 249, 0.5);
}

/* Logout button – PHP sets style="display:inline-flex" inline when authed */
#logoutBtn {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(241, 245, 249, 0.75);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
  white-space: nowrap;
}
#logoutBtn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #f1f5f9;
}

/* Login / Sign-up links (shown on public pages when unauthed) */
.wf-nav-login,
.wf-nav-signup {
  display: none; /* toggled by navbar.js */
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.wf-nav-login {
  background: transparent;
  border: 1.5px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}
.wf-nav-login:hover {
  border-color: var(--primary-color, #ff8c21);
  color: var(--primary-color, #ff8c21);
}
.wf-nav-signup {
  background: var(--primary-color, #ff8c21);
  border: 1.5px solid var(--primary-color, #ff8c21);
  color: #fff;
}
.wf-nav-signup:hover {
  background: var(--primary-700, #ea580c);
  border-color: var(--primary-700, #ea580c);
}

/* Mobile hamburger */
.wf-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}
.wf-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary, #0f172a);
  border-radius: 2px;
  transition:
    transform 0.2s,
    opacity 0.2s;
}

/* ---- Responsive ------------------------------------------ */
@media (max-width: 768px) {
  .wf-nav-links {
    display: none;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: var(--background, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding: 10px 16px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .wf-nav-links.open {
    display: flex;
  }
  .wf-nav-links li a {
    padding: 10px 14px;
  }
  .wf-nav-toggle {
    display: flex;
  }
  #userInfo {
    display: none !important;
  }
}

/* ---- Dark mode ------------------------------------------- */
/* Navbar is dark by default; [data-theme="dark"] just keeps it consistent */
[data-theme="dark"] #wf-navbar,
[data-theme="dark"] #wf-navbar {
  background: #1a1f2e;
  border: none;
  box-shadow: none;
}
[data-theme="dark"] .wf-nav-logo {
  color: #f1f5f9;
}
[data-theme="dark"] .wf-nav-links li a {
  color: rgba(241, 245, 249, 0.75);
}
[data-theme="dark"] .wf-nav-links li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}
[data-theme="dark"] #logoutBtn {
  background: transparent;
}
[data-theme="dark"] .wf-nav-toggle span {
  background: #f1f5f9;
}
[data-theme="dark"] .wf-nav-links {
  background: #1a1f2e;
}
[data-theme="dark"] .wf-nav-login {
  color: rgba(241, 245, 249, 0.75);
}
[data-theme="dark"] #userName {
  color: #f1f5f9;
}
