/* Style général de la page */
body {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Style pour le header */
header {
    color: #fff;
    text-align: right;
    background-color: #333;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-table {
    width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    border: none;
}

.header-td {
    border: none;
}

.header-picture {
    padding: 8px;
    text-align: left;
}

.header-links ul {
    list-style-type: none;
    padding: 0;
    text-align: right;
}

.header-links ul li {
    display: inline-block;
    margin: 0 5px;
}

.header-links ul li a {
    color: #28a745;
    text-decoration: none;
    font-size: 20px;
}

.header-links ul li a:hover {
    text-shadow: 0 0 1.5px #fff, 0 0 1.5px #fff;
    text-decoration: none;
    background-color: #28a745;
    color: white;
    padding: 33.5px 0px;
}

/* Style pour les formulaires */
form {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    width: 300px;
    margin: 50px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

input[type="text"], input[type="password"], input[type="file"], input[type="email"], #message {
    width: 92.5%;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

.newsletter-form-width {
    width: 600px;
}

#newsletter-message, #newsletter-subject {
    width: 578px;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

#raison, #plan {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

input[type="submit"], button {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

input[type="submit"]:hover, button:hover {
    background-color: #218838;
}

.loginform {
    display: flex; 
    max-width: 900px; 
    align-items: center; 
    justify-content: center; 
    margin: auto;
}

/* Style pour les messages d'erreur */
.error {
    color: red;
    font-weight: bold;
    margin-bottom: 10px;
}

.carousel {
    max-width: 900px;
    margin: auto;
    overflow: hidden;
    border-radius: 12px;
    touch-action: pan-y;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-track img {
    width: 100%;
    flex-shrink: 0;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.carousel-dots button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #bbb;
    cursor: pointer;
    transition: 0.2s;
}

.carousel-dots button.active {
    background: #333;
    transform: scale(1.2);
}

/* Style pour le tableau des résultats */
table {
    width: 80%;
    margin: 20px auto;
    border-collapse: collapse;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 15px;
    text-align: center;
}

th {
    background-color: #f2f2f2;
}

/* Style pour les liens */
a {
    color: #4CAF50; /* Couleur verte */
    text-decoration: none; /* Supprime le soulignement */
}

a:hover {
    text-decoration: underline; /* Ajoute un soulignement au survol */
}

/* Style pour le footer */
footer {
    color: #fff;
    padding: 20px 0;
    text-align: center;
    background-color: #333;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-links ul {
    list-style-type: none;
    padding: 0;
}

.footer-links ul li {
    display: inline-block;
    margin: 0 15px;
}

.footer-links ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
}

.footer-links ul li a:hover {
    text-shadow: 0 0 .65px #fff, 0 0 .65px #fff;
}

.footer-socials a img {
    width: 30px;
    height: 30px;
    margin: 0 10px;
}

.footer-info p {
    margin: 10px 0 0;
    font-size: 14px;
    color: #fff;
}

.footer-socials a:hover img {
    opacity: 0.7;
}

/* Icône du menu pour les petits écrans */
.menu-icon {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: #28a745;
}

.menu-icon:hover {
    text-shadow: 0 0 1.5px #28a745, 0 0 1.5px #28a745;
}

@media screen and (max-width: 838px) {
    .header-table {
        width: 100%;
    }

    /* Cacher les liens au départ */
    .header-links ul {
        display: none;
        flex-direction: column;
        background-color: #333;
        width: auto;
        padding: 10px;
        position: absolute;
        top: 6%;
        right: 0px;
        border-radius: 0 0 0 15px ;
    }

    /* Affichage du menu icône */
    .menu-icon {
        display: block;
        padding: 8px;
        text-align: right;
    }

    .header-picture {
        padding: 8px;
        text-align: left;
    }

    /* Quand le menu est actif, il s'affiche en colonne */
    .header-links ul.show {
        display: flex;
    }

    .header-links ul li {
        margin: 5px;
        text-align: center;
    }
    
    .header-links ul li a:hover {
        text-shadow: 0 0 1.5px #fff, 0 0 1.5px #fff;
        text-decoration: none;
        background-color: #28a745;
        color: white;
        padding: 5px 0px;
    }
    
    .footer-container {
        flex-direction: column;
    }
    
    .header-container {
        flex-direction: column;
        margin-bottom: 40px;
    }
    
    .page-generale.page-exclue .header-container {
        margin-bottom: 0px; /* ou aucun style, ou override */
    }

    .loginform {
        flex-direction: column;
    }

    .footer-links ul li {
        display: block;
        margin: 10px 0;
    }
}

@media screen and (max-width: 768px) {
    .newsletter-form-width {
        max-width: 300px;
    }
    
    #newsletter-message, #newsletter-subject {
        max-width: 92.5%;
    }
    .synthese-container {
        width: 80%;
    }
}

/* PARTIE WEBAPP */
/* page background + big logo behind the dashboard */
body.appdark { 
    margin:0; 
    min-height:100vh; 
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; 
    color:#ffffff; 
    background-image: linear-gradient(to bottom, #333, #111); 
    display:flex; 
    flex-direction:column; 
    align-items:center; 
    padding-top: 40px; 
    box-sizing: border-box; 
    position:relative; 
    overflow-y:auto;
}

body.appdark.light-mode {
    background-image: radial-gradient(circle at 15% 25%, rgba(255, 140, 140, 0.35), transparent 45%),
                      radial-gradient(circle at 85% 15%, rgba(140, 200, 255, 0.35), transparent 45%),
                      radial-gradient(circle at 25% 85%, rgba(140, 255, 220, 0.35), transparent 45%),
                      radial-gradient(circle at 75% 75%, rgba(255, 220, 140, 0.35), transparent 45%),
                      radial-gradient(circle at 50% 50%, rgba(220, 140, 255, 0.25), transparent 55%),
                      linear-gradient(to bottom, #5a5a5a, #2f2f2f);
    /*@keyframes bubblesMove {
        0% { background-position: 0% 0%; }
        50% { background-position: 100% 100%; }
        100% { background-position: 0% 0%; }
    } 
    background-size: 200% 200%;
    animation: bubblesMove 5s ease infinite;*/
}

/* sticky top bar wrapper so it never touches edges */
.topbar-wrapper{
  width: calc(100% - 48px); /* padding 24 left/right of body => avoid touching edges */
  max-width: 1200px;
  position: sticky;
  top: 40px;
  z-index: 50;
  margin: 0 auto;
  display:flex;
  justify-content:center;
}

/* glass topbar */
.topbar {
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  box-sizing: border-box;
}

/* left logo */
.topbar .brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.topbar .brand img{
  width:100px;
  height:auto;
  border-radius:8px;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5));
}

/* center nav */
.topbar .nav {
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:center;
  flex:1;
  max-width: auto;
}
.topbar .nav button {
  max-width: 200px;
  padding:8px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.5);
  cursor:pointer;
  font-size:0.8em;
  font-weight:600;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}
.topbar .nav button.active,
.topbar .nav button:hover {
  transform: translateY(-3px);
  background: linear-gradient(135deg, rgba(40,167,69,0.12), rgba(247,147,26,0.08));
  box-shadow: 0 6px 10px rgba(0,0,0,0.45);
  color: var(--text);
}

/* right controls */
.topbar .controls {
  display:flex;
  align-items:center;
  gap:10px;
}

#support-btn {
    cursor: pointer;
}

