body {
  margin: 0;
  font-family: sans-serif;
  background: #111;
  color: #fff;
}


.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0; /* ✅ pour éviter le débordement à droite */
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

/* Empêche les éléments d’être trop larges */
.header * {
  max-width: 100%;
}
/* Décaler le contenu sous le header */
body {
  padding-top: 60px;
}

button {
  background: #0a84ff;
  border: none;
  color: white;
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 4px;
}
a { color: #0a84ff; text-decoration: none; }
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18%, 1fr));
  column-gap: 4px;
  row-gap: 0px;     
  padding: 10px;
}

.file-count {
  display: block;
  margin-top: 8px;
  color: #ccc;
  font-size: 14px;
  text-align: center;
}

.item img, .item video {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  cursor: pointer;
}
#viewer {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 999;
}
#viewer img, #viewer video {
  max-width: 100%;
  max-height: 100%;
}
#modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}
.modal-content {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  position: relative;
}
.modal-content input[type="file"] {
  display: block;
  margin: 10px 0;
}
.modal-content .close {
  position: absolute;
  top: 8px; right: 10px;
  cursor: pointer;
}
.hidden {
  display: none !important;
  display: none;
}
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.login-container form {
  background: #222;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}
.login-container input {
  margin-bottom: 10px;
  padding: 8px;
}
.error {
  color: red;
}

.header button {
  height: 50px;
  font-size: 14px;
}

.modal-content input[type="file"] {
  height: 50px;
  font-size: 16px;
  width: 100%;
}

.modal-content button[type="submit"] {
  display: block;
  margin-top: 15px;
  width: 100%;
  height: 50px;
  font-size: 18px;
  text-align: center;
}


/* Stylisation du champ fichier */
input[type="file"] {
  appearance: none;
  background: #444;
  color: white;
  border: none;
  border-radius: 5px;
  padding: 12px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  height: auto;
}

/* Masquer le texte "aucun fichier sélectionné" sur certains navigateurs */
input[type="file"]::file-selector-button {
  background: #0a84ff;
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
  background: #0a84ff;
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 4px;
  cursor: pointer;
}

/* Cacher le texte après le bouton (Firefox etc.) */
input[type="file"]::after {
  content: "";
  display: none;
}


input[type="file"] {
  font-size: 20px;
}

/* Masquer le nom du fichier (fonctionne pour WebKit & Blink) */
input[type="file"]::-webkit-file-upload-button {
  font-size: 20px;
}

input[type="file"]::file-selector-button {
  font-size: 20px;
}

input[type="file"]::-ms-browse {
  font-size: 20px;
}

/* Contourner le texte de sélection sur Firefox */
input[type="file"]::after {
  content: "";
  display: none;
}

input[type="file"]::-moz-placeholder {
  color: transparent;
}


.header a {
  display: inline-block;
  height: 50px;
  line-height: 50px;
  padding: 0 14px;
  background: #444;
  border-radius: 4px;
  text-decoration: none;
  color: white;
  font-size: 14px;
}


/* Masquer le nom du fichier sélectionné sur tous les navigateurs */

/* Masquer uniquement le texte après le bouton fichier */
input[type="file"]::file-selector-button {
  font-size: 20px;
  background: #0a84ff;
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 4px;
  cursor: pointer;
}

/* Masquer le nom du fichier sélectionné pour Firefox */
input[type="file"]::-moz-file-upload-label {
  color: transparent;
}

/* Masquer le nom du fichier sélectionné pour Chrome et autres */
input[type="file"]::after {
  content: "";
  display: none;
}


#progress-wrapper {
  width: 100%;
  height: 10px;
  background: #333;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
}

#progress-bar {
  width: 0%;
  height: 100%;
  background-color: #0a84ff;
  transition: width 0.2s ease-in-out;
}

.btn-link {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 0 10px;
  text-decoration: none;
}

.btn-link:hover {
  color: white;
}

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

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

.modal-auth.hidden {
  display: none;
}

.auth-box {
  background: #222;
  padding: 30px 20px;
  border-radius: 8px;
  text-align: center;
  min-width: 250px;
  box-shadow: 0 0 10px #000;
}

.auth-box h2 {
  margin-bottom: 20px;
  color: #fff;
}

.auth-box input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: none;
  border-radius: 4px;
}

.auth-box button {
  padding: 10px 20px;
  border: none;
  background-color: #0a84ff;
  color: white;
  border-radius: 4px;
  cursor: pointer;
}

.auth-box .close {
  display: block;
  margin-top: 10px;
  cursor: pointer;
  color: #ccc;
  font-size: 14px;
}


/* Par défaut : coin supérieur droit */
.delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #ff4d4d;
  border: none;
  font-size: 20px;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.item {
  position: relative;
}

.btn-link {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 0 10px;
  text-decoration: underline;
}

.btn-link:hover {
  color: white;
}

.header button,
.header a {
  background: none;
  border: none;
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 10px;
  text-decoration: none;
}

.header button:hover,
.header a:hover {
  color: white;
}

@media (min-width: 600px) {
  /* Optionnel : montrer le texte complet sur desktop si souhaité */
  .header button::after,
  .header a::after {
    content: attr(title);
    margin-left: 5px;
    font-size: 14px;
    color: #999;
  }
}

.item {
  position: relative;
  overflow: hidden;
}

/* Mobile : centre de l’image */
@media (max-width: 600px) {
  .delete-btn {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
  }
}
