/* ─────────────────────────────────────────
   header.css — StackHire nav
   Theme: white / orange / black
───────────────────────────────────────── */

/* ── NAV SHELL ─────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border), 0 4px 24px rgba(0, 0, 0, 0.04);
}

/* Top orange accent line */
.nav-accent-line {
  height: 2.5px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 25%,
    #fbbf24 60%,
    transparent 100%
  );
  opacity: 0.75;
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 62px;
  gap: 1rem;
  position: relative;
}

/* ── LOGO ───────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.logo:hover { opacity: 0.8; }

.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28);
}

.logo-text {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.logo-text em {
  font-style: normal;
  color: var(--accent);
}

/* ── NAV LINKS ──────────────────────────── */
.nav-links {
  display: flex;
  list-style: none;
  gap: 2px;
  margin: 0 0 0 1.25rem;
  padding: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.38rem 0.7rem;
  border-radius: 7px;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
  position: relative;
  letter-spacing: 0.01em;
}

.nav-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.55;
  transition: opacity 0.18s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface2);
}

.nav-link:hover .nav-icon { opacity: 0.85; }

.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

.nav-link.active .nav-icon { opacity: 1; }

/* Orange underline sliver on active */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

/* ── RIGHT SIDE ─────────────────────────── */
.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;          /* desktop gap between icons */
  flex-shrink: 0;
}

/* Thin divider between badge and CTA */
.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border2);
  flex-shrink: 0;
}

/* Live badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 500;
  color: var(--green);
  background: rgba(22, 163, 74, 0.08);
  border: 1px solid rgba(22, 163, 74, 0.2);
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 5px rgba(22, 163, 74, 0.45);
  animation: livepulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes livepulse {
  0%, 100% { opacity: 1;    box-shadow: 0 0 5px rgba(22, 163, 74, 0.45); }
  50%       { opacity: 0.4; box-shadow: 0 0 2px rgba(22, 163, 74, 0.15); }
}

/* Post a job CTA */
.post-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.42rem 0.9rem;
  background: var(--accent);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28);
}

.post-btn:hover {
  background: #ea6c0a;
  transform: translateY(-1px);
}

.post-btn:active { transform: translateY(0); }

/* ── NAV ICON BUTTONS (FA icons: search / notif / user) ── */
.nav-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 1.05rem;
  transition: color 0.18s;
  flex-shrink: 0;
  cursor: pointer;
}

.nav-icon-btn:hover  { color: var(--text); }
.nav-icon-btn.active { color: var(--accent); }

/* Unread dot — anchored to the icon, not the button box */
.nav-icon-dot {
  position: absolute;
  top: 1px;
  right: 0px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  border: 1.5px solid #faf9f7;
  pointer-events: none;
}

/* FA icons inside mobile drawer nav-links */
.nav-fa-icon {
  width: 15px;
  font-size: 0.82rem;
  text-align: center;
  opacity: 0.6;
  transition: opacity 0.18s;
  flex-shrink: 0;
}

.nav-link:hover .nav-fa-icon,
.nav-link.active .nav-fa-icon { opacity: 1; }

/* ── MOBILE TOGGLE ──────────────────────── */
.nav-toggle {
  display: none;
  width: 28px;
  height: 20px;
  position: relative;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  flex-shrink: 0;
}

.nav-toggle span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--muted);
  border-radius: 10px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 9px; width: 70%; }
.nav-toggle span:nth-child(3) { bottom: 0; }

.nav-toggle:hover span        { background: var(--accent); }
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg); top: 9px; }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: translateX(-10px); }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg); bottom: 9px; }

