body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #f1f3f5;
  color: #333;
  margin: 0;
  padding: 2rem;
  line-height: 1.6;
}

#chat {
  max-width: 1000px;
  margin: auto;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid #dee2e6;
  margin-bottom: 3rem;
}

h2 {
  margin-top: 0;
  font-size: 1.75rem;
  color: #212529;
  text-align: center;
  margin-bottom: 0.5rem;
}

.subtitle {
  text-align: center;
  color: #6c757d;
  margin-top: 0;
  margin-bottom: 2rem;
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  margin-top: 0.5rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.input-group input {
  flex: 3;
  margin: 0;
}

.input-group button {
  flex: 1;
  margin: 0;
  white-space: nowrap;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.action-buttons button {
  flex: 1;
}

button {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-sizing: border-box;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
button:focus {
  border-color: #007bff;
  outline: none;
}

button {
  background-color: #007bff;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover:not(:disabled) {
  background-color: #0069d9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.result {
  margin-top: 2rem;
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  white-space: pre-wrap;
  border: 1px solid #ced4da;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-height: 80vh;
  overflow-y: auto;
}

pre {
  background: #f1f3f5;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
  color: #212529;
  border: 1px solid #e9ecef;
  max-height: 300px;
  overflow-y: auto;
}

.content-preview {
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  margin-top: 0.5rem;
}

.tag-item {
  display: inline-block;
  background: #e7f5ff;
  color: #1971c2;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin: 0.25rem;
  font-size: 0.85rem;
}

.keyword-item {
  display: inline-block;
  background: #fff4e6;
  color: #e67700;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin: 0.25rem;
  font-size: 0.85rem;
}

.score-display {
  display: inline-block;
  font-weight: bold;
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: #d3f9d8;
  color: #2b8a3e;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h3 {
  margin: 0;
}

.toggle-button {
  background: transparent;
  border: none;
  color: #495057;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.toggle-button:hover {
  background: #f1f3f5;
}

.section {
  margin-bottom: 1.75rem;
  padding: 1rem;
  border-radius: 8px;
  background-color: white;
  border: 1px solid #e9ecef;
  transition: all 0.2s ease;
}

.section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.full-width {
  grid-column: 1 / -1;
}

.section-content {
  margin-top: 0.5rem;
}

.section strong {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: #495057;
  font-size: 1.05rem;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 0.5rem;
}

hr {
  margin: 2rem 0;
  border: none;
  border-top: 1px solid #dee2e6;
  position: relative;
}

hr:after {
  content: '';
  display: block;
  position: absolute;
  top: -1px;
  width: 100px;
  height: 3px;
  background: #007bff;
  left: 50%;
  transform: translateX(-50%);
}

h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #343a40;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e9ecef;
}

.step-indicator {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 33%;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.step.active .step-number {
  background: #007bff;
  color: white;
}

.step-label {
  font-size: 0.85rem;
  color: #6c757d;
  text-align: center;
}

.step.active .step-label {
  color: #007bff;
  font-weight: bold;
}

.error-message {
  background-color: #fff5f5;
  color: #e03131;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border-left: 4px solid #e03131;
  font-weight: 500;
}

.loading-message {
  text-align: center;
  padding: 1rem;
  color: #495057;
  font-style: italic;
}

/* Styles simplifiés pour l'aperçu HTML et le code source */
.tabs {
  display: flex;
  margin-bottom: 1rem;
  border-bottom: 1px solid #dee2e6;
}

.tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-right: 0.5rem;
  color: #495057;
}

.tab.active {
  color: #007bff;
  border-bottom-color: #007bff;
  font-weight: 500;
}

.copy-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #495057;
  cursor: pointer;
  padding: 0.5rem;
}

.copy-btn:hover {
  color: #007bff;
}

.tab-panel {
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1rem;
  min-height: 300px;
  max-height: 500px;
  overflow: auto;
}

.html-render {
  font-family: system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

.code-view {
  margin: 0;
  padding: 0;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
}