/* ============================================================
   NEXSAS — header.css
   CSS commun à header_candidat · header_intermediaire · header_entreprise
   Chargé via <link> dans base.html ou {% block styles %}

   ORDRE DES ENFANTS DE .nx-inner (HTML) :
     1. .nx-logo-link   → col 1 (auto)
     2. .nx-burger      → display:none desktop → retiré du flux
     3. .nx-search-wrap → col 2 (1fr)
     4. .nx-nav         → col 3 (auto)

   Sur mobile (≤ 900px) :
     grille → auto 1fr, burger explicitement en col 2 + justify-self:end
   ============================================================ */


/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

.nx-header {
  --nx-indigo:       #5b5ef4;
  --nx-indigo-deep:  #3b3dbf;
  --nx-violet:       #8b5cf6;
  --nx-rose:         #f43f5e;
  --nx-amber:        #f59e0b;
  --nx-glass:        rgba(255, 255, 255, 0.90);
  --nx-border:       rgba(91, 94, 244, 0.13);
  --nx-pill:         rgba(91, 94, 244, 0.07);
  --nx-pill-hover:   rgba(91, 94, 244, 0.14);
  --nx-text:         #181a2e;
  --nx-muted:        #6b7280;
  --nx-ease-spring:  cubic-bezier(.34, 1.56, .64, 1);
  --nx-ease-smooth:  cubic-bezier(.4, 0, .2, 1);
}


/* ============================================================
   2. SHELL & STRUCTURE
   ============================================================ */

.nx-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  background: var(--nx-glass);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid var(--nx-border);
  box-shadow: 0 4px 24px rgba(91, 94, 244, 0.09);
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
}

.nx-header::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2.5px;
  background-size: 200% 100%;
  animation: nx-shimmer 5s linear infinite;
}

@keyframes nx-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.nx-inner {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 120px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2rem;
}


/* ============================================================
   3. LOGO
   ============================================================ */

.nx-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nx-logo-img {
  height: 80px;
  width: auto;
  border-radius: 12px;
  transition: transform .3s var(--nx-ease-spring);
}

.nx-logo-img:hover { transform: scale(1.06); }


/* ============================================================
   4. BARRE(S) DE RECHERCHE
   ============================================================ */

.nx-search-wrap {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.nx-search-wrap--double {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 900px;
}

.nx-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(91, 94, 244, 0.05);
  border: 1.5px solid rgba(91, 94, 244, 0.17);
  border-radius: 999px;
  padding: 0.35rem 0.45rem 0.35rem 1.1rem;
  transition: border-color .25s, box-shadow .25s, background .25s;
}

.nx-search-form:focus-within {
  background: #fff;
  border-color: var(--nx-indigo);
  box-shadow: 0 0 0 4px rgba(91, 94, 244, 0.11);
}

.nx-divider {
  width: 1px;
  height: 20px;
  background: rgba(91, 94, 244, 0.17);
  flex-shrink: 0;
}

.nx-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.nx-field > i {
  color: var(--nx-indigo);
  font-size: 0.82rem;
  flex-shrink: 0;
  opacity: .7;
}

.nx-field input,
.nx-field select {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--nx-text);
  width: 100%;
  min-width: 0;
  outline: none;
}

.nx-field input::placeholder { color: var(--nx-muted); }

.nx-field select {
  cursor: pointer;
  color: var(--nx-muted);
  -webkit-appearance: none;
}

.nx-field select:focus { color: var(--nx-text); }

.nx-salary-group        { flex: 1.3; }
.nx-salary-group input  { flex: 1.5; }
.nx-salary-group select { flex: 1; }

.nx-sep {
  font-size: 0.75rem;
  color: var(--nx-muted);
  padding: 0 0.2rem;
  flex-shrink: 0;
}

.nx-search-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nx-indigo), var(--nx-violet));
  color: #fff;
  font-family: 'Syne', 'Segoe UI', sans-serif;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
  transition: transform .2s var(--nx-ease-spring), box-shadow .2s;
  box-shadow: 0 4px 14px rgba(91, 94, 244, 0.32);
}

.nx-search-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 22px rgba(91, 94, 244, 0.44);
}

.nx-search-btn:active { transform: scale(.97); }


/* ============================================================
   5. NAVIGATION DROITE
   ============================================================ */

.nx-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nx-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--nx-text);
  background: var(--nx-pill);
  border: 1.5px solid transparent;
  white-space: nowrap;
  transition:
    background .2s,
    color .2s,
    border-color .2s,
    transform .2s var(--nx-ease-spring),
    box-shadow .2s;
}

.nx-link i { font-size: 0.87rem; opacity: .75; transition: opacity .2s; }

