* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 0;
  color: #333;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: #333;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.navbar-brand:hover {
  opacity: 0.7;
}

.brand-icon {
  font-size: 24px;
}

.navbar-menu {
  display: flex;
  list-style: none;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.navbar-link {
  padding: 10px 20px;
  text-decoration: none;
  color: #6c757d;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: block;
}

.navbar-link:hover {
  background: #f8f9fa;
  color: #667eea;
}

.navbar-link.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Ajuster le container pour tenir compte de la navbar */
body > .container {
  margin: 20px auto;
  max-width: 1400px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 40px;
}

.header-content h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 5px;
}

.version {
  font-size: 14px;
  opacity: 0.9;
}

.options {
  padding: 20px 40px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  gap: 30px;
  align-items: center;
}

.checkbox-label,
.select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type='checkbox'] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.select-label select {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  background: white;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 600px;
}

.input-section,
.output-section {
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
}

.input-section {
  border-right: 1px solid #e9ecef;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #495057;
}

textarea {
  flex: 1;
  width: 100%;
  padding: 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  background: #f8f9fa;
  color: #333;
}

textarea:focus {
  outline: none;
  border-color: #667eea;
  background: white;
}

textarea::placeholder {
  color: #adb5bd;
}

.output-display {
  flex: 1;
  padding: 15px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #f8f9fa;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: #333;
}

.output-display.has-content {
  background: white;
}

.placeholder {
  color: #adb5bd;
  font-style: italic;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.output-display.error {
  color: #dc3545;
  background: #fff5f5;
  border-color: #dc3545;
}

/* Buttons */
button {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

/* Footer */
footer {
  padding: 20px 40px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
  font-size: 14px;
  color: #6c757d;
}

footer a {
  color: #667eea;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 30px;
  border-radius: 12px;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
  color: #adb5bd;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 20px;
}

.close:hover,
.close:focus {
  color: #333;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #495057;
}

#rulesContent {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .input-section {
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }

  .options {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
}

/* Animation pour le feedback de copie */
@keyframes copied {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.btn-primary.copied {
  animation: copied 0.3s ease;
  background: #28a745;
}

/* Highlight pour les valeurs anormales dans le format détaillé */
.output-display .abnormal {
  color: #dc3545;
  font-weight: bold;
}

