* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #333333;
  --secondary: #e8efe8;
  --accent: #b8c5b8;
  --white: #ffffff;
  font-family: 'Inter', sans-serif;
}

body {
  background: var(--white);
  min-height: 100vh;
  padding: 0;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.header {
  position: relative;
  background: var(--secondary);
  padding: 2rem 4rem;
  display: flex;
  align-items: center;
  height: 110px;
}

.header::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
  height: 40px;
  background: repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 10px,
      #f5f5f5 10px,
      #f5f5f5 20px
  );
}

.header-content {
  position: fixed;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.header h1 {
  position: fixed;
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 300;
  top: 25px;
  left: 50px;
}

.header p {
  position: fixed;
  font-size: 0.8rem;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 0.9rem;
  left: 50px;
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.toolbar {
  background: var(--white);
  padding: 1rem 0;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  border-bottom: 1px solid var(--accent);
}

.btn {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-secondary {
  background: var(--secondary);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-secondary:hover {
  background: var(--accent);
}

.btn-group {
  display: flex;
  gap: 1rem;
}

.editor {
  background: var(--white);
  border: 1px solid var(--accent);
  padding: 1rem;  
  max-width: 100%;
  height: 400px;  
  margin: 20px; 
  overflow-y: auto; 
}

.preview {
  background: var(--white);
  border: 1px solid var(--accent);
  padding: 1rem;  
  max-width: 900px;
  height: 400px;  
  margin: 20px; 
  overflow-y: auto; 
}

.container {
  display: grid;
  grid-template-columns: 1fr 1fr; 
  column-gap: 0.5rem;
  margin-top: 1rem;
  height: calc(100vh - 200px); 
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--accent);
}

.panel-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--primary);
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.editor-content, #htmlPreview {
  width: 100%;
  height: 100%; 
  border: none;
  font-size: 1rem;
  line-height: 1.6;
  padding: 1rem;
  color: var(--primary);
  background: #fafafa;
  overflow-y: auto; 
  outline: none;
}

#raw-html {
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap; 
  word-wrap: break-word; 
  background-color: #fafafa; 
  padding: 1rem; 
  overflow-y: auto; 
  border: 1px solid var(--accent); 
}

.font-size-select {
  min-width: 150px;
}

/* Responsiveness */
@media (max-width: 768px) {
  .container {
    padding-left: 30px;
    grid-template-columns: 1fr;
  }

  .editor,
  .preview {
    width: 85%; 
    max-width: 85%; 
    height: auto; 
  }

  .btn {
    font-size: 0.7rem; 
    padding: 0.4rem 0.8rem;
  }

  .btn-secondary {
    font-size: 0.65rem; 
    padding: 0.3rem 0.6rem;
  }
}

/* Styles pour le sélecteur de taille */
.ql-snow .ql-picker.ql-header .ql-picker-label::before,
.ql-snow .ql-picker.ql-header .ql-picker-item::before {
  content: 'Paragraphe' !important;
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  content: 'Titre 3' !important;
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  content: 'Titre 2' !important;
}

.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  content: 'Titre 1' !important;
}

/* Styles pour le texte dans l'éditeur */
.ql-editor p {
  margin-bottom: 1em;
  font-size: 1em !important;
  line-height: 1.6;
}

.ql-editor h1 {
  font-size: 2em !important;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.ql-editor h2 {
  font-size: 1.5em !important;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.ql-editor h3 {
  font-size: 1.17em !important;
  font-weight: bold;
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.ql-editor > * {
  margin-bottom: 1em;
}

/* Augmenter la largeur du sélecteur de taille */
.ql-snow .ql-picker.ql-header {
  width: 140px !important;
}

.ql-snow .ql-picker-label {
  padding: 0 20px 0 8px !important;
}

/* Ajuster la largeur du menu déroulant */
.ql-snow .ql-picker-options {
  min-width: 140px !important;
}