/* global.css */

/* Reset and box-sizing */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
  --bg:#fff; --text:#111; --muted:#6b7280;
  --border:rgba(17,17,17,.08);
  --card:rgba(255,255,255,.92);
  --shadow:0 10px 30px rgba(0,0,0,.12), 0 3px 8px rgba(0,0,0,.06);
  --ring:0 0 0 3px rgba(17,17,17,.18);
  --accent:#111; /* change en #16a34a si tu veux une touche “éco” */
}
[data-theme="dark"]{
  --bg:#0b0b0b; --text:#e5e5e5; --muted:#a3a3a3;
  --border:rgba(255,255,255,.10);
  --card:rgba(18,18,18,.92);
  --shadow:0 20px 50px rgba(0,0,0,.6);
  --ring:0 0 0 3px rgba(99,102,241,.35);
}


/* Base Styles */
html, body {
    font-family: 'Futura PT', system-ui, 'Helvetica Neue', sans-serif;
    font-size: clamp(0.875rem, 0.38vw + 0.8rem, 1.125rem);
    font-weight: 300;
    line-height: 1.08;
    color: #111111;
    letter-spacing: 0.01em;
    margin: 0;
    padding: 0;
    margin-top: 40px;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px; /* Adjusted padding for better spacing */
    background-color: #fff; /* White background */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 80px;
}

.nav-left,
.nav-center,
.nav-right {
    display: flex;
    align-items: center;
}

/* Navigation Links */
.nav-links a {
    text-decoration: none;
    color: #111111;
    padding: 10px 15px;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #333; /* Hover color */
}

/* Logo Centered */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    font-weight: 100;
    font-size: 34px;
    text-decoration: none !important;
    color: #111111 !important;
    transition: color 0.3s ease;
}