/* ── MOBILE DRAWER ──────────────────────── */
.nav-drawer {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: rgba(250, 249, 247, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem 1rem;
  z-index: 99;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.nav-drawer.open {
  display: flex;
  animation: drawerSlide 0.2s ease;
}

@keyframes drawerSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-drawer .nav-link {
  font-size: 0.88rem;
  padding: 0.62rem 0.9rem;
  border-radius: 9px;
  gap: 9px;
  width: 100%;
}

.nav-drawer .nav-icon {
  width: 15px;
  height: 15px;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 840px) {
  .nav-links                         { display: none; }
  .post-btn                          { display: none; }
  .nav-divider                       { display: none; }
  .nav-toggle                        { display: flex; }
  .theme-toggle                      { display: none; }
  .nav-right > a.nav-icon-btn        { display: none; }
  .nav-right > a[href="/auth.php"]   { display: none; }
  .nav-inner .user-menu              { display: none !important; }
}

@media (max-width: 560px) {
  .live-label { display: none; }
}

@media (max-width: 480px) {
  .nav-inner  { padding: 0 1rem; height: 56px; }
  .nav-drawer { top: 58px; }
  .logo-text  { font-size: 0.9rem; }
  .logo-mark  { width: 26px; height: 26px; border-radius: 6px; }
}



/* ── User avatar button ─────────────────────────── */
.user-menu { position: relative; display: flex; align-items: center; }

.user-avatar-btn { cursor: pointer; background: none; border: none; padding: 0; }

.user-avatar-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f97316;   /* ← change from #2563eb to orange */
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  user-select: none;
}

/* ── Dropdown ───────────────────────────────────── */
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  z-index: 999;
  overflow: hidden;
  animation: dropIn .18s ease;
}
.user-dropdown.open { display: block; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-dropdown-header {
  padding: .8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.udrop-name  { font-size: .875rem; font-weight: 600; color: #0f172a; }
.udrop-email { font-size: .75rem;  color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 176px; }

.udrop-divider { height: 1px; background: #f1f5f9; }

.udrop-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1rem;
  font-size: .875rem;
  color: #0f172a;
  text-decoration: none;
  transition: background .15s;
}
.udrop-item:hover    { background: #f8fafc; }
.udrop-item i        { width: 14px; text-align: center; opacity: .6; }
.udrop-logout        { color: #dc2626; }
.udrop-logout i      { opacity: 1; }
.udrop-logout:hover  { background: #fef2f2; }



/* ── Notification Dropdown ─────────────────────────── */
    .notif-menu { position: relative; display: flex; align-items: center; }

    .notif-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 10px);
      right: 0;
      width: 340px;
      background: #fff;
      border: 1px solid #e2e8f0;
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0,0,0,.12);
      z-index: 999;
      overflow: hidden;
      animation: dropIn .18s ease;
    }
    .notif-dropdown.open { display: block; }

    @keyframes dropIn {
      from { opacity: 0; transform: translateY(-6px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .notif-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: .85rem 1rem;
      border-bottom: 1px solid #f1f5f9;
    }
    .notif-header-title {
      font-size: .875rem;
      font-weight: 700;
      color: #0f172a;
    }
    .notif-mark-all {
      font-size: .72rem;
      color: var(--accent);
      cursor: pointer;
      background: none;
      border: none;
      font-family: inherit;
      font-weight: 600;
      padding: 0;
      transition: opacity .2s;
    }
    .notif-mark-all:hover { opacity: .7; }

    .notif-list { max-height: 360px; overflow-y: auto; }
    .notif-list::-webkit-scrollbar { width: 4px; }
    .notif-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

    .notif-item {
      display: flex;
      align-items: flex-start;
      gap: .75rem;
      padding: .85rem 1rem;
      border-bottom: 1px solid #f8fafc;
      text-decoration: none;
      transition: background .15s;
      position: relative;
      cursor: pointer;
    }
    .notif-item:last-child { border-bottom: none; }
    .notif-item:hover { background: #f8fafc; }
    .notif-item.unread { background: #fff7ed; }
    .notif-item.unread:hover { background: #fff3e0; }

    .notif-unread-dot {
      position: absolute;
      top: 50%;
      left: .35rem;
      transform: translateY(-50%);
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--accent);
      flex-shrink: 0;
    }

    .notif-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      flex-shrink: 0;
    }
    .notif-icon--jobs     { background: rgba(240,90,26,.1); }
    .notif-icon--expiring { background: rgba(245,158,11,.1); }
    .notif-icon--alert    { background: rgba(22,163,74,.1); }
    .notif-icon--default  { background: #f1f5f9; }

    .notif-body { flex: 1; min-width: 0; }
    .notif-title {
      font-size: .82rem;
      font-weight: 600;
      color: #0f172a;
      margin-bottom: .15rem;
      line-height: 1.3;
    }
    .notif-msg {
      font-size: .75rem;
      color: #64748b;
      line-height: 1.5;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .notif-time {
      font-size: .68rem;
      color: #94a3b8;
      margin-top: .2rem;
      font-family: 'IBM Plex Mono', monospace;
    }

    .notif-empty {
      padding: 2.5rem 1rem;
      text-align: center;
      color: #94a3b8;
      font-size: .82rem;
    }
    .notif-empty-icon { font-size: 1.75rem; margin-bottom: .5rem; }

    .notif-footer {
      padding: .7rem 1rem;
      border-top: 1px solid #f1f5f9;
      text-align: center;
    }
    .notif-footer a {
      font-size: .78rem;
      color: var(--accent);
      font-weight: 600;
      text-decoration: none;
    }
    .notif-footer a:hover { text-decoration: underline; }

    /* Unread badge on bell */
    .notif-badge {
      position: absolute;
      top: -2px;
      right: -2px;
      min-width: 16px;
      height: 16px;
      background: var(--accent);
      border-radius: 8px;
      border: 2px solid #faf9f7;
      font-size: .6rem;
      font-weight: 700;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 3px;
      pointer-events: none;
    }

    /* ── Notification Dropdown Mobile Fix ───────────────────── */
    @media (max-width: 480px) {
      .notif-dropdown {
        position: fixed;
        top: 62px;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: 0 0 16px 16px;
        border-left: none;
        border-right: none;
        border-top: none;
        max-height: 80vh;
        overflow-y: auto;
      }

      .notif-list {
        max-height: calc(80vh - 110px);
      }

      .notif-item {
        padding: .9rem 1.1rem;
      }

      .notif-msg {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
    }

    @media (max-width: 768px) and (min-width: 481px) {
      .notif-dropdown {
        width: 300px;
        right: -60px;
      }
    }

    /* Dark mode */
    [data-theme="dark"] .notif-dropdown {
      background: #1a1a28;
      border-color: rgba(255,255,255,.08);
      box-shadow: 0 8px 32px rgba(0,0,0,.4);
    }
    [data-theme="dark"] .notif-header { border-bottom-color: rgba(255,255,255,.07); }
    [data-theme="dark"] .notif-header-title { color: #f0ede8; }
    [data-theme="dark"] .notif-item { border-bottom-color: rgba(255,255,255,.04); }
    [data-theme="dark"] .notif-item:hover { background: rgba(255,255,255,.04); }
    [data-theme="dark"] .notif-item.unread { background: rgba(249,115,22,.07); }
    [data-theme="dark"] .notif-item.unread:hover { background: rgba(249,115,22,.1); }
    [data-theme="dark"] .notif-title { color: #f0ede8; }
    [data-theme="dark"] .notif-msg   { color: rgba(255,255,255,.45); }
    [data-theme="dark"] .notif-time  { color: rgba(255,255,255,.25); }
    [data-theme="dark"] .notif-footer { border-top-color: rgba(255,255,255,.07); }
    [data-theme="dark"] .notif-badge { border-color: #0a0f1e; }
    [data-theme="dark"] .notif-empty { color: rgba(255,255,255,.3); }