body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/fond.jpg') no-repeat center center;
  background-size: cover;
  opacity: 0.8;
  z-index: -1;
}

/* Couleurs principales */
:root {
  --primary: #0B6BA7;
  --primary-dark: #00507F;
  --bg-light: #ffffff;
  --text-light: #333;
  --bg-dark: #1e1e1e;
  --text-dark: #f1f1f1;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  /* Utilisation de dvh pour mobile */
  transition: background-color 0.6s ease, color 0.6s ease;
}

.second-black-bar {
  background-color: #000;
  color: white;
  padding: 10px;
  text-align: center;
  font-size: 16px;
}

/* Bandeau défilant d'information / maintenance */
.maintenance-banner {
  background-color: #b30000;
  color: white;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  padding: 8px 0;
}

.maintenance-banner-track {
  display: inline-flex;
  width: max-content;
  animation: maintenance-scroll 28s linear infinite;
}

.maintenance-banner-text {
  display: inline-block;
  padding-right: 80px;
  font-size: 0.95em;
  font-weight: bold;
}

@keyframes maintenance-scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (max-width: 800px) {
  .maintenance-banner-text {
    font-size: 0.8em;
  }
}

/* Logo */
.logo {
  display: block;
  margin: 20px auto;
  width: 120px;
  height: auto;
}

body.light {
  background: var(--bg-light);
  color: var(--text-light);
}

body.dark {
  background: var(--bg-dark);
  color: var(--text-dark);
}

header {
  background: var(--primary);
  color: white;
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.user-greeting {
  font-size: 0.95em;
  font-weight: 500;
  color: #f0f0f0;
  white-space: nowrap;
}

header img {
  width: 100px;
  height: auto;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  flex: 1;
  text-align: center;
  padding: 0 10px;
}

/* Responsive Header */
@media (max-width: 800px) {
  header {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  header h1 {
    font-size: 1.4em;
    order: 2;
  }

  header img {
    order: 1;
  }

  .header-right {
    order: 3;
    width: 100%;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 10px;
  }
}

/* Conteneur principal */
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 50px auto;
  max-width: 1400px;
  /* 1000 = 3 vignettes - 1400 = 4 vignettes - 1600 = 5 vignettes */
  transition: opacity 0.6s ease;
}

.container3cards {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
  margin: 50px auto;
  max-width: 1000px;
  /* 1000 = 3 vignettes - 1400 = 4 vignettes - 1600 = 5 vignettes */
  transition: opacity 0.6s ease;
}

/* Cartes */
.card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  text-align: center;
  padding: 20px 20px;
  width: 250px;
  transition: transform 0.3s, box-shadow 0.3s, background 0.4s ease, color 0.4s ease;
  border: 2px solid var(--primary);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

body.dark .card {
  background: rgba(43, 43, 43, 0.85);
  color: var(--text-dark);
  border-color: #ff5555;
}



/* Titres et textes */
.card h2 {
  color: var(--primary);
  margin-bottom: 15px;
  font-size: 1.3em;
  opacity: 1;
  transition: opacity 0.4s ease, color 0.4s ease;
}

body.dark .card h2 {
  color: #008EE0;
}



/* Boutons dans les cartes */
.card a,
.btn_login {
  display: inline-block;
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s, transform 0.2s;
  border: none;
  cursor: pointer;
}

.card a:hover,
.btn_login:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

/* Pied de page */
footer {
  text-align: center;
  padding: 15px;
  background: #fff;
  color: #000;
  margin-top: auto;
  transition: background 0.6s ease;
}

body.dark footer {
  background: #111;
  color: #eee;
}

/* Badges Nouveauté / Bientôt */
.last-card,
.bientot {
  position: relative;
}

.nouveaute-img {
  position: absolute;
  top: 0px;
  left: 0px;
  width: auto;
  height: 100px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Overlay vidéo plein écran */
#videoOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: black;
  z-index: 9999;
}

#videoOverlay iframe {
  width: 100%;
  height: 100%;
  border: none;
}

#videoOverlay button {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10000;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px;
  font-size: 18px;
  cursor: pointer;
}

/*
.nouveaute-img {
  width: 80px;
  height: 80px;
}*/

/* Formulaire d'authentification */
.auth-form-container {
  display: block;
  position: fixed;
  top: 60px;
  right: 20px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  width: 480px;
  transition: all 0.3s ease;
}

#authFormContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  padding: 20px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: block;
}

/* Labels du formulaire auth */
#authFormContainer label {
  display: block;
  font-weight: bold;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 1em;
}

/* Inputs du formulaire auth */
#authFormContainer input[type="text"],
#authFormContainer input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 1em;
  border: 2px solid var(--primary);
  border-radius: 6px;
  margin-bottom: 15px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

#authFormContainer input[type="text"]:focus,
#authFormContainer input[type="password"]:focus {
  border-color: var(--primary-dark);
  outline: none;
}

#authFormContainer p {
  color: var(--primary);
  font-weight: bold;
  margin-bottom: 15px;
}

.login-img {
  width: 40px;
  height: 40px;
  vertical-align: middle;
}

