/* ═══════════════════════════════════════════════════════════════════════════
   NAV redesign v9 — FIX double cadre + theme-toggle vide
   Le style "card" est sur la DIV interne uniquement (pas sur le <nav> parent)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Parent <nav> : ZERO style visuel, juste positioning ─── */
#nav {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  border-radius: 0 !important;
  animation: ec-nav-in 540ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 100ms;
}

/* ─── DIV interne : la "card" qui change au scroll ─── */
#nav > div {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 14px !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  transition:
    background 280ms cubic-bezier(0.4, 0, 0.2, 1),
    -webkit-backdrop-filter 280ms cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 280ms cubic-bezier(0.4, 0, 0.2, 1),
    border-color 280ms cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Scrolled : glass blur sur la div interne ─── */
#nav.is-scrolled > div {
  background: rgba(6, 10, 20, 0.78) !important;
  -webkit-backdrop-filter: saturate(180%) blur(22px) !important;
  backdrop-filter: saturate(180%) blur(22px) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 36px -8px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="light"] #nav.is-scrolled > div {
  background: rgba(255, 254, 248, 0.85) !important;
  border-color: rgba(20, 18, 12, 0.10) !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 12px 32px -8px rgba(120, 80, 40, 0.14) !important;
}

/* Inline padding ajustement */
#nav > div {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

/* ─── Theme-toggle : forcer SVG visibles ─── */
#nav .nav-theme-toggle,
#nav-links .nav-theme-toggle {
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  background: transparent !important;
  color: rgba(203, 213, 225, 0.85) !important;
  cursor: pointer;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  transition: all 200ms ease-out;
  position: relative;
}
#nav .nav-theme-toggle:hover,
#nav-links .nav-theme-toggle:hover {
  color: #DC2626 !important;
  border-color: rgba(220, 38, 38, 0.40) !important;
  background: rgba(220, 38, 38, 0.06) !important;
}

/* Force SVG visibles dans le theme-toggle */
#nav .nav-theme-toggle svg,
#nav-links .nav-theme-toggle svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor !important;
  fill: none !important;
  flex-shrink: 0;
  display: block !important; /* override potential display:none from elsewhere */
}

/* Affichage conditionnel sun/moon SELON theme */
#nav .nav-theme-toggle .nav-icon-sun,
#nav-links .nav-theme-toggle .nav-icon-sun {
  display: none !important;
}
#nav .nav-theme-toggle .nav-icon-moon,
#nav-links .nav-theme-toggle .nav-icon-moon {
  display: block !important;
}
[data-theme="light"] #nav .nav-theme-toggle .nav-icon-sun,
[data-theme="light"] #nav-links .nav-theme-toggle .nav-icon-sun {
  display: block !important;
}
[data-theme="light"] #nav .nav-theme-toggle .nav-icon-moon,
[data-theme="light"] #nav-links .nav-theme-toggle .nav-icon-moon {
  display: none !important;
}

[data-theme="light"] #nav .nav-theme-toggle,
[data-theme="light"] #nav-links .nav-theme-toggle {
  border-color: rgba(20, 18, 12, 0.16) !important;
  color: rgba(58, 58, 64, 0.85) !important;
}

/* ─── Logo & wordmark : design propre ─── */
#nav > div > a:first-child {
  display: inline-flex !important;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text, #F1F5F9) !important;
  transition: opacity 200ms ease-out;
}
#nav > div > a:first-child:hover { opacity: 0.85; }
/* removed obsolete pill rule */
/* removed obsolete pill rule */
/* removed obsolete pill rule */

