/* General resets */
:root{ 
  --bg:#1b1616; --accent:#be2e2e; --text:#ffffff; --bordure:#790404;
  --textbar:#ffffff; --card : #ffffff; --header-height: 85px; /* valeur par défaut, remplacée par JS */
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background-color: #ffffff; /* même fond que le header */
}

.selection {
  background: var(--accent);
  color: #fff;
}

/* Layout helpers */
.container {
  max-width: 90%;
  margin: 0 auto;
  padding: 1rem 2rem;
}

p {
  white-space: pre-wrap;         /* conserve les sauts de ligne */
  max-width: 500px;              /* optionnel : limite la largeur du texte */
  text-align: left;             /* aligne le texte à droite */
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--header-height);
  
  background: var(--bg);
  border-bottom: 3px solid var(--bordure);
  z-index: 1000;
  transition: transform 0.5s ease; /* animation fluide */
  backdrop-filter: blur(6px);
}

.site-header.hide {
  transform: translateY(-100%); /* cache la barre en la poussant vers le haut */
}

.header-inner {
  display: flex;
  justify-content: space-between; /* logo à gauche, nav prend le reste */
  align-items: center;
  gap: 1rem; 
  background: var(--bg);
}

.logo {
  display: inline-block;   /* le lien prend seulement la taille de son contenu */
  width: auto;             /* largeur = image */
  height: auto;            /* hauteur = image */
}

.logo img {
  height: 50px;
  width: 50px;   
  border: 2px solid var(--bordure); 
  border-radius: 8px;                 /* optionnel : arrondir les coins */   
  object-fit: contain;    
  display: block;           
}

/* avatar du profil (dans header profil) */
#profileAvatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* Grille de photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 colonnes fixes */
  gap: 1rem; /* espace entre les cartes */
  margin-top: 1rem;
}

/* Chaque carte photo */  
.photo-item {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* L'image à l'intérieur */
.photo-item img {
  width: 100%;        /* largeur de la carte */
  height: 200px;      /* hauteur fixe */
  object-fit: cover;  /* recadre l’image pour remplir le conteneur */
  display: block;
}

/* Bouton téléchargement */
.photo-item .download-btn {
  margin: 0.5rem 0;
  text-decoration: none;
  background: var(--bordure);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.photo-item .download-btn:hover {
  background: var(--accent);
}

.page {
  display: none;
}
.page.active {
  display: block;
}

/* Hero section */
.hero {
  /* L'image de fond */
  background-image: url("/assets/img/bg.png");
  background-repeat: no-repeat;       /* pas de répétition */
  background-position: center top;    /* centrée en haut */
  background-size: contain;              /* garde la taille originale */
  width: 100%;
  height: 100vh;                       /* pas de 100vh */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* Pour que l'image ne dépasse pas */
.hero img {
  max-width: 100%;
  height: auto;
  display: block;
}

.hero-title {
  font-size: 3rem;
  text-transform: uppercase;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.1em;
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 2;
}



/* Main content */
main {
  padding-top: 1rem; /* spacing for fixed header */
}

section {
  padding: 4rem 0;
}

section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.center-text {
  text-align: left;
  margin: 0 auto;        /* centre le bloc horizontalement */
  max-width: 720px;      /* limite la largeur pour une meilleure lecture */
  line-height: 1.5;
  color: inherit;
}

/* Footer */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  color: #666;
  border-top: 1px solid #eee;
}

/* cartes de section : enlever le style de lien et donner un rendu "card" */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.section-card {
  display: flex;
  flex-direction: column;         /* garder les éléments empilés (titre + texte) */
  justify-content: center;        /* centre verticalement */
  align-items: center;            /* centre horizontalement */
  text-align: center;             /* works for <a> and <div> */
  text-decoration: none;
  color: inherit;
  background:var(--card);
  padding: 1rem;
  border-radius: 10px;
  border: 2px solid var(--bordure);
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 110px;
  overflow: hidden;
  cursor: pointer;
}

.section-card h3 { margin: 0 0 0.4rem 0; font-size: 2rem; text-align: center; align-items: center;}
.section-card p  { margin: 0; color: var(--bg); font-size: 0.95rem; }

/* hover / focus */
.section-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}
.section-card:focus,
.section-card:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(43,124,255,0.12);
}

