/* =========================
   Variables du thème
   ========================= */
:root {
  --bg: #E8EAED;
  --text: #222222;
  --muted: #666666;
  --accent: #007BFF;
  --card-bg: #f5f7fa;
  --header-bg: #f5f7fa;
  --nav-text: #333;
  --button-bg: #007BFF;
  --button-bg-hover: #0056b3;
  --footer-bg: #222222;
  --footer-text: #ffffff;
  --shadow: rgba(0,0,0,0.1);
  --card-shadow: rgba(0,0,0,0.08);
  --accent-color: #6ea8ff;          /* bleu doux */
  --nav-active-bg: rgba(110, 168, 255, 0.15);
  --nav-hover-bg: rgba(255, 255, 255, 0.06);
  --hover-bg: rgba(79, 140, 255, 0.1);
}

/* Thème sombre */
.dark {
  --bg: #0b1117;
  --text: #000000;
  --muted: #9aa6b2;
  --accent: #4f8cff;
  --card-bg: #0f1720;
  --header-bg: #0f1721;
  --nav-text: #e6eef6;
  --button-bg: #4f8cff;
  --button-bg-hover: #3a6dcc;
  --footer-bg: #0f1821;
  --footer-text: #e6eef6;
  --shadow: rgba(0,0,0,0.4);
  --card-shadow: rgba(0,0,0,0.35);
}

/* Fallback basé sur le système */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-override) {
    --bg: #0b1117;
    --text: #e6eef6;
    --muted: #9aa6b2;
    --accent: #4f8cff;
    --card-bg: #0f1720;
    --header-bg: #0f1821;
    --nav-text: #e6eef6;
    --button-bg: #4f8cff;
    --button-bg-hover: #3a6dcc;
    --footer-bg: #0f1821;
    --footer-text: #e6eef6;
    --shadow: rgba(0,0,0,0.4);
    --card-shadow: rgba(0,0,0,0.12);
  }
}

.theme-toggle {
    display: flex;
    align-items: center;
}

body {
  margin: 0;
  min-height: 100vh;
}

.content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

#theme-toggle-btn {
    background: transparent;   /* enlève le fond blanc */
    border: none;              /* enlève la bordure */
    padding: 0;
    margin: 0;

    font-size: 20px;           /* taille de l’emoji */
    line-height: 1;            /* évite le décalage vertical */
    
    cursor: pointer;
    color: inherit;            /* s’adapte au thème */
}

/* Supprimer le contour bleu au focus */
#theme-toggle-btn:focus,
#theme-toggle-btn:active {
    outline: none;
    box-shadow: none;
}

/* Optionnel : feedback hover */
#theme-toggle-btn:hover {
    opacity: 0.8;
}


/* =========================
   Global
   ========================= */
html, body {
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  font-family: 'Inter', sans-serif;
  height: 100%;
  margin: 0;
}

@media (prefers-reduced-motion: no-preference) {
  :root, body, header, main, footer {
    transition: background-color 200ms ease, color 200ms ease;
  }
}

/* =========================
   Header
   ========================= */
header {  
  position: relative;
  top: 0;
  align-self: stretch;
  height: 100%;
  left: 0;
  width: 220px;
  background: var(--header-bg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1rem;
  box-shadow: 2px 0 10px var(--shadow);
  z-index: 1000;
  grid-column: 1;
  border-top-right-radius: 24px;
  border-bottom-right-radius: 24px;
}

/* Logo en haut */
header .logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

/* Navigation verticale */
header nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: auto; /* pousse les contrôles en bas */
}

header nav a:hover {
  background: var(--hover-bg);
}

/* Header controls */
.header-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* En mode replié : cacher uniquement le switch langue */
header.collapsed .lang-switch {
  display: none;
}



.logo-link {
    display: flex;
    align-items: center;
    gap: 6px;

    text-decoration: none;   /* enlève le soulignement */
    color: inherit;          /* garde la couleur du texte */
    cursor: pointer;
}

.logo-link:visited,
.logo-link:hover,
.logo-link:active {
    color: inherit;          /* jamais violet/bleu */
}

/* NAVIGATION MENU */
/* =========================
   Sidebar navigation (2025)
   ========================= */

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.65rem;
  font-weight: 500;
   color: var(--nav-text);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}


/* Icône */
.nav-item .icon {
  width: 22px;
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.85;
}

/* Hover */
.nav-item:hover {
  background: var(--nav-hover-bg);
  color: #BDBDBD;
}

/* Actif */
.nav-item.active {
  background: var(--nav-active-bg);
  color: #B3D5FF;
}