/* ─── Nav links design ─── */
@media (min-width: 1024px) {
  #nav-links {
    display: flex !important;
    align-items: center;
    gap: 28px !important;
  }
  #nav-links > a {
    position: relative;
    color: rgba(203, 213, 225, 0.78) !important;
    font-size: 0.92rem !important;
    font-weight: 500 !important;
    padding: 6px 2px !important;
    transition: color 200ms ease-out !important;
    text-decoration: none !important;
  }
  #nav-links > a:hover { color: #FFFFFF !important; }
  #nav-links > a:not(#nav-auth-btn)::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1.5px;
    background: linear-gradient(90deg, #DC2626 0%, #991B1B 100%);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: right center;
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  #nav-links > a:not(#nav-auth-btn):hover::after { transform: scaleX(1); transform-origin: left center; }
  #nav-links > a[aria-current="page"] {
    color: #FFFFFF !important;
    font-weight: 600 !important;
  }
  #nav-links > a[aria-current="page"]::after { transform: scaleX(1); }

  [data-theme="light"] #nav-links > a { color: rgba(58, 58, 64, 0.85) !important; }
  [data-theme="light"] #nav-links > a:hover,
  [data-theme="light"] #nav-links > a[aria-current="page"] { color: #1A1A1F !important; }
}

/* CTA Connexion / Mon compte / Déconnexion */
#nav-links a#nav-auth-btn {
  position: relative;
  padding: 8px 18px !important;
  border: 1px solid rgba(220, 38, 38, 0.30) !important;
  border-radius: 8px !important;
  color: #FFFFFF !important;
  font-weight: 600 !important;
  font-size: 0.88rem !important;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.10) 0%, rgba(220, 38, 38, 0.03) 100%) !important;
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none !important;
  overflow: hidden;
}
#nav-links a#nav-auth-btn::after { display: none !important; } /* override underline animé */
#nav-links a#nav-auth-btn:hover {
  background: linear-gradient(135deg, #DC2626 0%, #991B1B 100%) !important;
  border-color: rgba(220, 38, 38, 0.60) !important;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -4px rgba(220, 38, 38, 0.40);
  color: #FFFFFF !important;
}

[data-theme="light"] #nav-links a#nav-auth-btn {
  color: #1A1A1F !important;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, rgba(220, 38, 38, 0.01) 100%) !important;
}
[data-theme="light"] #nav-links a#nav-auth-btn:hover { color: #FFFFFF !important; }

/* Burger mobile */
#nav-toggle {
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  border-radius: 8px !important;
  width: 40px !important;
  height: 40px !important;
  color: rgba(203, 213, 225, 0.85) !important;
  background: transparent !important;
  transition: all 200ms ease-out !important;
}
#nav-toggle:hover {
  border-color: rgba(220, 38, 38, 0.40) !important;
  color: #DC2626 !important;
}

/* Page-index ridicule : caché */
.page-index { display: none !important; }

/* Animation entrée nav */
@media (prefers-reduced-motion: no-preference) {
  @keyframes ec-nav-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 1023px) {
  #nav > div { padding-top: 10px !important; padding-bottom: 10px !important; }
}

/* ═══ FIX theme-toggle SVG visibles — stroke épais + couleur contrastée ═══ */
#nav .nav-theme-toggle,
#nav-links .nav-theme-toggle {
  color: #E2E8F0 !important; /* gris très clair, bien visible */
}
#nav .nav-theme-toggle svg,
#nav-links .nav-theme-toggle svg {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  display: block;
  pointer-events: none;
}
#nav .nav-theme-toggle svg path,
#nav .nav-theme-toggle svg circle,
#nav-links .nav-theme-toggle svg path,
#nav-links .nav-theme-toggle svg circle {
  stroke: currentColor !important;
  stroke-width: 2 !important;
  fill: none !important;
  vector-effect: non-scaling-stroke;
}
#nav .nav-theme-toggle:hover,
#nav-links .nav-theme-toggle:hover {
  color: #FFFFFF !important;
  border-color: rgba(220, 38, 38, 0.55) !important;
  background: rgba(220, 38, 38, 0.10) !important;
}

