/* ==========================================================================
   OUTIL CSV YELLOH — STYLES
   Identité : jaune Yelloh, sable, anthracite, blanc cassé
   ========================================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  margin: 0;
  background-color: #f7f4f0;
  color: #2d2d2d;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* --- Header --- */
header {
  background: linear-gradient(135deg, #b80d1c 0%, #d41425 100%);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

header img {
  height: 46px;
  filter: brightness(1.05);
}

header h1 {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

/* --- Layout principal --- */
main {
  padding: 2rem;
  max-width: 860px;
  margin: 0 auto;
}

/* --- Cartes / sections --- */
.card {
  background: #fff;
  border: 1px solid #e8e4df;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3a3a3a;
  margin: 0 0 1rem 0;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #f4c342;
}

/* --- Zones de dépôt fichier --- */
.zone {
  border: 2px dashed #d5cfc7;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.75rem;
  background-color: #fcfaf8;
  transition: all 0.2s ease;
  position: relative;
}

.zone:hover {
  border-color: #f4c342;
  background-color: #fffdf7;
}

.zone.dragover {
  background-color: #fff8e6;
  border-color: #f4a100;
  box-shadow: 0 0 0 3px rgba(244, 195, 66, 0.2);
}

.zone label {
  font-weight: 600;
  font-size: 0.9rem;
  color: #555;
  display: block;
  margin-bottom: 0.4rem;
}

.zone input[type="file"] {
  display: block;
  font-size: 0.85rem;
  color: #666;
}

/* Chrome/Edge : styliser le bouton file natif */
.zone input[type="file"]::file-selector-button {
  padding: 0.35rem 0.8rem;
  border: 1px solid #d5cfc7;
  border-radius: 6px;
  background: #f7f4f0;
  color: #444;
  font-size: 0.82rem;
  cursor: pointer;
  margin-right: 0.6rem;
  transition: background 0.15s;
}

.zone input[type="file"]::file-selector-button:hover {
  background: #ede9e3;
}

/* --- Labels --- */
label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  color: #444;
}

/* --- Inputs texte --- */
input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0 1rem 0;
  border: 1px solid #d5cfc7;
  border-radius: 8px;
  font-size: 0.92rem;
  background: #fff;
  color: #333;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus {
  outline: none;
  border-color: #f4c342;
  box-shadow: 0 0 0 3px rgba(244, 195, 66, 0.18);
}

/* --- Boutons --- */
button {
  padding: 0.6rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  background-color: #f4c342;
  color: #2d2d2d;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

button:hover {
  background-color: #e8b535;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(244, 195, 66, 0.3);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* Bouton secondaire (ajouter encart) */
.btn-secondary {
  background-color: transparent;
  border: 1px dashed #c5bfb6;
  color: #777;
  font-weight: 500;
}

.btn-secondary:hover {
  background-color: #f7f4f0;
  border-color: #f4c342;
  color: #555;
  box-shadow: none;
  transform: none;
}

/* Bouton succès (télécharger) */
.btn-success {
  background-color: #2d9d5a;
  color: #fff;
}

.btn-success:hover {
  background-color: #258a4e;
  box-shadow: 0 2px 8px rgba(45, 157, 90, 0.3);
}

/* Bouton preview */
.btn-preview {
  background-color: #fff;
  border: 1px solid #d5cfc7;
  color: #555;
}

.btn-preview:hover {
  background-color: #f7f4f0;
  border-color: #b8b2a8;
  box-shadow: none;
}

/* --- Messages de feedback --- */
.message {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: none;
  font-size: 0.9rem;
  line-height: 1.4;
}

.message.erreur {
  background-color: #fef2f2;
  border: 1px solid #f3b8b8;
  color: #9b2c2c;
}

.message.succes {
  background-color: #f0faf4;
  border: 1px solid #a7dbb8;
  color: #276740;
}

/* --- Séparateur de section --- */
.section-separator {
  border: none;
  border-top: 1px solid #e8e4df;
  margin: 2rem 0;
}

/* --- Tableaux (preview) --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

th, td {
  border: 1px solid #e0dbd5;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

th {
  background-color: #f4c342;
  color: #2d2d2d;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr:nth-child(even) {
  background-color: #faf8f5;
}

tr:hover {
  background-color: #f5f0ea;
}

/* --- Preview : message erreur --- */
.preview-error {
  color: #9b2c2c;
  background: #fef2f2;
  border: 1px solid #f3b8b8;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: none;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  main {
    padding: 1rem;
  }

  .card {
    padding: 1rem;
  }

  header {
    padding: 0.8rem 1rem;
  }

  header h1 {
    font-size: 1.1rem;
  }

  table {
    font-size: 0.8rem;
  }

  th, td {
    padding: 0.4rem 0.5rem;
  }
}
