/* Reset basique (optionnel) */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background-color: #f0f2f5;
  font-family: 'Arial', sans-serif;
}

.editor-container {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 2rem;
}

.editor-column {
  width: 50%;
}

.input-wrapper,
.output-wrapper {
  height: 85vh;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.input-wrapper:hover,
.output-wrapper:hover {
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#markdown-input,
#markdown-output {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  padding: 1rem;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

#markdown-input {
  background-color: #f9f9f9;
  font-family: 'Courier New', monospace;
}

#markdown-output {
  background-color: white;
  font-family: 'Georgia', serif;
  overflow-y: auto;
}

/* Styles Markdown */
#markdown-output h1 {
  color: #2c3e50;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.3rem;
}
#markdown-output h2 {
  color: #34495e;
}
#markdown-output h3 {
  color: #7f8c8d;
}
#markdown-output a {
  color: #3498db;
  text-decoration: none;
}
#markdown-output a:hover {
  text-decoration: underline;
}

.download-btn {
  display: block;
  width: fit-content;
  margin: 1rem auto;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #007bff, #0056b3);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.download-btn:hover {
  background: linear-gradient(135deg, #0056b3, #003f7f);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.download-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Blocs de code */
#markdown-output pre {
  background-color: #282c34;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

#markdown-output code {
  font-family: 'Courier New', monospace;
  border-radius: 4px;
  font-size: 0.9rem;
}

#markdown-output pre code {
  background-color: transparent;
  padding: 0;
  color: #abb2bf;
}

/* Couleurs syntaxiques */
#markdown-output pre code .hljs-keyword { color: #c678dd; }
#markdown-output pre code .hljs-string  { color: #98c379; }
#markdown-output pre code .hljs-comment { color: #5c6370; font-style: italic; }
#markdown-output pre code .hljs-function { color: #61afef; }
#markdown-output pre code .hljs-params { color: #e5c07b; }
#markdown-output pre code .hljs-number { color: #d19a66; }

/* --- Styles pour les tableaux Markdown --- */
/* --- Styles améliorés pour les tableaux Markdown --- */
#markdown-output table {
  width: 100%;
  border-collapse: separate; /* Important : permet l'arrondi des coins */
  border-spacing: 0; /* Supprime l'espace entre les cellules */
  margin: 1rem 0;
  border: 2px solid #333; /* Bordure extérieure de la table */
  border-radius: 10px; /* Arrondit les bords du tableau */
  overflow: hidden; /* Empêche les débordements */
}

#markdown-output th,
#markdown-output td {
  border: 2px solid #333;
  padding: 10px;
  text-align: left;
  background: white; /* Couleur de fond */
}

#markdown-output th {
  background-color: #f4f4f4;
}


#markdown-output table th:first-child {
  border-top-left-radius: 10px;
}

#markdown-output table th:last-child {
  border-top-right-radius: 10px;
}

#markdown-output table tr:last-child td:first-child {
  border-bottom-left-radius: 10px;
}

#markdown-output table tr:last-child td:last-child {
  border-bottom-right-radius: 10px;
}


#markdown-output th,
#markdown-output td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

#markdown-output th {
  background-color: #f4f4f4;
}