/* Custom Button */
.btn-custom {
    padding: 8px 16px;
    color: #FFFFFF !important;
    background-color: #111111;
    border: none;
    border-radius: 36px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-custom:hover {
    background-color: #333333;
}

.nav-auth {
    text-decoration: none;
    color: #111111;
    margin-left: 10px;
    transition: color 0.3s ease;
}

.nav-auth:hover {
    color: #333;
}

/* Hamburger Menu */
.hamburger {
    display: none; /* Hidden by default */
    flex-direction: column;
    justify-content: space-between;
    width: 25px;
    height: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.hamburger span {
    display: block;
    height: 2px;
    background-color: #111111;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.hamburger:hover span {
    background-color: #333;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px; /* Ajustez à la hauteur de votre navbar */
    left: 0;
    right: 0;
    background-color: #ffffff;
    flex-direction: column;
    align-items: center;
    overflow-y: auto;
    max-height: calc(100vh - 60px); /* Ajusté à la hauteur réduite de la navbar */
    z-index: 999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.mobile-menu.open {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    padding: 10px 0; /* Réduit le padding */
    text-align: center;
    width: 100%;
    text-decoration: none;
    color: #111111;
    border-bottom: 1px solid #ddd;
    font-size: 1em; /* Réduit la taille de la police */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.mobile-menu a:hover {
    background-color: #f0f0f0;
    color: #333;
}

/* User Avatar */
.user-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.user-avatar {
    width: 35px; /* Réduit la taille */
    height: 35px; /* Réduit la taille */
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ddd;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.user-avatar img.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.user-avatar .user-initial {
    font-size: 1em; /* Réduit la taille de la police */
    font-weight: bold;
    color: #fff;
    background-color: #6c757d;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Dropdown Menu (rework) */
.user-avatar-wrapper[aria-expanded="true"] .user-avatar{
  transform: scale(1.03);
  box-shadow: var(--ring);
}

.user-menu{
  position: absolute;
  top: 48px;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 280px;
  padding: 10px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  z-index: 1000;

  opacity: 0;
  transform: translateY(6px) scale(.98);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease;
  display: none;
}
.user-menu.open{
  display: flex;
  opacity: 1;
  transform: translateY(12px) scale(1);
}
@supports not (backdrop-filter: blur(2px)){
  .user-menu{ background: var(--bg); }
}

/* Petite flèche */
.user-menu::before{
  content:"";
  position:absolute;
  top:-7px; right:18px;
  width:14px; height:14px;
  background: var(--card);
  border-left:1px solid var(--border);
  border-top:1px solid var(--border);
  transform: rotate(45deg);
}

/* Items */
.user-menu-item{ padding: 4px; }
.user-menu-link{
  display:flex; align-items:center; gap:12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration:none;
  color: var(--text);
  font-size:.95em;
  transition: transform .12s ease, background-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.user-menu-link:hover{
  background: rgba(17,17,17,.04);
}
[data-theme="dark"] .user-menu-link:hover{
  background: rgba(255,255,255,.06);
}
.user-menu-link:active{ transform: translateY(1px); }
.user-menu-link:focus-visible{
  outline: none;
  box-shadow: var(--ring);
  background: rgba(17,17,17,.03);
}
[data-theme="dark"] .user-menu-link:focus-visible{
  background: rgba(255,255,255,.07);
}

/* Icônes */
.icon-svg{
  width: 20px; height: 20px;
  stroke: currentColor;
  opacity: .85;
  transition: opacity .12s ease;
}
.user-menu-link:hover .icon-svg{ opacity: 1; }

/* Séparateur */
.user-menu-separator{
  height:1px; margin:4px 0;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

/* Mobile tweaks */
@media (max-width:768px){
  .user-menu{ top: 40px; min-width: 220px; }
}

/* Motion safe */
@media (prefers-reduced-motion: reduce){
  .user-menu{ transition: none; }
  .user-menu-link{ transition: none; }
}


/* Footer */
footer {
    background-color: #222; /* Fond gris foncé */
    color: #ffffff;
    padding: 40px 20px; /* Augmentation du padding pour plus d'espace */
    text-align: center;
    font-size: 0.9em;
    margin-top: 40px;
}

footer p {
    margin: 10px 0;
    font-size: 0.9em;
}

.footer-nav ul {
    display: flex;
    flex-wrap: wrap; /* Permet aux éléments de passer à la ligne si nécessaire */
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    gap: 20px;
}

.footer-nav a {
    color: #aaaaaa; /* Gris clair */
    text-decoration: none;
    font-size: 0.85em;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: #ffffff;
}

/* Section d'avertissement sur les risques */
.risk-warning {
    margin: 20px auto;
    padding: 10px 5%;
    color: #cccccc;
    font-size: 0.85em;
    line-height: 1.6;
    max-width: 800px;
    text-align: justify;
}

.risk-warning p {
    margin-bottom: 10px;
}

/* Informations sur l'entreprise */
.company-info {
    margin: 20px auto;
    font-size: 0.85em;
    color: #cccccc;
    line-height: 1.6;
}

.company-info p {
    margin: 5px 0;
}

/* Réseaux sociaux */
.social-media {
    margin: 20px 0;
}

.social-media a {
    display: inline-block;
    margin: 0 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.social-media a:hover {
    opacity: 1;
}

.social-media img {
    width: 24px;
    height: 24px;
}

/* Responsivité */
@media (max-width: 768px) {
    .footer-nav ul {
        gap: 10px;
    }

    .risk-warning,
    .company-info {
        padding: 0 10px;
    }
}

/* Media Queries pour les petits écrans */
@media (max-width: 1200px) {
    .navbar {
        justify-content: space-between;
        padding: 10px 10px;
        height: 60px;
    }

    html, body {
        margin-top: 30px;
    }

    .nav-center {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .logo {
        font-size: 28px;
    }

    /* Afficher le menu hamburger */
    .hamburger {
        display: flex;
    }

    /* Cacher les liens de navigation sur mobile */
    .nav-links {
        display: none;
    }

    /* Cacher les liens de connexion/inscription sur mobile si l'utilisateur n'est pas connecté */
    .nav-right a.nav-auth {
        display: none;
    }

    /* Afficher l'avatar utilisateur si connecté */
    .user-avatar-wrapper {
        display: block;
    }

    /* Ajustements pour le menu mobile */
    .mobile-menu {
        padding-top: 30px;
    }

    /* Ajustements pour le menu mobile */
    .mobile-menu a {
        font-size: 1.2em;
        padding: 20px 0;
    }
}

/* Assurez-vous que le menu mobile est toujours caché sur les grands écrans */
@media (min-width: 1201px) {
    .mobile-menu {
        display: none !important;
    }
}






/* Buttons inside cookie UI (optional enhancement) */
#cookie-banner button, #cookie-modal button {
  font: inherit;
}
#cookie-banner button:hover,
#cookie-modal button:hover { filter: brightness(0.99); }
#cookie-banner button:focus-visible,
#cookie-modal button:focus-visible { outline: none; box-shadow: var(--ring); }

/* ——— Liens de navigation (desktop) ——— */
.nav-links a,
.nav-right .nav-links { /* même look pour les liens à droite */
  text-decoration: none;
  color: #111111;
  padding: 10px 15px;
  margin: 0 5px;
  transition: color 0.3s ease;
}
.nav-links a:hover,
.nav-right .nav-links:hover {
  color: #333;
}

/* ——— Menu mobile + icônes ——— */
.mobile-menu {
  display: none;
  position: fixed;
  top: 60px;
  left: 0; right: 0;
  background-color: #ffffff;
  flex-direction: column;
  align-items: center;          /* ✅ centre le conteneur */
  justify-content: center;      /* ✅ centre vertical si besoin */
  text-align: center;           /* ✅ centre le texte */
  overflow-y: auto;
  max-height: calc(100vh - 60px);
  z-index: 999;
  transition: opacity .3s ease, visibility .3s ease;
  opacity: 0; visibility: hidden;
}

.mobile-menu.open {
  display: flex;
  opacity: 1; visibility: visible;
}

.mobile-menu a:hover {
  background-color: #f7f7f7;
  color: #111;
}

/* Liens centrés */
.mobile-menu a {
  width: 100%;
  max-width: 540px;             /* ✅ garde une largeur confortable */
  display: block;               /* ✅ pas de flex → centrage par text-align */
  padding: 16px 0;
  text-align: center;
  text-decoration: none;
  color: #111111;
  border-bottom: 1px solid #ddd;
  font-size: 1.05rem;
}

.mm-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .9;
}
.mm-icon svg {
  width: 22px; height: 22px;
  stroke: currentColor;
}

/* Sur écrans étroits, un peu plus grand pour l’accessibilité */
@media (max-width: 420px) {
  .mobile-menu a { font-size: 1.05rem; }
  .mm-icon, .mm-icon svg { width: 24px; height: 24px; }
}

/* Cohérence hauteur barre + noscript iframe invisible */
.navbar { height: 80px; }
@media (max-width: 1200px) {
  .navbar { height: 60px; }
  .mobile-menu { top: 60px; }
}
