/* ========== RESET ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  height: 100%;
  font-family: system-ui, sans-serif;
  color: #fff;
  overflow-x: hidden;
  overflow-y: hidden;
  padding-bottom: 40px;
}

/* ========== CUSTOM CURSOR ========== */
.custom-cursor {
  position: fixed;
  width: 0px;
  height: 0px;
  background: #ff4da6;
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10000;
  box-shadow: 0 0 15px #ff4da6, 0 0 30px #e91e63;
}

#custom-cursor-canvas {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  pointer-events: none;
}

/* Désactive le curseur personnalisé sur mobile/tactile */
@media (hover: none) {
  .custom-cursor,
  #custom-cursor-canvas {
    display: none;
  }
}

/* ========== VIDEO BACKGROUND ========== */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1px) brightness(1);
  z-index: -2;
}

#bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -1;
  transition: opacity 1s ease;
}

/* ========== OVERLAY ========== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: -1;
}

/* ========== HEADER ========== */
#header {
  position: sticky;
  top: 10px;
  z-index: 1000;
}

.header {
  position: sticky;
  top: 10px;
  z-index: 1000;
  width: 98%;
  margin: 0px auto;
  background: rgba(120, 46, 67, 0.75);
  border-radius: 25px;
  backdrop-filter: blur(5px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  font-family: 'Bungee', cursive;
  transition: padding 0.1s ease, box-shadow 0.1s ease;
}

/* ========== NAV ========== */
.nav {
  max-width: 1880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1rem 2.5rem;
  transition: padding 0.35s ease, gap 0.35s ease;
}

/* ========== DONATE ========== */
.donate img {
  max-height: 60px;
  max-width: 180px;
  border-radius: 10%;
  transition: transform 0.35s ease, height 0.3s ease, width 0.3s ease;
}

/* ========== LOGO ========== */
.logo img {
  max-height: 120px;
  max-width: 120px;
  border-radius: 50%;
  border: 3px solid #000;
  transition: transform 0.35s ease, height 0.3s ease, width 0.3s ease;
}

/* ========== NAV LINKS DESKTOP ========== */
.desktop-nav {
  list-style: none;
  display: flex;
  gap: 2.4rem;
}

.desktop-nav a {
  display: inline-block;
  font-family: 'Bungee', cursive;
  font-size: 2rem;
  color: #fff;
  text-decoration: none;
  transition: color 0.35s ease, transform 0.35s ease, font-size 0.35s ease;
  transform-origin: center;
}

.desktop-nav a.active {
  color: #f39c12;
  font-weight: bold;
  text-decoration: underline;
  transform: scale(1.2);
}

.desktop-nav a:hover {
  color: #f39c12;
  transform: scale(1.2);
}

/* ========== HAMBURGER ========== */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 6px;
  margin-left: auto;
  z-index: 1100;
  -webkit-appearance: none;
  appearance: none;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 3px;
  background: #fff !important;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animation hamburger → croix */
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ========== MOBILE NAV ========== */
.mobile-nav {
  display: none;
  list-style: none;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem 1rem;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease, padding 0.3s ease;
}

.mobile-nav img {
  max-height: 5rem;
  width: auto;
  vertical-align: middle;
}

.mobile-nav.open {
  max-height: 500px;
  padding: 0.5rem 1rem 1rem;
}

.mobile-nav a {
  font-family: 'Bungee', cursive;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 12px;
  transition: color 0.2s, background 0.2s;
  display: block;
  text-align: center;
}

.mobile-nav a.active {
  color: #f39c12;
  text-decoration: underline;
}

.mobile-nav a:hover {
  color: #f39c12;
  background: rgba(255,255,255,0.07);
}

/* ========== HEADER SHRINK ========== */
.header.shrink {
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}

.header.shrink .nav {
  font-size: 1.3rem;
  padding: 0.05rem 2.5rem;
  transform: translateY(-2px);
}

.header.shrink .desktop-nav a {
  font-size: 1.5rem;
}

.header.shrink .logo img {
  transform: scale(0.75);
}

/* ========== SECTIONS ========== */
section {
  padding: 2rem 2rem 2rem 2rem;
  text-align: center;
  text-shadow: 2px 2px 4px black;
}

/* ========== FOOTER ========== */
footer {
  background-color: #222;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 16px;
  position: fixed;
  bottom: 0;
  width: 100%;
  height: 3.2rem;
  display: flex;
  align-items: center;
}

.footer-inner {
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-copy {
  white-space: nowrap;
  margin-right: 10rem;
}

.goal-bar-link {
  text-decoration: none;
  color: inherit;
  flex: 1;
  max-width: 800px;
  display: flex;
}

.goal-bar-link:hover .goal-bar-track {
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.goal-bar-wrapper {
  flex: 1;
  max-width: 800px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 16px;
}

.goal-label {
  white-space: nowrap;
  opacity: 0.75;
  flex-shrink: 0;
}

.goal-bar-track {
  position: relative;
  flex: 1;
  height: 1.8rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  display: flex;
  align-items: center;
}

.goal-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e91e63 40%, #f39c12);
  border-radius: 999px;
  transition: width 0.8s ease;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-weight: bold;
}

#goal-current {
  margin-left: auto;
  padding-right: 0.6rem;
  font-weight: bold;
  color: #000;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  z-index: 1;
  font-size: inherit;
  white-space: nowrap;
  position: relative;
  top: 1px;
}

#goal-target {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(calc(-50% + 1px));
  opacity: 0.85;
  z-index: 1;
  font-size: inherit;
  white-space: nowrap;
}

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 45px;
  height: 45px;
  background-color: #f39c12;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-size: 22px;
  border-radius: 50%;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s, transform 0.2s, opacity 0.4s, bottom 0.3s;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  background-color: #e67e22;
  transform: translateY(-3px);
}

