/* ============================================
   FONTS
   ============================================ */
@font-face {
  font-family: "forme";
  src: url("../source/font/forme-4.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "forme-5";
  src: url("../source/font/forme-5.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Mono";
  src: url("../source/font/SpaceMono-Regular.ttf") format("ttf");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "PPGrafier";
  src: url("../source/font/PPGrafier-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}


@font-face {
  font-family: "PPPlayground";
  src: url("../source/font/Monaako-Script.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}


:root {
  --color-black: #000;
  --color-white: #fff;
}

/* ============================================
   BASE
   ============================================ */
html {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: PPGrafier, sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

/* ============================================
   LAYOUT
   ============================================ */
header {
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  font-size: 5rem;
  font-family: PPGrafier, sans-serif;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  line-height: 1;
  transition: font-family 0.3s ease;
}

main {
  padding-top: 5vh;
  width: 100vw;
  max-height: 90vh;
  margin: 0 auto;
  position: relative;
}

.intro-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: PPGrafier, sans-serif;
  color: var(--color-black);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 1;
  white-space: pre-line;
  max-width: 90vw;
  width: max-content;
  min-width: 400px;
  word-break: normal;
  overflow-wrap: anywhere;
}

h1 {
  font-size: 6rem;
  font-weight: normal;
  font-family: PPGrafier, sans-serif;
  color: var(--color-black);
  text-align: center;
  z-index: 1;
}

h3 {
  font-size: 5rem;
  font-weight: normal;
  font-family: PPGrafier, sans-serif;
  color: var(--color-black);
  text-align: center;
  z-index: 1;
}

p {
  font-size: 4rem;
  font-family: PPGrafier, sans-serif;
  color: var(--color-black);
  text-align: center;
  z-index: 1;
}

footer {
  width: 100vw;
}

/* ============================================
   NAVIGATION
   ============================================ */
#navigation {
  display: flex;
  flex-direction: row;
  gap: 0;
  width: 100vw;
}

#navigation button {
  font-size: 5rem;
  font-family: PPGrafier, sans-serif;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  line-height: 1;
  transition: font-family 0.3s ease;
}

#navigation button.active {
  font-family: "PPPlayground", sans-serif;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  position: relative;
  z-index: 1;
  font-family: PPGrafier, sans-serif;
}

/* Section Langage - Database */
#database-container {
  width: 50vw;
  height: 50vh;
  position: fixed;
  top: 5vh;
  left: 0vw;
  z-index: -1;

  display: flex;
  flex-direction: column;
}

#database-container canvas {
  flex: 1;
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================
   STYLES DES FORMES DE LA BASE DE DONNÉES
   ============================================ */


/* Section Langage - Letters Selector */
#letters-selector {
  width: 50vw;
  height: 50vh;
  position: fixed;
  top: 50vh;
  left: 0vw;
  background: var(--color-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;

}

.letters-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  width: auto;
  height: auto;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
}

.letters-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.letter-item {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--color-black);
  font-family: "forme", sans-serif;
  font-size: 38rem;
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}


.save-button {
  width: 70%;
  align-self: center;
  padding: 15px;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-family: PPGrafier, sans-serif;
  font-weight: bold;
  border: 2px solid #333;
  background: var(--color-white);
  color: #333;
  cursor: pointer;
  transition: all 0.3s ease;
}

.save-button:hover {
  background: #333;
  color: var(--color-white);
}

/* Section Information */
#section-information {
  position: fixed;
  top: 5vh;
  right: 0vw;
  width: 50vw;
  height: 95vh;
  font-size: 1.6rem;
  line-height: 1.6;
}

#information-container {
  width: 100%;
  height: 100%;
  padding: 3rem;
  box-sizing: border-box;
  overflow-y: auto;
  font-family: Mono, monospace;
  background: var(--color-white);
}

/* Table des matières */
.toc {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 3rem;
}

.toc-item {
  font-size: 1.6rem;
  line-height: 1.8;
  margin: 0;
  padding: 0;
}

.toc-item a {
  color: var(--color-black);
  text-decoration: none;
  font-size: 1.6rem;
  display: block;
  padding: 0;
  margin: 0;
}

.toc-item a:hover {
  color: var(--color-black);
  text-decoration: none;
}

.toc-item a[style*="pointer-events: none"] {
  cursor: not-allowed;
}

/* Contenu de la documentation */
.documentation-content {
  max-width: 100%;
}

.doc-section {
  margin-bottom: 4rem;
  padding-bottom: 3rem;
  display: none;
  /* Caché par défaut, sera révélé progressivement */
}

.doc-section:last-child {
  border-bottom: none;
}

.doc-section h2 {
  font-size: 2.4rem;
  font-weight: bold;
  margin: 0 0 2rem 0;
  padding-bottom: 1rem;
  border-bottom: 2px solid #333;
  color: var(--color-black);
}

.doc-section p {
  margin: 0 0 1.5rem 0;
  text-align: justify;
}

.doc-section em {
  font-style: italic;
}

.doc-section b {
  font-weight: bold;
}

.doc-section q {
  quotes: '"' '"' "'" "'";
  font-style: italic;
}

.doc-section blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: #f8f9fa;
  border-left: 4px solid #333;
  font-style: italic;
}

.doc-section code {
  font-family: Mono, monospace;
  background: #f0f0f0;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 1.4rem;
}

/* Section Apprentissage */
#section-apprentissage {
  left: .5vw;
  height: 90vh;
  width: 49.5vw;
  box-sizing: border-box;
}

#apprentissage-container {
  width: 100%;
  height: 100%;
}

#apprentissage-dialogue-box {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}

#apprentissage-questions-container {
  flex: 1;
  min-height: 0;
}

.apprentissage-question {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
}

.apprentissage-question:last-child {
  border-bottom: none;
}

.apprentissage-question-text {
  font-size: 4rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.apprentissage-select {
  font-size: 3rem;
  width: 100%;
  margin-top: 1rem;
}

.apprentissage-end {
  font-size: 4rem;
  line-height: 1.6;
  margin-top: 2rem;
  padding-top: 2rem;

}

/* Section Raster */
#raster-container {
  width: 50vw;
  height: 95vh;
  position: fixed;
  top: 5vh;
  right: 0vw;
}

#raster-container canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.raster-image-control {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.raster-image-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid #333;
  background: var(--color-white);
  flex-shrink: 0;
}

.raster-image-text {
  font-size: 1.6rem;
  font-family: Mono, monospace;
  color: var(--color-black);
}