/* ================================================= */
/* Variables et base */
:root {
  --primary-color: #e74c3c; /* Red */
  --secondary-color: #3498db; /* Blue */
  --dark-bg: #2c3e50;
  --light-bg: #f8f9fa;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--light-bg);
  color: var(--dark-bg);
  padding: 40px 20px;
  margin: 0;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); /* Légèrement adouci */
  overflow: hidden;
}

/* En-tête */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #c0392b 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  margin: 0 0 10px 0;
  font-size: 2.2rem; /* Taille légèrement augmentée */
}

.header p {
  margin: 0;
  opacity: 0.9;
  font-size: 1.1rem;
}

.content {
  padding: 40px;
}

/* Boîte d'information */
.info-box {
  background: #ecf0f1;
  border-left: 4px solid var(--secondary-color);
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 8px;
  color: #34495e;
}

.info-box h3 {
  margin-top: 0;
  color: var(--dark-bg);
}

/* Statistiques */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
  margin: 0;
  font-size: 2.5rem;
}

.stat-card p {
  margin: 5px 0 0 0;
  opacity: 0.9;
}

/* Tableau */
.table-container {
  overflow-x: auto;
  margin-bottom: 30px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
  width: 100%;
  min-width: 1000px; /* Force une largeur minimale pour la lisibilité des codes */
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead {
  background: linear-gradient(135deg, var(--secondary-color) 0%, #2980b9 100%);
  color: white;
}

th {
  padding: 15px 10px;
  text-align: left;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

tbody tr:hover {
  background: #fcfcfd;
}

tbody tr:nth-child(even) {
  background: #fafbfc;
}

/* Styles des méthodes HTTP */
.method {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  min-width: 65px; /* Pour aligner les pastilles */
  text-align: center;
}

.method-post {
  background: #2ecc71;
  color: white;
}

.method-get {
  background: #3498db;
  color: white;
}

.method-put,
.method-na {
  background: #95a5a6; /* Gris pour N/A ou non défini */
  color: white;
}
/* Endpoint */
.endpoint {
  font-family: "Courier New", monospace;
  font-size: 0.85rem;
  color: var(--primary-color);
  font-weight: bold;
}

/* Cellules de Code */
.code-cell pre {
  background: var(--dark-bg);
  color: #ecf0f1;
  padding: 8px; /* Réduit un peu le padding */
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.7rem;
  line-height: 1.4;
  max-height: 120px; /* Limite la hauteur */
  white-space: pre-wrap; /* Permet le retour à la ligne si l'écran le permet */
  word-wrap: break-word;
}

/* Bouton de Téléchargement */
.btn-download {
  display: inline-block;
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
  color: white;
  padding: 15px 40px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-download:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(39, 174, 96, 0.5);
}

.download-section {
  text-align: center;
  padding: 30px 0;
}

/* Navigation Card */
.nav-card {
  display: block;
  padding: 20px;
  text-decoration: none;
  background: white;
  border: 2px solid #ddd;
  border-radius: 12px;
  transition: all 0.3s ease;
  color: var(--dark-bg);
}
.nav-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.1);
  transform: translateY(-2px);
}
.nav-card h2 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--secondary-color);
}
.nav-card p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

/* ================================================= */
/* RÈGLES DE RESPONSIVENESS (MEDIA QUERIES) 📱        */
/* ================================================= */

@media (max-width: 1024px) {
  .container {
    box-shadow: none;
    border-radius: 0;
  }
  .content {
    padding: 20px;
  }
  th,
  td {
    padding: 10px 8px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .header h1 {
    font-size: 1.8rem;
  }
  .header p {
    font-size: 1rem;
  }

  /* Ajuster les stats pour mieux s'empiler */
  .stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
  }

  .stat-card h3 {
    font-size: 2rem;
  }

  /* La table aura un scroll horizontal grâce à .table-container { overflow-x: auto; } */
  table {
    min-width: 900px; /* Assure la lisibilité des colonnes sur mobile */
    font-size: 0.75rem;
  }

  .code-cell pre {
    font-size: 0.65rem;
    max-height: 100px;
  }

  .method {
    font-size: 0.7rem;
    padding: 3px 8px;
  }

  .btn-download {
    padding: 12px 25px;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 15px;
  }
  .content {
    padding: 15px;
  }
  /* Empiler les stats */
  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  /* Ajuster la hauteur de l'entête du tableau pour ne pas prendre trop de place */
  th {
    padding: 12px 5px;
  }
}