/* ensure no underline even for <a> */
.section-card,
.section-card:link,
.section-card:visited,
.section-card * {
  text-decoration: none !important;
  color: inherit !important;
}

/* responsive */
@media (max-width: 600px) {
  .sections-grid { grid-template-columns: 1fr; }
}

/* Lightbox overlay */
.lightbox {
  position: fixed;
  display: none; /* caché par défaut */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Image affichée en grand */
.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Bouton fermer */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
}

/* Conteneur des boutons en bas */
.lightbox-buttons {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  
  display: flex;
  gap: 10px;
}

.lightbox-download-btn,
.lightbox-report-btn {
  background: var(--bordure);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s;
  border: none; /* utile pour le button */
  cursor: pointer;
}

.lightbox-download-btn:hover {
  background: var(--accent);
}

/* ---------------------------
   2) PHOTOS GRID
   --------------------------- */
@media (max-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);  /* tablette 3 colonnes */
  }
}

@media (max-width: 700px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);  /* mobile standard 2 colonnes */
  }
}

@media (max-width: 420px) {
  .photo-grid {
    grid-template-columns: repeat(1, 1fr);  /* petit smartphone 1 colonne */
  }
}

/* ---------------------------
   3) PHOTO ITEM
   --------------------------- */
@media (max-width: 700px) {

  .photo-item img {
    height: 160px; /* réduit la taille sur mobile */
  }

  .photo-item {
    border-radius: 10px;
    padding-bottom: 0.6rem;
  }

  .download-btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
  }
}

/* ---------------------------
   4) SECTION CARDS
   --------------------------- */
@media (max-width: 700px) {
  .sections-grid {
    grid-template-columns: 1fr 1fr; /* 2 cartes par ligne */
  }
}

@media (max-width: 480px) {
  .sections-grid {
    grid-template-columns: 1fr; /* 1 carte */
  }

  .section-card h3 {
    font-size: 1.6rem;
  }
}

/* ---------------------------
   5) HERO SECTION
   --------------------------- */
@media (max-width: 700px) {
  .hero {
    height: 65vh;
    background-position: center;
  }

  .hero-title {
    font-size: 12vw; /* responsive */
    letter-spacing: 0.05em;
  }
}

/* ---------------------------
   6) LIGHTBOX MOBILE
   --------------------------- */
@media (max-width: 700px) {

  .lightbox-img {
    max-width: 95%;
    max-height: 75vh;
  }

  .lightbox-close {
    font-size: 2.5rem;
    top: 10px;
    right: 15px;
  }

  .lightbox-download-btn {
    bottom: 20px;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
  }
}

/* --- MENU DESKTOP --- */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.main-nav > ul {
  list-style: none;
  display: flex;
  justify-content: center; /* centre les boutons horizontalement */
  align-items: center;     /* centre verticalement */
  gap: 15rem;               /* espace entre les boutons */
  margin: 0;
  padding: 0;
}

.main-nav li {
  position: relative; /* nécessaire pour le dropdown */
}

.main-nav a {
  text-decoration: none;
  color: var(--textbar);
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--accent);
}

/* Menu déroulant caché */
.dropdown-menu {
  position: absolute;
  top: calc(var(--header-height)+20px); /* juste sous le bouton parent */
  left: 0;
  min-width: 150px;
  display: none; /* caché par défaut */
  flex-direction: column;
  z-index: 2000; /* pour passer devant */
  gap: 1rem;
  list-style: none;        /* supprime les petits ronds */
  padding: 0;              /* supprime le retrait par défaut */
  margin: 0;
}

.dropdown-menu li {
  width: 100%;             /* chaque bouton occupe toute la largeur */
}

.dropdown-menu li a {
  display: block;
  font-size: 1.3rem;
  color: var(--text);
  border: 2px solid var(--bordure);   /* contour rouge */
  border-radius: 12px;               /* arrondi */
  background-color: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(160px);  
  font-weight: 600;
  text-decoration: none;
  padding: 10px 0;
  text-align: center;
  transition: 0.2s ease;
}