/* Bouton de login dans le header */
.login-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.login-button img {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.login-button:hover img {
  opacity: 0.8;
}

/* Bouton de logout dans le header */
.logout-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.logout-button img {
  width: 40px;
  height: 40px;
  transition: opacity 0.3s ease;
}

.logout-button:hover img {
  opacity: 0.8;
}

/* Classe hidden pour cacher les éléments */
.hidden {
  display: none !important;
}

.error-message {
  color: red;
  margin-bottom: 10px;
  font-weight: bold;
}

.authError {
  display: none;
}

.settings-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-img {
  width: 24px;
  height: auto;
  vertical-align: middle;
}

.forgot-password-container {
  text-align: center;
  margin-top: 10px;
}

.forgot-password-link {
  font-size: 0.8em;
  color: #002060;
  text-decoration: underline;
}

/* Styles pour les pages d'administration et d'authentification (CSP compliant) */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  color: black;
}

.admin-table th,
.admin-table td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.admin-table th {
  background: #002060;
  color: white;
}

.admin-table tr:nth-child(even) {
  background: #f2f2f2;
}

.admin-container {
  max-width: 1000px;
  margin: 50px auto;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(5px);
}

.auth-container {
  max-width: 400px;
  margin: 20px auto;
  padding: 15px;
  background: white;
  border-radius: 8px;
  color: black;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.auth-container h2 {
  margin-top: 0;
  color: #0b6ba7;
}

.auth-container form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-container input {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.auth-container .error {
  color: #d9534f;
  font-size: 0.9em;
}

.auth-container .success {
  color: #5cb85c;
  font-size: 0.9em;
}

.btn_submit {
  background: #0b6ba7 !important;
  color: white !important;
  border: none !important;
  padding: 10px !important;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
  width: 100%;
  font-weight: bold;
}

.btn_submit:hover {
  background: #002060 !important;
}

@media (max-width: 600px) {

  .auth-container,
  .admin-container {
    margin: 20px;
    width: auto;
  }
}

.admin-menu-button {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  transition: transform 0.2s;
  position: relative;
  z-index: 100;
}

.admin-menu-button:hover {
  transform: rotate(30deg);
}

.admin-menu-button img {
  width: 32px;
  height: auto;
}

/* Modal menu administration */
.admin-modal {
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.admin-modal-content {
  background-color: #fefefe;
  padding: 30px;
  border: 2px solid var(--primary);
  width: 350px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.admin-modal-content h2 {
  color: var(--primary);
  margin-top: 0;
  text-align: center;
}

.admin-menu-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 25px;
}

.admin-menu-link {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px 20px;
  background: #f0f4f8;
  color: var(--primary);
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.2s, color 0.2s;
  border: 1px solid #d1d9e6;
}

.admin-menu-link:hover {
  background: var(--primary);
  color: white;
}

.admin-menu-link img {
  width: 24px;
  height: 24px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-modal:hover {
  color: #333;
}

/* Nouveaux effets au survol de la carte */
.card p {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px; /* Espace pour le bouton */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.95em;
  opacity: 0;
  margin: 0;
  transition: opacity 0.4s ease;
  color: white;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  background: var(--primary);
  border-color: white;
}

body.dark .card:hover {
  background: #ff5555;
  border-color: #2b2b2b;
}

.card:hover p {
  opacity: 1;
}

.card:hover h2 {
  opacity: 0;
}
body.dark .card:hover h2 {
  opacity: 0;
}

.card:hover a.card-link,
.card:hover a.card-link-unlocked,
.card:hover .btn_login {
  background: white;
  color: var(--primary);
}
body.dark .card:hover a.card-link,
body.dark .card:hover a.card-link-unlocked,
body.dark .card:hover .btn_login {
  background: white;
  color: #ff5555;
}

.card > img {
  transition: opacity 0.4s ease;
}
.card:hover > img {
  opacity: 0;
}

/* Responsive Desktop vs Mobile Views */
.mobile-only {
  display: none !important;
}

@media (max-width: 800px) {
  header h1 {
    display: none;
  }
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 20px;
    margin-top: 20px;
  }
  .mobile-only .card {
    width: 90%; /* 1 carte par ligne, prend toute la largeur */
    max-width: 400px;
  }
}

 
/* Paramètres personnels */
.admin-stats-icon { filter: hue-rotate(180deg); }
.ps-modal-content { width: 500px; max-height: 90vh; overflow-y: auto; text-align: left; }
.ps-modal-title { text-align: center; }
.ps-modal-desc { font-size: 0.85em; color: #555; text-align: center; margin-bottom: 15px; font-weight: normal; }
.ps-form { display: flex; flex-direction: column; gap: 10px; }
.ps-form-row { display: flex; gap: 10px; }
.ps-form-row-mt { display: flex; gap: 10px; margin-top: 5px; }
.ps-form-row-mb { display: flex; gap: 10px; margin-bottom: 10px; }
.ps-form-group-1 { flex: 1; }
.ps-form-group-2 { flex: 2; }
.ps-form label { font-weight: bold; font-size: 0.9em; }
.ps-form input { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.ps-form fieldset { border: 1px solid #ccc; border-radius: 4px; padding: 10px; margin-top: 5px; }
.ps-form legend { font-weight: bold; color: var(--primary); padding: 0 5px; font-size: 0.9em; }
.ps-form-mb { margin-bottom: 10px; }
#savePersonalSettingsBtn { margin-top: 15px; }

