* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  padding: 20px;
  background-color: #f5f5f5;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

h2 {
  color: #3498db;
  margin-bottom: 20px;
}

.container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.form-container {
  flex: 1;
  min-width: 300px;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-height: fit-content;
}

.table-container {
  flex: 2;
  min-width: 600px;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.checkbox {
  display: flex;
  align-items: center;
}

.checkbox label {
  margin-right: 10px;
  margin-bottom: 0;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

button[type="submit"],
#saveButton {
  background-color: #2ecc71;
  color: white;
}

button[type="submit"]:hover,
#saveButton:hover {
  background-color: #27ae60;
}

#clearButton {
  background-color: #e74c3c;
  color: white;
}

#clearButton:hover {
  background-color: #c0392b;
}

#refreshButton {
  background-color: #3498db;
  color: white;
}

#refreshButton:hover {
  background-color: #2980b9;
}

.controls {
  margin-bottom: 20px;
  text-align: right;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th,
table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

table th {
  background-color: #f8f9fa;
  font-weight: 600;
}

.edit-btn,
.delete-btn {
  padding: 6px 10px;
  margin-right: 5px;
  font-size: 14px;
}

.edit-btn {
  background-color: #3498db;
  color: white;
}

.delete-btn {
  background-color: #e74c3c;
  color: white;
}

footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  color: #7f8c8d;
}

.performance-container {
  max-width: 1200px;
  margin: 30px auto 0;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.performance-stats {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.stat-card {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  text-align: center;
  flex: 1;
  min-width: 150px;
  margin: 0 10px 10px 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-card h3 {
  font-size: 16px;
  margin-bottom: 10px;
  color: #7f8c8d;
}

.stat-card p {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.performance-table-wrapper {
  margin-top: 20px;
  height: 320px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 5px;
}

#perfTable {
  width: 100%;
}

.performance-table-wrapper::-webkit-scrollbar {
  width: 8px;
}

.performance-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

.performance-table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 5px;
}

.performance-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

#userList {
  margin-top: 10px;
  height: 450px;
  overflow-y: auto;
  border: 1px solid #eee;
  border-radius: 5px;
}

#userList::-webkit-scrollbar,
.performance-table-wrapper::-webkit-scrollbar {
  width: 8px;
}

#userList::-webkit-scrollbar-track,
.performance-table-wrapper::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

#userList::-webkit-scrollbar-thumb,
.performance-table-wrapper::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 5px;
}

#userList::-webkit-scrollbar-thumb:hover,
.performance-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.success {
  color: #2ecc71;
  font-weight: bold;
}

.error {
  color: #e74c3c;
  font-weight: bold;
}

#clearPerfButton {
  background-color: #95a5a6;
  color: white;
}

#clearPerfButton:hover {
  background-color: #7f8c8d;
}

.benchmark-btn {
  background-color: #9b59b6;
  color: white;
  margin-left: 10px;
}

.benchmark-btn:hover {
  background-color: #8e44ad;
}

.benchmark-btn:disabled {
  background-color: #d7bde2;
  cursor: not-allowed;
}

.benchmark-controls {
  margin-bottom: 15px;
  text-align: center;
}

.benchmark-btn {
  background-color: #9b59b6;
  color: white;
  padding: 12px 25px;
  font-size: 16px;
  width: 100%;
  max-width: 300px;
}

.benchmark-status {
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.benchmark-status h3 {
  margin-bottom: 15px;
  color: #34495e;
  font-size: 18px;
}

.benchmark-progress {
  margin-top: 10px;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background-color: #ecf0f1;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #9b59b6;
  transition: width 0.3s ease;
}

#benchmarkStep {
  font-size: 14px;
  color: #7f8c8d;
  margin: 5px 0;
}

.benchmark-config {
  margin-bottom: 15px;
  background-color: #f2f6fa;
  padding: 12px;
  border-radius: 6px;
}

.benchmark-config label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #34495e;
}

.benchmark-input-group {
  display: flex;
  align-items: center;
}

.benchmark-input {
  width: 80px;
  padding: 8px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  font-size: 16px;
  text-align: center;
}

.benchmark-input-info {
  margin-left: 10px;
  font-size: 14px;
  color: #7f8c8d;
}

.table-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

#randomButton {
  display: block;
  width: 100%;
  margin-top: 15px;
  background-color: #f39c12;
  color: white;
  padding: 12px;
  font-size: 16px;
  transition: background-color 0.3s ease;
}

#randomButton:hover {
  background-color: #e67e22;
}

/* Styles pour la section des Web Workers */
.workers-container {
  max-width: 1200px;
  margin: 30px auto 0;
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.worker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* margin-bottom: 20px;    */
}

.workers-section-title {
  margin: 25px 0 15px;
  color: #34495e;
  font-size: 18px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

.workers-stats {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.worker-card {
  flex: 1;
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.worker-card h3 {
  font-size: 18px;
  margin-bottom: 15px;
  color: #34495e;
  border-bottom: 1px solid #ddd;
  padding-bottom: 5px;
}

.worker-progress {
  margin-bottom: 15px;
}

.worker-progress-bar {
  width: 100%;
  height: 15px;
  background-color: #ecf0f1;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.worker-progress-fill {
  height: 100%;
  width: 0%;
  background-color: #3498db;
  transition: width 0.5s ease-in-out;
}

/* Couleurs différentes selon l'opération */
.worker-progress-fill.generate {
  background-color: #2ecc71; /* Vert pour génération */
}

.worker-progress-fill.modify {
  background-color: #f39c12; /* Orange pour modification */
}

.worker-progress-fill.delete {
  background-color: #e74c3c; /* Rouge pour suppression */
}

/* Changer les couleurs spécifiques aux workers */
#worker1-progress-fill.generate {
  background-color: #2ecc71;
}

#worker1-progress-fill.modify {
  background-color: #f39c12;
}

#worker1-progress-fill.delete {
  background-color: #e74c3c;
}

#worker2-progress-fill.generate {
  background-color: #27ae60; /* Vert plus foncé pour worker 2 */
}

#worker2-progress-fill.modify {
  background-color: #d35400; /* Orange plus foncé pour worker 2 */
}

#worker2-progress-fill.delete {
  background-color: #c0392b; /* Rouge plus foncé pour worker 2 */
}

.operation-badge {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  margin-left: 8px;
}

.operation-badge.generate {
  background-color: #2ecc71;
}

.operation-badge.modify {
  background-color: #f39c12;
}

.operation-badge.delete {
  background-color: #e74c3c;
}

.worker-stats-details {
  font-size: 14px;
  color: #7f8c8d;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.worker-stats-details p {
  margin-bottom: 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed #eee;
  padding-bottom: 6px;
}

.worker-stats-details span {
  font-weight: bold;
  color: #2c3e50;
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .form-container,
  .table-container {
    width: 100%;
    min-width: auto;
  }

  .performance-stats {
    flex-direction: column;
  }

  .stat-card {
    width: 100%;
    margin-right: 0;
  }

  .tabs {
    flex-direction: column;
    align-items: center;
  }

  .tab-button {
    width: 100%;
    margin-bottom: 5px;
    border-radius: 5px;
  }

  .workers-stats {
    flex-direction: column;
  }
}
