/* ============================================================
   CODE 3 v2 - Styles personnalisés
   Thème calqué sur le logo : encre noire / rouge marker,
   typographie Anton (titres) + "Permanent Marker" (accents)
   Système de thème clair / sombre via variables CSS (data-theme)
   ============================================================ */

/* ---------- Variables de thème ---------- */
:root {
  --c3-bg: 255 255 255;       /* fond principal */
  --c3-bg-alt: 244 244 244;   /* fond secondaire (cartes, zones) */
  --c3-ink: 17 17 17;         /* encre / texte / bordures */
  --c3-red: 255 0 51;         /* rouge marqueur */
  --c3-dot: 17 17 17;         /* couleur du grain papier */
}

[data-theme="dark"] {
  --c3-bg: 13 13 13;
  --c3-bg-alt: 24 24 24;
  --c3-ink: 240 240 240;
  --c3-red: 255 51 85;
  --c3-dot: 255 255 255;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: rgb(var(--c3-bg));
  color: rgb(var(--c3-ink));
  transition: background-color 0.25s ease, color 0.25s ease;
}

.font-display {
  font-family: 'Anton', sans-serif;
  letter-spacing: 0.02em;
}

.font-marker {
  font-family: 'Permanent Marker', cursive;
}

/* Bracket logo "[ ]" légèrement étiré, comme dans le logo officiel */
.c3-bracket-logo {
  font-family: 'Anton', sans-serif;
  transform: scaleY(1.3);
  display: inline-block;
}

/* Grands crochets décoratifs (coin de cadrage façon logo) */
.c3-corner-bracket {
  position: relative;
}
.c3-corner-bracket::before,
.c3-corner-bracket::after {
  content: '';
  position: absolute;
  width: 28px;
  height: 28px;
}
.c3-corner-bracket::before {
  top: -10px;
  left: -10px;
  border-top: 5px solid rgb(var(--c3-ink));
  border-left: 5px solid rgb(var(--c3-ink));
}
.c3-corner-bracket::after {
  bottom: -10px;
  right: -10px;
  border-bottom: 5px solid rgb(var(--c3-ink));
  border-right: 5px solid rgb(var(--c3-ink));
}
.c3-corner-bracket--red::before,
.c3-corner-bracket--red::after {
  border-color: rgb(var(--c3-red));
}

/* Effet "marqueur barré" - mot rayé d'un trait rouge façon logo */
.c3-strike {
  position: relative;
  display: inline-block;
}
.c3-strike::after {
  content: '';
  position: absolute;
  left: -4%;
  right: -4%;
  top: 48%;
  height: 4px;
  background: rgb(var(--c3-red));
  transform: rotate(-4deg);
  border-radius: 2px;
}

/* Léger effet papier/grain sur le fond, adapté au thème */
.c3-paper-bg {
  background-image:
    radial-gradient(circle at 1px 1px, rgb(var(--c3-dot) / 0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

/* ---------- Bouton de changement de thème ---------- */
.c3-theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgb(var(--c3-ink));
  color: rgb(var(--c3-ink));
  background: transparent;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}
.c3-theme-toggle:hover {
  background: rgb(var(--c3-ink));
  color: rgb(var(--c3-bg));
}
.c3-theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Scrollbar discrète, adaptée au thème */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgb(var(--c3-bg-alt));
}
::-webkit-scrollbar-thumb {
  background: rgb(var(--c3-ink));
}
::-webkit-scrollbar-thumb:hover {
  background: rgb(var(--c3-red));
}

/* Chat window flex display override (Tailwind 'hidden' toggling) */
#c3-chat-window.flex {
  display: flex;
}

/* Rendu markdown propre dans les bulles du chatbot (réponses IA) */
.c3-chat-bubble {
  line-height: 1.5;
}
.c3-chat-bubble p {
  margin: 0 0 0.5em 0;
}
.c3-chat-bubble p:last-child {
  margin-bottom: 0;
}
.c3-chat-bubble strong {
  color: rgb(var(--c3-red));
  font-weight: 700;
}
.c3-chat-bubble em {
  font-style: italic;
  opacity: 0.9;
}
.c3-chat-list {
  margin: 0.25em 0 0.5em 0;
  padding-left: 1.4em;
}
ul.c3-chat-list {
  list-style: disc;
}
ol.c3-chat-list {
  list-style: decimal;
}
.c3-chat-list .c3-chat-list {
  margin-top: 0.25em;
}
.c3-chat-list li {
  margin-bottom: 0.25em;
}
.c3-chat-bubble br {
  display: block;
  content: '';
  margin-top: 0.25em;
}