.nx-link:hover {
  background: var(--nx-pill-hover);
  color: var(--nx-indigo);
  border-color: rgba(91, 94, 244, 0.24);
  transform: translateY(-2px);
}

.nx-link:hover i { opacity: 1; }

.nx-link.nx-active {
  background: linear-gradient(135deg, var(--nx-indigo), var(--nx-violet));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(91, 94, 244, 0.28);
}

.nx-link.nx-active i     { opacity: 1; color: #fff; }
.nx-link.nx-active:hover { color: #fff; box-shadow: 0 8px 22px rgba(91, 94, 244, 0.4); }

.nx-link.nx-explore { border-color: rgba(91, 94, 244, 0.18); }

.nx-link.nx-admin {
  background: linear-gradient(135deg, var(--nx-amber), #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.nx-link.nx-admin i     { opacity: 1; color: #fff; }
.nx-link.nx-admin:hover { color: #fff; box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4); }

.nx-link.nx-settings {
  padding: 0.5rem 0.7rem;
  background: transparent;
  border-color: rgba(91, 94, 244, 0.14);
}

.nx-link.nx-settings i       { font-size: 1rem; color: var(--nx-muted); opacity: 1; }
.nx-link.nx-settings:hover i { color: var(--nx-indigo); }


/* ============================================================
   6. BURGER
   ============================================================ */

.nx-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--nx-pill);
  border: 1.5px solid rgba(91, 94, 244, 0.18);
  border-radius: 12px;
  cursor: pointer;
  color: var(--nx-indigo);
  font-size: 1.1rem;
  flex-shrink: 0;
  transition: background .2s, transform .2s var(--nx-ease-spring);
}

.nx-burger:hover {
  background: var(--nx-pill-hover);
  transform: scale(1.08);
}


/* ============================================================
   7. MOBILE DRAWER
   ============================================================ */

.nx-mobile-drawer {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem 1.5rem;
  border-top: 1px solid var(--nx-border);
  background: rgba(255, 255, 255, 0.97);
  animation: nx-drawer-in .22s var(--nx-ease-smooth);
}

@keyframes nx-drawer-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nx-drawer-search {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.85rem;
  border-radius: 16px;
  margin-bottom: 0.5rem;
}

.nx-drawer-search .nx-divider      { display: none; }
.nx-drawer-search .nx-field        { width: 100%; }
.nx-drawer-search .nx-salary-group { width: 100%; }
.nx-drawer-search .nx-search-btn   { width: 100%; justify-content: center; }

.nx-mobile-drawer > .nx-link {
  width: 100%;
  justify-content: flex-start;
  padding: 0.72rem 1rem;
  font-size: 0.95rem;
  border-radius: 12px;
}

.nx-header.nx-open .nx-mobile-drawer { display: flex; }


/* ============================================================
   8. RESPONSIVE
   ============================================================ */

/* Tablette (≤ 1100px) : labels masqués, icônes seules */
@media (max-width: 1100px) {
  .nx-inner            { gap: 1.5rem; }
  .nx-nav .nx-link span        { display: none; }
  .nx-link             { padding: 0.5rem 0.7rem; }
  .nx-link i           { font-size: 1rem; opacity: 1; }
  .nx-link.nx-settings { padding: 0.5rem 0.7rem; }
}

/* Mobile (≤ 900px) : burger mode
   Grille → 2 colonnes : Logo | espace
   Le burger (2ème enfant HTML) est placé explicitement en col 2, aligné à droite.
*/
@media (max-width: 900px) {
  .nx-header { position: relative; }

  .nx-inner {
    height: 62px;
    grid-template-columns: auto 1fr;
    padding: 0 1rem;
    gap: 0;
  }

  .nx-search-wrap { display: none; }
  .nx-nav         { display: none; }

  .nx-burger {
    display: flex;
    grid-column: 2;
    justify-self: end;
  }
}

/* Petit mobile (≤ 480px) */
@media (max-width: 480px) {
  .nx-inner    { padding: 0 0.75rem; }
  .nx-logo-img { height: 44px; }
}

/* Compensation sticky */
@media (max-width: 768px) {
  .nx-header { position: relative !important; top: auto !important; }
  body        { padding-top: 0 !important; }
}


/* ============================================================
   9. CANDIDAT (.nx-header--candidat)
   ============================================================ */

.nx-header--candidat::before {
  background: linear-gradient(90deg,
    var(--nx-indigo) 0%,
    var(--nx-violet) 40%,
    var(--nx-rose)   70%,
    var(--nx-indigo) 100%);
}

.nx-link.nx-profile {
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.28);
}

.nx-link.nx-profile i       { opacity: 1; color: #fff; }
.nx-link.nx-profile:hover   { color: #fff; box-shadow: 0 8px 22px rgba(244, 63, 94, 0.4); }


/* ============================================================
   10. INTERMÉDIAIRE (.nx-header--intermediaire)
   ============================================================ */

.nx-header--intermediaire {
  --nx-indigo:     #06b6d4;
  --nx-violet:     #8b5cf6;
  --nx-pill:       rgba(6, 182, 212, 0.07);
  --nx-pill-hover: rgba(6, 182, 212, 0.14);
  --nx-border:     rgba(6, 182, 212, 0.15);
}

.nx-header--intermediaire::before {
  background: linear-gradient(90deg,
    #06b6d4 0%,
    #8b5cf6 50%,
    #06b6d4 100%);
}

.nx-search-form.nx-search-user {
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.04);
}

.nx-search-form.nx-search-user:focus-within {
  border-color: #06b6d4;
  box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.11);
}

.nx-search-btn--user {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.32);
}

.nx-search-btn--user:hover {
  box-shadow: 0 8px 22px rgba(6, 182, 212, 0.44);
}

@media (max-width: 1100px) {
  .nx-search-btn--user span { display: none; }
  .nx-search-btn--user      { padding: 0.56rem 0.9rem; }
}

.nx-link.nx-profile-inter {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.28);
}

.nx-link.nx-profile-inter i     { opacity: 1; color: #fff; }
.nx-link.nx-profile-inter:hover { color: #fff; box-shadow: 0 8px 22px rgba(6, 182, 212, 0.4); }


/* ============================================================
   11. ENTREPRISE (.nx-header--entreprise)
   ============================================================ */

.nx-header--entreprise {
  --nx-indigo:     #10b981;
  --nx-violet:     #059669;
  --nx-pill:       rgba(16, 185, 129, 0.07);
  --nx-pill-hover: rgba(16, 185, 129, 0.14);
  --nx-border:     rgba(16, 185, 129, 0.15);
}

.nx-header--entreprise::before {
  background: linear-gradient(90deg,
    #10b981 0%,
    #3b82f6 50%,
    #10b981 100%);
}

.nx-search-form.nx-search-entreprise {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.04);
}

.nx-search-form.nx-search-entreprise:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.11);
}

.nx-search-btn--entreprise {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.32);
}

