
/* upload form and button*/
div.uploadform {
	position:relative;
	display:inline-block;
	border: 1px solid grey;
	border-radius:6px;
	width: stretch;
}

form#uploadForm {
	width:100%
}

/*page admin*/
div#title h2 {
	display:inline-block;
	width:8em;
}

div#title form {
	display:inline-block;
	width:9em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  width: stretch;
  padding: 0.5em 0.6em;
  margin: 4px 0 4px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
  font-size: 0.85em;
}

textarea { resize: vertical; min-height: 100px; }

button,
input[type="submit"] {
  background: #2980b9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7em 1.2em;
  margin-bottom:4px;
  cursor: pointer;
  font-weight: 600;
}

button:hover,
input[type="submit"]:hover {
  background: #3498db;
}

/* Input natif caché */
input[type="file"][hidden] {
  display: none;
}

/* Bouton fichier */
.file-input-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}
.upload-btn {
  display: inline-block;
  padding: 0.3em 0.8em;
  background: #2980b9;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
}
.upload-btn:hover {
  background: #3498db;
}

/* Nom du fichier */
.file-name {
  margin-left: 10px;
  font-size: 0.9em;
  color: #555;
  font-style: italic;
}

/* Bouton submit */
.submit-btn {
  margin-left: 15px;
  padding: 10px 18px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background 0.3s, transform 0.2s;
}

.submit-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

/*multiple upload*/
#previewList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.preview-item {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 5px;
  width: 150px;
  text-align: center;
  font-size: 0.9em;
  background: #fafafa;
}
.preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}
.progress {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: #4caf50;
  transition: width 0.2s;
}

/* Petits boutons inline dans les tableaux admin */
form.inline { display: inline; }
button.linklike {
  background: transparent;
  color: #DB3D3D;
  border: 1px solid #DB3D3D;
}
button.linklike:hover {
  background: #DB3D3D;
  color: #fff;
}

/* ====== Alertes ====== */
.alert {
  padding: 0.7em;
  border-radius: 6px;
  margin-bottom: 1em;
  font-weight: 600;
}

.alert.success { background: #d4edda; color: #155724; }
.alert.error   { background: #f8d7da; color: #721c24; }
.alert.info    { background: #cce5ff; color: #004085; }

/* ====== Tableaux (admin) ====== */
table {
  width: 100%;
  color: cornflowerblue;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 5px 6px;
  border: 1px solid #e5e5e5;
  vertical-align: top;
  word-break: break-word;
}

th {
  background: #f1f1f1;
  text-align: left;
}

#imageTable tbody tr, #articleTable tbody tr {
    display: none;
}
#imageTable tbody tr:nth-child(-n+2),  #articleTable tbody tr:nth-child(-n+2) {
    display: table-row; /* Les 2 premières visibles */
}

/* adaptation mobile */
@media screen and (max-width: 768px) {
     th.action, button.edit-date-btn, button.delete-btn, td.action {
		display:none;
    }
}