@media (min-width: 701px) {
  .dropdown:hover .dropdown-menu {
    display: flex;
  }
  .dropdown > a::after {
    content: " ▾";
  }

  .main-nav a {
    font-size: 1.4rem;       /* texte plus grand */
    padding: 15px 25px;      /* plus d’espace autour du texte */
    min-height: 50px;        /* hauteur minimale uniforme */
    line-height: 50px;       /* centre le texte verticalement */
    border-radius: 12px;     /* arrondi si tu veux garder le style */
  }
}

/* --- BOUTON BURGER --- */
.burger-btn {
  display: none;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3000;
  background: var(--bordure);
  border: none;
  color: var(--text);
  font-size: 2rem;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
}

/* ==== STYLE DU PANNEAU MOBILE ==== */
@media (max-width: 700px) {
  .content {
    margin-top: 2rem; /* plus d’espace sur petit écran */
  }

  .main-nav {
    flex-direction: column;
    position: fixed;
    top: calc(70% + var(--header-height)); /* commence sous le header */
    height: calc(100% - var(--header-height)); /* occupe le reste de l’écran */
    right: 0;
    width: 75%;
    margin: 0;
    max-width: 300px;
    padding-left: 20px;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    z-index: 2000;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .nav-overlay {
    position: fixed;
    top: var(--header-height); /* overlay commence aussi sous le header */
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(27, 22, 22, 0.4);
    backdrop-filter: blur(10px);
    opacity: 0;              /* start invisible */
    visibility: hidden;      /* not clickable */
    transition: opacity 0.35s ease; /* animate fade */
    z-index: 100;
  }

  .nav-overlay.show {
    opacity: 1;              /* fade in */
    visibility: visible;     /* clickable */
  }

  /* Style des liens */
  .main-nav ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;     /* clé pour étirer chaque item */
    width: 100%;
    gap: 0; 
  }

  .main-nav li {
    display: block;
    width: 100%;
    flex: 0 0 auto; 
  }

  /* Optionnel: un espacement régulier entre les boutons */
  .main-nav li + li {
    margin-top: 25px;
  }

  .main-nav a {
    display: block;
    width: 75%;              /* occupe toute la largeur du panneau */
    box-sizing: border-box;   /* inclut bordures/padding dans la largeur */
    text-align: center;
    font-size: 1.3rem;
    color: var(--text);
    border: 2px solid var(--bordure);   /* contour rouge */
    border-radius: 12px;               /* arrondi */  
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);  
    font-weight: 600;
    text-decoration: none;      
    padding: 10px 0;
    transition: 0.2s ease;
  }

  .main-nav a:hover {
    color: var(--accent);
    transform: translateX(5px);
  }

  /* Menu déroulant caché par défaut */
  .dropdown-menu {
    display: none !important;
    position: static !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Supprime la flèche ▾ en mobile */
  .dropdown > a::after {
    content: none !important;
  }

  /* Bouton burger stylé */
  .burger-btn {
    display: block;
    background: var(--bordure);
    color: white;
    font-size: 2rem;
    padding: 6px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
    z-index: 3000;
  }

  .burger-btn:hover {
    background: var(--accent);
    transform: scale(1.05);
  }
}

/* Écran de chargement */
#loader {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: sans-serif;
  transition: opacity 0.3s ease;
}

/* Animation du spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #ddd;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Quand on cache le loader */
#loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
}

.admin-file {
    display: inline-block;
    margin: 15px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    width: 180px;
    background: #fafafa;
}

.preview-img {
    width: 150px;
    height: auto;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-img:hover {
    transform: scale(1.05);
}

.preview-video {
    width: 150px;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.pcs-exploits {
    padding: 40px 20px;
    text-align: center;
}

.pcs-exploits h2 {
    font-size: 2rem;
    margin-bottom: 30px;
}

.pcs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    padding: 10px;
}

.pcs-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform .2s ease;
}

.pcs-card:hover {
    transform: translateY(-5px);
}

.pcs-card img {
    width: 100%;
    height: 90%;
    object-fit: cover;
    border-radius: 10px;
}

.pcs-card h3 {
    margin-top: 0.3rem;
    font-size: 1.2rem;
}

.pcs-card p {
    font-size: 0.95rem;
    color: #555;
}
