/* Reset */

@font-face {
    font-family: 'Cursive Maternelle';
    src: url('../fonts/2 - Cursive Dumont maternelle(8).otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Belle Allure CM';
    src: url('../fonts/BelleAllureCM-Gros.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Belle Allure Script';
    src: url('../fonts/BelleAllureScript2i-Gros.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Script École';
    src: url('../fonts/scriptcole.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Écriture A';
    src: url('../fonts/EcritureA-Romain.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OpenDyslexic Alta';
    src: url('../fonts/OpenDyslexicAlta-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fredoka One';
    src: url('../fonts/FredokaOne-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}


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

body {
  font-family: 'Fredoka', sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* Header */
.top-header {
  background: white;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
}

.title-container {
  display: flex;
  flex-direction: column;
  gap: 5px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
}



.logo-small {
  /* Increased logo size by ~30% */
  width: 220px; /* Augmenté de 20% (120 * 1.2 = 144) */
  height: auto;
}

.main-title {
  font-size: 72px;
  font-weight: 700;
  color: #008b8b;
  letter-spacing: 1px;
  margin: 0;
}

.btn-ocr-header {
  padding: 10px 20px;
  background: #E0F7FA;
  border: 1px solid #B2EBF2;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
  flex-shrink: 0; /* Empêche le bouton de se réduire */
}

.btn-ocr-header:hover {
  background: #B2EBF2;
  border-color: #80DEEA;
}

/* Container */
.app-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  max-width: 1400px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Sidebar */
.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-section {
  background: #E0F7FA;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.sidebar-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.guide-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.guide-box {
  padding: 15px;
  background: #E0F7FA;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.guide-box h4 {
  font-size: 14px;
  margin-bottom: 10px;
  font-weight: 600;
}

.guide-box p {
  margin-bottom: 8px;
}

.guide-box p:last-child {
  margin-bottom: 0;
}

.guide-slogan {
  color: #00838f !important;
  font-weight: 600 !important;
  text-align: center;
}

.guide-astuce {
  background: #fffde7;
  border-left: 3px solid #fbc02d;
}

.color-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.color-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}

.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
}

.color-dot.red { background: #e53935; }
.color-dot.blue { background: #1e88e5; }
.color-dot.green { background: #43a047; }
.color-dot.gray { background: #9e9e9e; }

.letter-examples {
  color: #777;
  font-size: 12px;
  margin-top: 2px;
}

.modes-list {
  list-style: none;
  font-size: 13px;
  line-height: 1.8;
  color: #555;
}

/* Main content */
.app-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #333;
}

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

/* Paramètres */
.params-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 15px;
}

.param-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-item label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.select-input {
	  padding: 10px 12px;
	  border: 1px solid #ddd;
	  border-radius: 8px;
	  font-family: 'Fredoka', sans-serif;
	  font-size: 14px;
	  background: #FFF8E1; /* Orange très pâle */
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  outline: none;
  border-color: #FF8C00;
}

.range-input {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FF8C00;
  cursor: pointer;
}

.range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FF8C00;
  cursor: pointer;
  border: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
}

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

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

/* Inputs */
.input-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.help-text {
  font-size: 13px;
  color: #777;
  margin-bottom: 0; /* Retirer la marge du paragraphe */
}

.input-group {
  margin-bottom: 15px;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: #555;
}

.text-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  transition: border-color 0.2s;
}

.text-input:focus {
  outline: none;
  border-color: #FF8C00;
}

.textarea-input {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  resize: vertical;
  margin-bottom: 15px;
  transition: border-color 0.2s;
}

.textarea-input:focus {
  outline: none;
  border-color: #FF8C00;
}

/* Buttons */
.btn-reset {
  padding: 8px 16px;
  background: #E0F7FA;
  border: 1px solid #B2EBF2;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
}

.btn-reset:hover {
  background: #B2EBF2;
  border-color: #80DEEA;
}

.btn-colorize {
  background: #008b8b; /* Bleu canard du logo */
  width: 100%;
  padding: 15px;
  
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0, 139, 139, 0.3);
}

.btn-colorize:hover {
  background: #006666; /* Variation de couleur au survol */
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 139, 139, 0.4);
}

.btn-colorize:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
}

.export-buttons {
  display: flex;
  gap: 10px;
}

.btn-export {
  padding: 8px 16px;
  background: #E0F7FA;
  border: 1px solid #B2EBF2;
  border-radius: 8px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #333;
}

.btn-export:hover {
  background: #B2EBF2;
  border-color: #80DEEA;
}

/* Output */
.output-area {
  min-height: 0;
  padding: 20px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.8;
  user-select: text;
  cursor: text;
}

/* Légende */
.bottom-legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #555;
}

.legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.legend-dot.green { background: #43a047; }
.legend-dot.gray { background: #9e9e9e; }
.legend-dot.red { background: #e53935; }
.legend-dot.blue { background: #1e88e5; }

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 12px;
}

/* Classes de colorisation */
.voyelle, .c-rouge { color: #e53935; }
.consonne, .c-bleu { color: #1e88e5; }
.digramme, .c-vert { color: #43a047; }
.muet, .c-gris { color: #9e9e9e; }
.noir, .c-noir { color: #000000; }
.vert-sapin, .c-vert-sapin { color: #1b5e20; }

/* Bulles */
.mot-bulle {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 4px;
  border: 2px solid #757575;
  border-radius: 12px;
  background: transparent;
}


.ligne-bulle {
  display: inline-block;
  padding: 6px 12px;
  margin: 6px 0;
  border: 2px solid #757575;
  border-radius: 12px;
  background: transparent;
}
/* Barre flottante */
.floating-toolbar {
  position: absolute;
  display: none;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  padding: 8px;
  gap: 6px;
  z-index: 1000;
}

.floating-toolbar.visible {
  display: flex;
}

.color-btn {
  width: 32px;
  height: 32px;
  border: 2px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s;
  padding: 0;
}

.color-btn:hover {
  transform: scale(1.1);
  border-color: #333;
}

.color-btn.gris { background: #9e9e9e; }
.color-btn.noir { background: #000000; }
.color-btn.vert { background: #43a047; }
.color-btn.bleu { background: #1e88e5; }
.color-btn.rouge { background: #e53935; }
.color-btn.vert-sapin { background: #1b5e20; }

/* Loader */
.loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
  .top-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .main-title {
    font-size: 50px;
  }

  

  .app-container {
    grid-template-columns: 1fr;
    padding: 0 10px;
    margin: 10px auto;
  }

  .app-sidebar {
    padding: 0 10px;
  }

  .sidebar-section {
    border-radius: 0;
  }

  .card {
    border-radius: 0;
  }

  .params-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 10px;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .main-title {
    font-size: 40px;
  }

  

  .btn-ocr-header {
    width: 100%;
    text-align: center;
  }

  .params-row {
    grid-template-columns: 1fr;
  }

  .input-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .help-text {
    margin-bottom: 0;
  }
  /* La légende reste en ligne par défaut, flex-wrap: wrap est suffisant */
}*/
@font-face {
  font-family: 'Cursive Maternelle';
  src: url('../fonts/2 - Cursive Dumont maternelle(8).otf') format('opentype');
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -moz-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -webkit-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

@font-face {
  font-family: 'Belle Allure CM';
  src: url('../fonts/BelleAllureCM-Gros.otf') format('opentype');
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -moz-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -webkit-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

@font-face {
  font-family: 'Belle Allure Script';
  src: url('../fonts/BelleAllureScript2i-Gros.otf') format('opentype');
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -moz-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -webkit-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

@font-face {
  font-family: 'Écriture A';
  src: url('../fonts/EcritureA-Romain.otf') format('opentype');
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -moz-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -webkit-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

@font-face {
  font-family: 'Fredoka One';
  src: url('../fonts/FredokaOne-Regular.otf') format('opentype');
}

@font-face {
  font-family: 'OpenDyslexic Alta';
  src: url('../fonts/OpenDyslexicAlta-Regular.otf') format('opentype');
}

@font-face {
  font-family: 'Script École';
  src: url('../fonts/scriptcole.ttf') format('truetype');
  font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -moz-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  -webkit-font-feature-settings: "liga" 1, "clig" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}



/* Section Contact */
.contact-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.logo-contact {
    width: 32px; /* Taille du logo plus petite */
    height: auto;
    flex-shrink: 0;
}

.contact-mail {
    font-size: 13px;
    color: #008b8b; /* Couleur du logo Facilire */
    text-decoration: none;
    font-weight: 500;
    word-break: break-all; /* Assure que l'email ne déborde pas */
}

.contact-mail:hover {
    text-decoration: underline;
}



.text-bleu-canard {
    color: #008b8b; /* Bleu canard */
    font-weight: 700;
    line-height: 1.2;
}

.guide-box .title-separator {
    margin-bottom: 15px; /* Ajoute un espace après le titre */
    display: block;
}


/* --- Discreet top notice (user request) --- */
.top-notice {
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-style: italic;
  color: #0E7C7B; /* bleu canard */
  font-size: 0.95rem;
  padding: 6px 10px;
}


/* === FACILIRE hotfix: remove grey background from colorized preview === */
#output, #preview, #result, #colorized, #colorizedText,
.output, .preview, .result, .colorized-output, .bottom-pane,
.pane.bottom, .preview-area, .colorized {
    background: transparent !important;
    background-color: transparent !important;
}
body, html {
    background: #ffffff !important;
    background-color: #ffffff !important;
}
/* If Bootstrap utility classes were used, neutralize them here */
.bg-light, .bg-secondary, .bg-body-tertiary, .bg-gray-100 {
    background: transparent !important;
    background-color: transparent !important;
}



/* === FACILIRE hotfix v2: remove grey background in colorized preview === */
#colorized-output,
.card .output-area,
.output-area {
  background: #ffffff !important;
  background-color: #ffffff !important;
}

/* neutralize nested elements background just in case */
#colorized-output * {
  background: transparent !important;
  background-color: transparent !important;
}

/* keep page background white */
html, body {
  background: #ffffff !important;
  background-color: #ffffff !important;
}


.sub-slogan {
  font-size: 20px;
  font-weight: 400;
  color: #FF9800;
  margin: 4px 0 0 0;

  

  
}


/* === Responsive tweaks (added by ChatGPT, 2025-11-11) === */

/* Prevent horizontal scroll on small screens */
html, body { max-width: 100%; overflow-x: hidden; }

img, svg, canvas, video { max-width: 100%; height: auto; }

/* Stack sidebar and main on narrow screens */
@media (max-width: 960px) {
  .app-container {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 12px;
    margin: 12px auto;
  }
  .app-sidebar {
    order: 2;
  }
  .app-main {
    order: 1;
  }
  .input-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .logo-small {
    width: min(220px, 60vw);
  }
  .main-title {
    font-size: clamp(18px, 4vw, 28px);
    text-align: center;
  }
  .btn-colorize, .btn-export {
    width: 100%;
  }
  .guide-box { padding: 12px; }
  .bottom-legend {
    gap: 12px;
    padding: 12px;
  }
}

/* Extra-small phones */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .app-container { padding: 0 10px; }
  textarea, .output, .preview-box {
    font-size: 16px;
    line-height: 1.4;
  }
  .legend-item { font-size: 12px; }
  .legend-dot { width: 12px; height: 12px; }
}