.nx-search-btn--entreprise:hover {
  box-shadow: 0 8px 22px rgba(16, 185, 129, 0.44);
}

@media (max-width: 1100px) {
  .nx-search-btn--entreprise span { display: none; }
  .nx-search-btn--entreprise      { padding: 0.56rem 0.9rem; }
}

.nx-link.nx-publish {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.nx-link.nx-publish i     { opacity: 1; color: #fff; }
.nx-link.nx-publish:hover { color: #fff; box-shadow: 0 8px 22px rgba(16, 185, 129, 0.4); }

.nx-link.nx-pending {
  background: linear-gradient(135deg, var(--nx-amber), #d97706);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.28);
}

.nx-link.nx-pending i     { opacity: 1; color: #fff; }
.nx-link.nx-pending:hover { color: #fff; box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4); }

.nx-link.nx-profile-entreprise {
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.nx-link.nx-profile-entreprise i     { opacity: 1; color: #fff; }
.nx-link.nx-profile-entreprise:hover { color: #fff; box-shadow: 0 8px 22px rgba(16, 185, 129, 0.4); }

.nx-link.nx-subscription {
  border-color: rgba(16, 185, 129, 0.3);
  color: #10b981;
}

.nx-link.nx-subscription:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
}

/* ============================================================
   12. PUBLIC (.nx-header--public)
       Pages non connectées : accueil, recherche publique…
   ============================================================ */

.nx-header--public::before {
  background: linear-gradient(90deg,
    var(--nx-indigo) 0%,
    var(--nx-violet) 40%,
    var(--nx-rose)   70%,
    var(--nx-indigo) 100%);
}

/* Connexion — contour discret */
.nx-link.nx-signin {
  background: transparent;
  border-color: rgba(91, 94, 244, 0.28);
  color: var(--nx-indigo);
  font-weight: 500;
}

.nx-link.nx-signin:hover {
  background: var(--nx-pill-hover);
  border-color: var(--nx-indigo);
  color: var(--nx-indigo);
}

/* Inscription — CTA plein gradient */
.nx-link.nx-signup {
  background: linear-gradient(135deg, var(--nx-indigo), var(--nx-violet));
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(91, 94, 244, 0.28);
}

.nx-link.nx-signup i     { opacity: 1; color: #fff; }
.nx-link.nx-signup:hover { color: #fff; box-shadow: 0 8px 22px rgba(91, 94, 244, 0.42); }