/* ============================================================
   header.css — HSCOL Navigation Header
   ============================================================ */

/* ── CSS Variables ── */
:root {
  --primary:    #1C185A;
  --accent:     #F4D48C;
  --gold:       #BE852B;
  --gold-hover: #A06D1E;
  --dark:       #111111;
  --text:       #333333;
  --muted:      #666666;
  --border:     #E5E5E5;
  --white:      #ffffff;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,0.06);
}

/* ── Global Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Inter', 'Montserrat', sans-serif;
  background: #fdfdfd;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navigation Bar ── */
.site-header {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  z-index: 1000;
  padding-top: 20px;
}

/* Floating Pill Container */
.header-glass {
  width: 92%;
  max-width: 1260px;
  border-radius: 50px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  padding: 10px 25px;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Logo ── */
.logo { display: inline-flex; align-items: center; }
.logo img { height: 48px; width: auto; }

/* ── Search ── */
.nav-search {
  flex: 1;
  max-width: 480px;
  margin: 0 30px;
  display: flex;
  border-radius: 30px;
  overflow: hidden;
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  padding: 5px 5px 5px 18px;
  align-items: center;
}

.nav-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: #333;
  outline: none;
  font-family: inherit;
  font-size: 13px;
}

.nav-search input::placeholder { color: #aaa; }

.nav-search button {
  background: var(--gold);
  border: none;  
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.nav-search button:hover { background: var(--gold-hover); }

/* ── Right Section ── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* Icon links */
.nav-icon {
  color: #666;
  transition: color var(--t, 0.25s) ease, transform var(--t, 0.25s) ease;
  display: flex;
  align-items: center;
}
.nav-icon:hover { color: var(--gold); transform: scale(1.1); }
.nav-icon:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
  color: var(--gold);
}

/* Role link (My Listings / My Projects) */
.nav-listings {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: 0.2s;
  white-space: nowrap;
}
.nav-listings:hover { color: var(--gold); }

/* ══════════════════════════════════════════════
   PUBLIC NAV BUTTONS (not logged in)
   ══════════════════════════════════════════════ */
.nav-link-pub {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-link-pub:hover { color: var(--gold); }

.nav-btn-login {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 1.5px solid var(--primary);
  padding: 9px 22px;
  border-radius: 30px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.nav-btn-login:hover {
  background: var(--primary);
  color: #fff;
}
.nav-btn-login:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.nav-btn-register {
  background: var(--gold);
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 30px;
  transition: background 0.2s ease;
  white-space: nowrap;
}
.nav-btn-register:hover { background: var(--gold-hover); }
.nav-btn-register:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ══════════════════════════════════════════════
   AVATAR & PROFILE DROPDOWN
   ══════════════════════════════════════════════ */
.nav-profile {
  position: relative;
}

.nav-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--primary);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  position: relative;
  border: 2px solid var(--gold);
  transition: box-shadow 0.2s;
}
.nav-avatar:hover { box-shadow: 0 0 0 3px rgba(190, 133, 43, 0.25); }
.nav-avatar:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 50%;
}

.avatar-dot {
  position: absolute;
  bottom: 1px;
  right: -1px;
  width: 11px;
  height: 11px;
  background: #2ecc71;
  border-radius: 50%;
  border: 2px solid white;
  /* hidden from screen readers via aria-hidden in PHP */
}

/* Dropdown panel */
.profile-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  width: 240px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 9999;
  overflow: hidden;
}

.profile-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown header */
.pd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 14px;
  background: var(--primary);
}

.pd-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
}

.pd-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.pd-role {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* Dropdown links */
.pd-links {
  padding: 10px 0;
}

.pd-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.pd-links a svg { flex-shrink: 0; color: #999; transition: color 0.15s; }

.pd-links a:hover,
.pd-links a:focus-visible {
  background: #f5f5f5;
  color: var(--primary);
  outline: none;
}
.pd-links a:hover svg,
.pd-links a:focus-visible svg { color: var(--primary); }

.pd-divider {
  margin: 6px 18px;
  height: 1px;
  background: var(--border);
}

/* Specificity-only — no !important needed */
.pd-links a.pd-logout           { color: #d63031; }
.pd-links a.pd-logout svg       { color: #d63031; }
.pd-links a.pd-logout:hover,
.pd-links a.pd-logout:focus-visible { background: #fff0ef; color: #b71c1c; }

/* ══════════════════════════════════════════════
   NOTIFICATIONS DROPDOWN
   ══════════════════════════════════════════════ */
.notif-wrapper {
  position: relative;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  right: -10px;
  width: 340px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notif-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--primary);
  color: #fff;
}

.nd-header h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.nd-mark-read {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.nd-mark-read:hover {
  color: #fff;
}

.nd-body {
  max-height: 360px;
  overflow-y: auto;
  background: #fdfdfd;
}

.nd-body::-webkit-scrollbar { width: 6px; }
.nd-body::-webkit-scrollbar-track { background: transparent; }
.nd-body::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }

.nd-item {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.nd-item:hover {
  background: #f5f7fa;
}

.nd-item.unread {
  background: rgba(244, 212, 140, 0.15); /* light tint of accent */
}

.nd-item.unread:hover {
  background: rgba(244, 212, 140, 0.25);
}

.nd-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.nd-message {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.nd-time {
  font-size: 11px;
  color: #767676; /* WCAG AA compliant */
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nd-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.nd-empty svg {
  color: #ddd;
  margin-bottom: 10px;
}

.nd-footer {
  padding: 12px;
  text-align: center;
  background: #fff;
  border-top: 1px solid var(--border);
}

.nd-footer a {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
.nd-footer a:hover {
  color: var(--gold);
}


/* ══════════════════════════════════════════════
   GLASS THEME (transparent hero header)
   No !important needed — specificity handles it
   ══════════════════════════════════════════════ */
nav.site-header.glass-theme {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
}

nav.site-header.glass-theme .header-glass {
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: none;
}

nav.site-header.glass-theme .nav-search {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
}
nav.site-header.glass-theme .nav-search input        { color: #fff; }
nav.site-header.glass-theme .nav-search input::placeholder { color: rgba(255,255,255,0.5); }

nav.site-header.glass-theme .nav-icon                { color: #fff; opacity: 0.9; }
nav.site-header.glass-theme .nav-listings            { color: #fff; }
nav.site-header.glass-theme .nav-link-pub            { color: #fff; }

nav.site-header.glass-theme .nav-btn-login {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
nav.site-header.glass-theme .nav-btn-login:hover     { background: rgba(255,255,255,0.15); }

nav.site-header.glass-theme .nav-btn-register {
  background: var(--gold);
  color: var(--primary);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .nav-search { display: none; }
  .header-glass { width: 95%; padding: 10px 18px; }
}

@media (max-width: 600px) {
  .nav-listings,
  .nav-link-pub  { display: none; }
  .nav-btn-login  { padding: 8px 16px; font-size: 13px; }
  .nav-btn-register { padding: 8px 16px; font-size: 13px; }
  .nav-right { gap: 12px; }
  .logo img  { height: 34px; }
}

/* ── Skip to Main Content Link ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 99999;
  background: #1C185A;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid #F4D48C;
}