#light-theme-btn, #dark-theme-btn {
    margin-top: 1px;
}

#light-theme-btn {
    margin-right: -41.5px;
}

.theme-icon {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.visible {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.support-menu {
    position: absolute;
    top: 75px;
    right: 50px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.16);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.9em;
}

.support-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.support-menu-btn {
    display:flex; 
    align-items:center; 
    gap:8px; 
    cursor:pointer;
}

#logout-btn {
    cursor: pointer;
}

/* ===== Responsive menu ===== */
#menu-btn {
  display: none; /* caché par défaut (desktop) */
  cursor: pointer;
}

.mobile-menu {
    display: none;
}

/* Petit écran */
@media (max-width: 768px) {
  .support-menu {
    right: 100px;
  }
  #menu-btn {
    display: block; /* visible uniquement mobile */
  }

  .topbar .nav {
      display: none !important; /* on désactive totalement l'ancien */
  }
  
  .mobile-menu {
      position: absolute;
      top: 75px;
      right: 0px;
      left: 0px;
      display: flex;
      flex-direction: column;
      gap: 15px;
      padding: 20px;
      border-radius: 14px;
      background: rgba(255,255,255,0.06);
      border: 1px solid rgba(255,255,255,0.16);
      backdrop-filter: blur(14px);
      -webkit-backdrop-filter: blur(18px);
      box-shadow: 0 8px 30px rgba(0,0,0,0.45);
      opacity: 0;
      transform: translateY(-10px);
      pointer-events: none;
      transition: all 0.2s ease;
  }

  .mobile-menu.show {
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
  }

  .mobile-menu button {
      width: 100%;
      padding: 8px 14px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.04);
      color: rgba(255,255,255,0.5);
      font-size: 0.9em;
      font-weight: 600;
      cursor: pointer;
      transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  }

  .mobile-menu button.active,
  .mobile-menu button:hover {
      transform: translateY(-3px);
      background: linear-gradient(135deg, rgba(40,167,69,0.12), rgba(247,147,26,0.08));
      box-shadow: 0 6px 18px rgba(0,0,0,0.45);
      color: white;
  }
}