/* Focus clavier */
.nav-item:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Barre latérale active */
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -0.5rem;
  top: 20%;
  width: 4px;
  height: 60%;
  border-radius: 4px;
  background: var(--accent);
}

.lang-switch button,
#theme-toggle-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;

    font-size: 16px;
    line-height: 1;

    cursor: pointer;
    color: inherit;
}


/* Menu burger */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--nav-text);
  border-radius: 3px;
  transition: all 0.3s ease;
}
.menu-toggle.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* =========================
   Main
   ========================= */
main {
  margin-top: 10px;
  margin: 0;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  min-height: 0;
  flex: 1 0 auto;
}

/* Accueil section */
.accueil {
  padding: 4rem 1rem;
  color: white;
  border-radius: 1rem;
    background: linear-gradient(
    135deg,
    #0d6efd,
    #0aa2c0
  );
  margin-bottom: 40px;
}
.accueil h1 { font-size: 2.5rem; margin-bottom: .5rem; }
.accueil p { font-size: 1.2rem; margin-bottom: 2rem; }

/* Boutons */
.btn {
  background: var(--button-bg);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background .3s;
}
.btn:hover { background: var(--button-bg-hover); }

/* =========================
   Carte unifiée
   ========================= */
.card-block {
  background: var(--card-bg);
  color: var(--text);
  padding: 1.8rem 2rem;
  border: 1px solid rgba(0,0,0,0.06);
  text-align: left;
  box-shadow: 0 8px 24px var(--card-shadow);
  border-radius: 14px;
}
.card-block h3 {
  color: var(--accent);
  margin-top: 0;
}
.card-block ul {
  padding-left: 1.3rem;
  line-height: 1.6;
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

/* =========================
   Bloc Mise à jour
   ========================= */
.update-section {
  margin-top: 4rem;
}

.update-section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.update-btn {
  display: inline-block;
  margin-top: 1rem;
}

/* =========================
   Téléchargements
   ========================= */
.download-item {
  margin: 1.5rem 0;
  text-align: center;
}

.download-item .btn {
  display: inline-block;
  margin-bottom: 0.5rem;
}

.download-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================
   Footer
   ========================= */
footer {
	 margin-top: auto;
  text-align: center;
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top-left-radius: 1rem;
  border-top-right-radius: 1rem;
  
}

footer a { color: var(--accent); }

/* =========================
   Paypal button
   ========================= */
.paypal-donate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFC439;
  color: #111;
  font-weight: 600;
  padding: 0.8rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background .2s, transform .15s;
}

.paypal-donate img {
  width: 22px;
  height: 22px;
}

.paypal-donate:hover {
  background: #FFB020;
  transform: translateY(-2px);
}

.paypal-donate:active {
  transform: translateY(0);
}

/* =========================
   Mentions légales modernes
   ========================= */
.legal-section {
  width: 100%;
  max-width: 850px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.legal-card h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  min-height: auto;
}

.legal-icon {
  font-size: 1.6rem;
  opacity: 0.85;
}

.legal-card p {
  line-height: 1.7;
  font-size: 1rem;
}





@media (max-width: 768px) {

  /* DÉSACTIVER LE GRID DESKTOP */
  .layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  /* Le header n'est plus une sidebar */
  header {
    width: 100%;
    height: auto;
    border-radius: 0;
  }

  /* Le contenu prend toute la largeur */
  .content {
    width: 100%;
  }

  /* =========================
     HEADER MOBILE
     ========================= */
  header {
    position: relative;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    box-shadow: 0 2px 8px var(--shadow);
  }

  header nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: var(--header-bg);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 5px 10px var(--shadow);

    transform: translateY(-150%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
  }

  header nav.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  header nav a {
    width: 100%;
    margin: 0.5rem 0;
  }

  .menu-toggle {
    display: flex;
  }

  /* =========================
     MAIN
     ========================= */
  main {
    padding: 1.5rem 1rem;
    flex: 1 0 auto;
  }

  /* =========================
     FOOTER
     ========================= */
  footer {
    flex: 0 0 auto;    
    height: auto;
    min-height: unset;
    margin-top: auto; 
    padding: 1.5rem 1rem;
    width: 100%;
    border-radius: 0;
  }

  /* =========================
     TYPO MOBILE
     ========================= */
  .accueil h1 { font-size: 1.8rem; }
  .accueil p { font-size: 1rem; }

  .legal-card h2 { font-size: 1.3rem; }
  .legal-icon { font-size: 1.4rem; }
}