/* ========== LANG SWITCHER ========== */
.lang-switcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
  flex-shrink: 0;
}
 
.lang-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  display: block;
  border-radius: 3px;
  padding: 0;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
 
.lang-btn img {
  display: block;
  width: 47px;
  height: 34px;
  object-fit: cover;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.15);
}
 
/* Langue active */
.lang-btn.active {
  border-color: #f39c12;
  background: rgba(243, 156, 18, 0.2);
  transform: scale(1.30);
}

/* ==============================================
   RESPONSIVE — DESKTOP (≤ 1800px)
   ============================================== */
@media (max-width: 1800px) {
  .desktop-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    max-width: 98%;
  }

  .desktop-nav li {
    width: calc(25% - 1rem);
    text-align: center;
  }

  .desktop-nav a {
    font-size: 1.7rem;
  }

  .donate img {
    max-height: 50px;
    max-width: 150px;
  }

  .logo img {
    max-height: 90px;
    max-width: 90px;
  }
}

/* ==============================================
   RESPONSIVE — DESKTOP (≤ 1400px)
   ============================================== */
@media (max-width: 1400px) {
  .footer-copy {
    white-space: nowrap;
    margin-right: 0rem;
  }
}

/* ==============================================
   RESPONSIVE — TABLETTE (≤ 1024px)
   ============================================== */
@media (max-width: 1024px) {
  .desktop-nav a {
    font-size: 1.2rem;
  }

  .desktop-nav {
    gap: 0.8rem;
  }

  .logo img {
    max-height: 70px;
    max-width: 70px;
  }

  .donate img {
    max-height: 45px;
    max-width: 130px;
  }

  .nav {
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }
}

/* ==============================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================== */
@media (max-width: 768px) {
  body {
    padding-bottom: 5rem;
  }
  
  #header-donate {
    display: none;
  }

  #header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Header : hauteur forcée, pas de débordement */
  .header {
    top: 6px;
    width: 96%;
    border-radius: 16px;
    overflow: hidden;
    max-height: 60px; /* ← hauteur max forcée (menu fermé) */
  }

  /* Quand le menu mobile est ouvert, on laisse le header s'agrandir */
  .header.menu-open {
    max-height: 600px;
    transition: max-height 0.4s ease;
  }

  /* Nav : hauteur fixe, logo à gauche, hamburger à droite */
  .nav {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0;
    height: 60px;
    padding: 0 0.9rem;
  }

  /* Logo centré verticalement */
  .logo {
    display: flex;
    align-items: center;
    height: 100%;
  }

  /* Cache COMPLÈTEMENT la nav desktop */
  .desktop-nav {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Affiche le bouton hamburger */
  .hamburger {
    display: flex;
  }

  /* Affiche la nav mobile (en colonne sous la nav) */
  .mobile-nav {
    display: flex;
  }

  /* Logo calé dans la hauteur fixe */
  .logo img {
    max-height: 44px;
    max-width: 44px;
    position: relative;
    top: 2px; /* ← ajuste cette valeur (positif = descend, négatif = monte) */
  }

  /* Header shrink : inutile sur mobile, on neutralise */
  .header.shrink .nav {
    height: 60px;
    padding: 0 0.9rem;
    transform: none;
  }

  .header.shrink .logo img {
    transform: none;
  }

  .header.shrink .desktop-nav a {
    font-size: inherit;
  }

  /* Sections */
  section {
    padding: 1.2rem 1rem;
  }

  /* Footer */
  footer {
    height: auto;
    padding: 0.4rem 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0.5rem;
  }

  .goal-bar-link {
    width: 95%;
  }
  
  .goal-bar-wrapper {
    flex-direction: column;
    align-items: center;
    width: 95%;
    gap: 0.2rem;
  }

  .goal-bar-track {
    width: 100%;
    flex: none;
  }

  .footer-copy {
    font-size: 10px;
    opacity: 0.75;
  }

  #goal-current {
    position: absolute;
    left: 0.6rem;
    top: 48%;
    transform: translateY(calc(-50% + 1px));
    margin-left: 0;
    padding-right: 0;
  }

  /* Back to top : évite chevauchement footer */
  .back-to-top {
    bottom: 60px;
    right: 12px;
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  /* Changement de langue */
  .lang-switcher {
    flex-direction: row;   /* ← en ligne sur mobile */
    position: absolute;
    left: 1.2rem;          /* ← calé à gauche */
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    gap: 0.5rem;
  }
 
  .lang-btn {
    font-size: 1.1rem;
    padding: 3px 5px;
    padding: 0;
  }

  .lang-btn img {
    width: 42px;
    height: 30px;
  }
}

/* ==============================================
   RESPONSIVE — PETIT MOBILE (≤ 480px)
   ============================================== */
@media (max-width: 480px) {
  .mobile-nav a {
    font-size: 1.2rem;
  }

  .logo img {
    max-height: 50px;
    max-width: 50px;
  }
}
