body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #fbeff5, #e0f7fa);
    color: #444;
/* ajout de 3 lignes  */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}
.container {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 600px;
    width: 95%;
    animation: fadeIn 1.5s ease;
}
h1 {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #d81b60;
}
h2 {
    margin-top: 30px;
    color: #00796b;
}
input[type="password"] {
    padding: 10px;
    font-size: 1em;
    margin: 10px;
    width: 70%;
    border: 1px solid #ccc;
    border-radius: 6px;
}
button {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #d81b60;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.3s ease;
}
button:hover:not(:disabled) {
    background-color: #ad1457;
}
button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}
.gallery {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    min-height: 500px;  /* pour Ã©viter que la galerie ne disparaisse trop vite */
}
.gallery img {
   display: block;
  margin: 0 auto;
  max-width: 90%;
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  opacity: 1;
  transition: none;
  position: relative;
  transform: none;
}

.video-thumbnails {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.video-item {
    text-align: center;
    cursor: pointer;
    max-width: 180px;
}
.video-item img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}
.video-item img:hover {
    transform: scale(1.05);
}
.video-item p {
    margin-top: 8px;
    font-weight: bold;
    color: #444;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}
.modal video {
    width: 100%;
    max-height: 70vh;
}
.modal .close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2em;
    color: white;
    cursor: pointer;
}
.hidden {
    display: none;
}

.error {
    color: red;
    margin-top: 10px;
}
.hidden {
    display: none;
}
.controls {
    margin-top: 20px;
}
#counter {
    display: inline-block;
    margin-left: 10px;
    font-size: 1.2em;
    color: #00796b;
    font-weight: bold;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Menu latÃ©ral */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 160px;
  height: 100%;
  background-color: #333;
  padding-top: 40px;
  z-index: 100;
}
.sidebar ul {
  list-style-type: none;
  padding: 0;
}
.sidebar ul li {
  margin: 15px 0;
}
.sidebar ul li a {
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  display: block;
  transition: background 0.3s;
}
.sidebar ul li a:hover {
  background-color: #555;
}

/* Contenu principal */
.main-content {
  margin-left: 180px;
  padding: 20px;
}

/* Barre supÃ©rieure */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  padding: 0 20px;
  z-index: 1000;
  gap: 20px;
}
.topbar h1 {
  font-size: 1.2em;
  margin: 0;
  flex-grow: 1;
}
.top-links a {
  margin: 0 10px;
  text-decoration: none;
  color: #00796b;
  font-weight: bold;
}
.top-links a:hover {
  text-decoration: underline;
}

/* Grande photo d'accueil */
.grande-photo {
  display: block;
  margin: 0 auto 30px;
  max-width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Miniatures */
.miniatures {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}
.miniatures img {
  width: 150px;
  aspect-ratio: 2 / 3;      /* Format paysage force */
  object-fit: cover;        /* Centre et rogne au besoin */
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  cursor: pointer;
  transition: transform 0.2s;
}
.miniatures img:hover {
  transform: scale(1.05);
}
.miniature p {
  margin-top: 6px;
  font-size: 0.9em;
  color: #fff;
  text-align: center;
}

/* Lightbox (si lightbox.js ne le gÃ¨re pas dÃ©jÃ ) */
.lightbox {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
}
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: white;
  cursor: pointer;
}
.hidden {
  display: none !important;
}
/* Ãcran de choix initial */
.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
  text-align: center;
}

/* Navigation verticale diaporama */
.diapo-nav {
  position: fixed;
  top: 50%;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: translateY(-50%);
  z-index: 1000;
}

.diapo-nav button {
  background: #444;
  color: white;
  font-size: 1.5em;
  padding: 10px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.diapo-nav button:hover {
  background: #666;
}

.hidden {
  display: none !important;
}
/* Ecran de choix initial */
.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 20px;
  text-align: center;
}

/* Navigation verticale diaporama */
.diapo-nav {
  position: fixed;
  top: 50%;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  transform: translateY(-50%);
  z-index: 1000;
}

.diapo-nav button {
  background: #444;
  color: white;
  font-size: 1.5em;
  padding: 10px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.diapo-nav button:hover {
  background: #666;
}
#diapo-img {
  opacity: 0;
  transition: opacity 0.5s ease;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

#diapo-img.visible {
  opacity: 1;
}
#miniature-mode .main-content {
  padding-top: 80px; /* espace pour la topbar */
}

.hidden {
  display: none !important;
}
/* Grille responsive pour miniatures vidÃ©o */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.video-thumb {
  text-align: center;
  cursor: pointer;
}

.video-thumb img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}

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

.video-thumb p {
  margin-top: 8px;
  font-weight: bold;
  color: #333;
}

/* Plein Ã©cran vidÃ©o */
.fullscreen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  /*flex-direction: column;*/
  padding: 1em;
}

.fullscreen video {
  width: 100%;
  max-height: 90vh;
  border-radius: 10px;
  /* background: black;*/
}

.fullscreen .close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: #F00;
  color: #FFF;
  border: none;
  font-size: 1.5em;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10000;
}

.hidden {
  display: none !important;
}

.video-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.video-admin-item {
  background: #333;
  padding: 8px;
  border-radius: 6px;
  text-align: center;;
}
.video-admin-item img {
  width: 100%;
  border-radius: 5px;
  object-fit: cover;
}
.video-admin-item p {
  font-size: 0.9em;
  margin: 4px 0 6px;
}
.topbar button.active {
  background-color: #ffcc00;
  color: black;
  font-weight: bold;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  width: 100%;
}

.video-thumb {
  width: 220px;
  background: #222;
  border-radius: 10px;
  padding: 10px;
  margin: 10px;
  text-align: center;
  display: inline-block;
  vertical-align: top;
  position: relative;
  transition: transform 0.2s ease;
}
  
  

.video-thumb img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 6px;
}

.video-thumb img.vertical {
  max-height: 300px;
  object-fit: contain;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 10px;
}

.video-thumb:hover {
  transform: scale(1.05);
}

.video-thumb p {
  margin-top: 8px;
  font-size: 1em;
  color: #eee;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 180px;
  background-color: #444;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%; /* flèche vers le bas */
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #444 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}
#upload-form {
  max-width: 400px;
  margin: 20px auto;
  background: #222;
  padding: 20px;
  border-radius: 10px;
  color: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
}
#upload-form h2 {
  text-align: center;
}
#upload-form form label {
  display: block;
  margin-bottom: 10px;
}
#upload-form form input,
#upload-form form select,
#upload-form form button {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 5px;
  border: none;
  background: #444;
  color: white;
}
#upload-form form button:hover {
  background: #666;
  cursor: pointer;
}
.photo-comments-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.photo-comment-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.photo-comment-item img {
  height: 60px;
  width: 60px;
  object-fit: cover;
  border-radius: 5px;
}
#progress-bar {
  font-weight: bold;
  background-color: #222;
  border: 1px solid #555;
  border-radius: 6px;
}
#updates-result {
  background-color: #1e1e1e;  /* fond sombre */
  color: #00ff88;             /* texte vert clair */
  font-family: monospace;
  white-space: pre-wrap;
  padding: 10px;
  border-radius: 6px;
  display: none;
}
.message {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  background: #f9f9f9;
}
#confirmation.show {
  display: block;
}