/* En light : couleur plus sombre pour visibilité */
[data-theme="light"] #nav .nav-theme-toggle,
[data-theme="light"] #nav-links .nav-theme-toggle {
  color: #1A1A1F !important;
}
[data-theme="light"] #nav .nav-theme-toggle:hover,
[data-theme="light"] #nav-links .nav-theme-toggle:hover {
  color: #DC2626 !important;
}

/* ═══ FALLBACK FontAwesome pour theme-toggle (SVG ne s'affiche pas chez user) ═══ */
#nav .nav-theme-toggle svg,
#nav-links .nav-theme-toggle svg,
#mobile-nav .mobile-theme-toggle svg {
  display: none !important;
}
#nav .nav-theme-toggle::before,
#nav-links .nav-theme-toggle::before,
#mobile-nav .mobile-theme-toggle::before {
  font-family: 'Font Awesome 6 Free' !important;
  font-weight: 900 !important;
  content: '\f186' !important; /* fa-moon */
  font-size: 15px !important;
  color: currentColor !important;
  display: inline-block !important;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased;
}
[data-theme="light"] #nav .nav-theme-toggle::before,
[data-theme="light"] #nav-links .nav-theme-toggle::before,
[data-theme="light"] #mobile-nav .mobile-theme-toggle::before {
  content: '\f185' !important; /* fa-sun */
}

/* ═══ HARD FIX : cacher TOUS les SVG natifs theme-toggle (vs ::before FontAwesome) ═══ */
#nav .nav-theme-toggle svg,
#nav-links .nav-theme-toggle svg,
#mobile-nav .mobile-theme-toggle svg,
.nav-theme-toggle .nav-icon-sun,
.nav-theme-toggle .nav-icon-moon,
.mobile-theme-toggle .nav-icon-sun,
.mobile-theme-toggle .nav-icon-moon,
[data-theme-toggle] svg {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  position: absolute !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* ═══ LOGO NAV redesign : pill rouge plein + éclair blanc glow ═══ */
/* removed obsolete pill rule */

/* Halo rouge subtil derrière */
/* removed obsolete pill rule */
/* removed obsolete pill rule */
/* removed obsolete pill rule */

/* Éclair blanc + glow */
/* removed obsolete pill rule */

/* Wordmark ElectroCAD : font tighter + tracking premium */
/* removed obsolete pill rule */

/* Light theme : same gradient rouge mais avec border accent visible */
[data-theme="light"] /* removed obsolete pill rule */
[data-theme="light"] /* removed obsolete pill rule */

/* Mobile : taille un peu réduite */
@media (max-width: 480px) {
  /* removed obsolete pill rule */
  /* removed obsolete pill rule */
  /* removed obsolete pill rule */
}

/* Animation entrée subtle */
@media (prefers-reduced-motion: no-preference) {
  /* removed obsolete pill rule */
  @keyframes ec-logo-glow-in {
    from { opacity: 0; transform: scale(0.85) rotate(-8deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FIX v10.1 — neutralize old pill rules when <a> is .ec-wordmark
   Sizing/anims handled by logo-wordmark-v10.css + v7-unified.css.
   ═══════════════════════════════════════════════════════════════════════════ */
#nav > div > a.ec-wordmark {
  font-family: inherit !important;
  letter-spacing: -0.04em !important;
}
#nav > div > a.ec-wordmark > .ec-wordmark__electro,
#nav > div > a.ec-wordmark > .ec-wordmark__cad,
#nav > div > a.ec-wordmark > .ec-wordmark__bolt,
#nav > div > a.ec-wordmark:hover > .ec-wordmark__electro,
#nav > div > a.ec-wordmark:hover > .ec-wordmark__cad,
#nav > div > a.ec-wordmark:hover > .ec-wordmark__bolt {
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
/* Important: remove the global svg size lock for wordmark bolt */
#nav > div > a.ec-wordmark .ec-wordmark__bolt svg {
  width: 100% !important;
  height: 100% !important;
  color: inherit !important;
}
