/* -----------------------
   FONT-FACE DECLARATIONS
------------------------ */

@font-face {
  font-family: 'Terminal';
  src: url('/fonts/terminal-grotesque.woff2') format('woff2'),
       url('/fonts/terminal-grotesque.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Mess';
  src: url('/fonts/Mess-Light.woff2') format('woff2'),
       url('/fonts/Mess-Light.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'pic nic';
  src: url('/fonts/PicNic-Regular.woff2') format('woff2'),
       url('/fonts/PicNic-Regular.woff') format('woff');
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Terminal Open';
  src: url('/fonts/TerminalGrotesque-Open.woff2') format('woff2'),
       url('/fonts/TerminalGrotesque-Open.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Base';
  src: url('/fonts/bianzhidai-Base.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'cube';
  src: url('/fonts/bianzhidai_noBG-Cloud.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'bianzhidai_noBG-Cloud';
  src: url('/fonts/bianzhidai_noBG-Cloud.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Messier';
  src: url('/fonts/bianzhidai-Messier.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Messy';
  src: url('/fonts/bianzhidai-Messy.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Avara Black';
  src: url('/fonts/Avara-Black.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Stitches';
  src: url('/fonts/bianzhidai_noBG-Stitches.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Bubble';
  src: url('/fonts/bianzhidai_noBG-Bubble.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* -----------------------
   THEMES PAR MOMENT DE LA JOURNÉE
------------------------ */

/* 🌅 MORNING */
body.morning {
  background-color: #a5b1b2;
  color: #000000;
}
body.morning a { color: #000000; }
body.morning a:hover { color: #00ff77; }
body.morning a.Pseudo { color: #000000; }
body.morning a.Pseudo:hover { color: #00ff77; }
body.morning h1.mess { color: #00ff77; }
body.morning h1.terminal { color: #020202; }
body.morning h2 { color: #00ff77; background-color: #000000; }
body.morning h2:hover { background-color: #00ff77; }
body.morning h3 { color: #fc3f54; }
body.morning h3:hover { color: black; }
body.morning .thread-title { color: #fc3f54; }
body.morning .thread-title:hover { color: black; }
body.morning .navigation form input[type="submit"] { color: #00ff77 !important; background-color: #000000 !important; border: 2px solid #000000 !important; }
body.morning .navigation form input[type="submit"]:hover { background-color: #00ff77 !important; color: #000000 !important; }
body.morning #clock { color: #fc3f54; }
body.morning .day-info { color: #fc3f54; }
body.morning img:hover { background-color: chartreuse; }
body.morning p:hover { color: aliceblue; background-color: black;}
body.morning .ip-text { color: #000000; }

/* ☀️ AFTERNOON */
body.afternoon {
  background-color: #ffffff;
  color: #222;
}
body.afternoon a { color: #000000; }
body.afternoon a:hover { color: hotpink; }
body.afternoon a.Pseudo { color: #000000; }
body.afternoon a.Pseudo:hover { color: hotpink; }
body.afternoon h1.mess { color: #ff0b00; }
body.afternoon h1.terminal { color: #ffb0b0; }
body.afternoon h2 { color: black; background-color: chartreuse; }
body.afternoon h2:hover { background-color: aqua; }
body.afternoon h3 { color: hotpink; }
body.afternoon h3:hover { color: black; }
body.afternoon .thread-title { color: hotpink; }
body.afternoon .thread-title:hover { color: black; }
body.afternoon .navigation form input[type="submit"] { color: black !important; background-color: chartreuse !important; border: 2px solid #000000 !important; }
body.afternoon .navigation form input[type="submit"]:hover { background-color: aqua !important; color: black !important; }
body.afternoon #clock { color: #ffb0b0; }
body.afternoon .day-info { color: hotpink; }
body.afternoon img:hover { background-color: hotpink; }
body.afternoon p:hover { color: aliceblue; background-color: black;}
body.afternoon .ip-text { color: #000000; }

/* 🌇 EVENING */
body.evening {
  background-color: #1904ff;
  color: #ffffff;
}
body.evening a { color: #ffffff; }
body.evening a:hover { color: #ff0000; }
body.evening a.Pseudo { color: #ffffff; }
body.evening a.Pseudo:hover { color: #ff0000; }
body.evening h1.mess { color: #000000; }
body.evening h1.terminal { color: chartreuse; }
body.evening h2 { color: black; background-color: #ff0000; }
body.evening h2:hover { background-color: chartreuse; }
body.evening h3 { color: chartreuse; }
body.evening h3:hover { color: black; }
body.evening .thread-title { color: chartreuse; }
body.evening .thread-title:hover { color: black; }
body.evening .navigation form input[type="submit"] { color: black !important; background-color: #ff0000 !important; border: 2px solid #000000 !important; }
body.evening .navigation form input[type="submit"]:hover { background-color: chartreuse !important; color: black !important; }
body.evening #clock { color: chartreuse; }
body.evening .day-info { color: chartreuse; }
body.evening img:hover { background-color: chartreuse; }
body.evening p:hover { color: aliceblue; background-color: black;}
body.evening .ip-text { color: #000000; }

/* 🌙 NIGHT */
body.night {
  background-color: #000000;
  color: #ffffff;
}
body.night a { color: #ffffff; }
body.night a:hover { color: #09ff00; }
body.night a.Pseudo { color: #ffffff; }
body.night a.Pseudo:hover { color: #09ff00; }
body.night h1.mess { color: #ff0000; }
body.night h1.terminal { color: #ffffff; }
body.night h2 { color: white; background-color: #0013ff; }
body.night h2:hover { background-color: #ff0000; }
body.night h3 { color: #ff00ea; }
body.night h3:hover { color: black; }
body.night .thread-title { color: #ff00ea; }
body.night .thread-title:hover { color: black; }
body.night .navigation form input[type="submit"] { color: white !important; background-color: #0013ff !important; border: 2px solid #000000 !important; }
body.night .navigation form input[type="submit"]:hover { background-color: #ff0000 !important; color: white !important; }
body.night #clock { color: #ffffff; }
body.night .day-info { color: #ff00ea; }
body.night img:hover { background-color: chartreuse; }
body.night p:hover { color: aliceblue; background-color: black;}
body.night .ip-text { color: #000000; }

/* -----------------------
   BASE & STRUCTURE COMMUNE
------------------------ */

ul { list-style: none; padding: 0; }
a {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  text-decoration: none;
  font-size: 1em;
}

/* Style années 90 : Centrer toute la page avec une largeur fixe */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Wrapper principal centré style années 90 */
body > .HEAD,
body > .container {
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Empêcher le débordement horizontal */
html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* S'assurer que les images ne débordent pas */
img {
  max-width: 100%;
  height: auto;
}

.container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3rem;
  margin-top: 0;
  padding: 0 20px;
}

.navigation {
  flex: 0 0 250px;
  padding: 0;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 0;
}

.sidebar-right {
  flex: 0 0 250px;
  padding: 0;
}

img.MIRROIR { height: 128px; }

p {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 128px;
  margin: 0;
}
p.heure { font-size: 200px; }
.semaine {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 1em;
  margin: 0;
}
p:hover {
  margin: 0;
}

#calendrier{
  font-size: 3em;
}

#clock {
  font-family: 'cube';
  font-size: 2em;
}

.ip-text {
  font-size: 1em;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-weight: bold;
}

.bordereau {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  border-top: 4px solid #00ff77;
  border-bottom: 4px solid #00ff77;
  padding: 10px 0;
  margin-top: 30px;
  position: relative;
}

.scroll-text {
  display: inline-block;
  font-family: 'Mess';
  font-size: 5em;
  color: #00ff77;
  padding-left: 100%;
  animation: scroll-left 15s linear infinite;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-150%);
  }
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 30px);
  grid-gap: 10px;
  margin: 0px 0;
}

.calendar-day {
  width: 35px;
  height: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 1.2em;
  border: 1px solid #ccc;
  background-color: white;
  color: black;
}

.calendar-day.passed {
  background-color: red;
  color: white;
}

/* -----------------------
   TYPOGRAPHIE STRUCTURE
------------------------ */

h1.mess {
  font-family: 'Mess';
  font-size: 128px;
  margin: 0;
  transition: opacity 0.5s ease;
  font-weight: bold;
}

.fade-out { opacity: 0; }
.fade-in { opacity: 1; }

h1.terminal {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 128px;
  margin: -180px 0 0 0;
  font-weight: bold;
}

h2 {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 52px;
  font-weight: bold;
}

h3 {
  font-family: 'cube';
  font-size: 2em;
  margin-bottom: 0;
  font-weight: bold;
}

a.Pseudo {
  font-size: 128px;
}

.titre-centre {
  padding: 20px 40px;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 3em;
  text-align: center;
  color: black;
  border: 8px solid #00d7ff;
  animation: alternanceCouleur 1s infinite;
}

p.Biographie{
  font-size: 1em;
}

@keyframes alternanceCouleur {
  0%   { border-color: #00d7ff; }
  33%  { border-color: #6060ff; }
  66%  { border-color: #37ff37; }
  100% { border-color: #00d7ff; }
}

@keyframes alternanceCouleurTexte {
  0%   { color: #00d7ff; }
  33%  { color: #6060ff; }
  66%  { color: #37ff37; }
  100% { color: #00d7ff; }
}

.rotate-letter {
  display: inline-block;
  font-size: 5rem;
  animation: spin 2s linear infinite;
  transform-origin: 50% 28%;
}

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

/* -----------------------
   RESPONSIVE
------------------------ */

@media screen and (max-width: 1024px) {
  .HEAD {
    flex-direction: column !important;
    align-items: center !important;
    padding: 1rem;
    gap: 1rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .HEAD-left {
    width: 100% !important;
    max-width: 100% !important;
    order: 1;
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  .HEAD-right {
    order: 2;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    box-sizing: border-box !important;
  }

  .container {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .navigation,
  .main-content,
  .sidebar-right {
    width: 100%;
  }

  /* Réorganiser l'ordre pour unifier avec la version mobile */
  .main-content {
    order: 1;
  }

  .navigation {
    order: 2;
  }

  .sidebar-right {
    order: 3;
  }
}

@media screen and (max-width: 768px) {
  /* Forcer le HEAD en colonne sur mobile */
  .HEAD {
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Réorganiser l'ordre du HEAD : image en premier, puis titres */
  .HEAD-left {
    order: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 1rem !important;
    box-sizing: border-box !important;
  }

  .HEAD-right {
    order: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .HEAD-left img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
  }

  h1.mess {
    font-size: 64px;
    margin: 10px 0 !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  h1.terminal {
    font-size: 64px;
    margin-top: -78px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .navigation, .Pseudo, .horaire, .rituels {
    width: 100%;
    margin: 0 auto;
  }

  p, p.heure {
    font-size: 2em;
  }

  a.Pseudo {
    font-size: 5em;
    display: block;
  }

  h2.Pseudo {
    font-size: 2em;
    display: block;
  }

  img.rituels {
    width: 100%;
    height: auto;
  }
  img.vagabond {
    width: 100%;
    height: auto;
  }

  ul {
    padding-left: 0;
  }

  /* Favoris en blocs qui se suivent avec wrap sur mobile dans la sidebar */
  .navigation .bookmarks-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .navigation .bookmark-item {
    display: inline-block;
    width: auto;
    padding: 0px 0px;
    margin: 0;
    border: 2px solid #000;
    background-color: #fff;
    box-sizing: border-box;
  }

  .navigation .bookmark-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
  }

  .navigation .bookmark-link {
    display: inline-block;
    width: auto;
    padding: 4px 8px;
    margin: 0;
    white-space: nowrap;
    color: #000 !important;
  }

  .navigation .bookmark-item .separator {
    display: inline-block;
    width: auto;
    padding: 0;
    margin: 0;
    font-weight: bold;
    white-space: nowrap;
  }

  .navigation .btn-delete-bookmark {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
  }

  /* Assurer la visibilité des boutons dans la section WWW sur mobile */
  /* Si les boutons ont un fond blanc, le texte doit être noir pour être visible */
  .navigation #btn-add-bookmark,
  .navigation #toggle-edit-mode {
    color: #000 !important;
    background-color: transparent !important;
  }
}

/* -----------------------
   BOUTONS UNIFIÉS
------------------------ */

/* Style de base pour tous les boutons - Minimaliste */
button,
input[type="submit"],
input[type="button"] {
  font-family: 'Terminal', sans-serif;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: normal;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-sizing: border-box;
  padding: 8px 15px;
}

/* Bouton principal - Style discret */
.btn-primary,
button.btn-primary,
input[type="submit"].btn-primary,
.ip-container button:not(.btn-danger):not(.btn-secondary),
.btn-edit-mode,
.new-thread-form button[type="submit"],
#add-bookmark-panel button[type="submit"] {
  background: transparent;
  color: inherit;
  border: none;
  font-family: 'Terminal', sans-serif;
  font-weight: normal;
  padding: 8px 15px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.btn-primary:hover,
button.btn-primary:hover,
input[type="submit"].btn-primary:hover,
.ip-container button:not(.btn-danger):not(.btn-secondary):hover,
.btn-edit-mode:hover,
.new-thread-form button[type="submit"]:hover,
#add-bookmark-panel button[type="submit"]:hover {
  opacity: 1;
}

/* Bouton ajouter un thread - Style minimaliste */
#btn-add-thread {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  font-size: 1.5em !important;
  cursor: pointer !important;
  color: inherit !important;
  text-align: left !important;
  width: auto !important;
  margin: 0 !important;
  font-weight: normal !important;
  opacity: 1 !important;
}

/* Boutons avec fond coloré et bordure : Surf et Poster */
.navigation form input[type="submit"],
.btn-submit-post {
  font-weight: bold !important;
  opacity: 1 !important;
  transition: background-color 0.2s ease, color 0.2s ease;
  padding: 8px 15px !important;
}

/* Le style spécifique par thème est défini dans les sections de thème */
.btn-submit-post {
  background: transparent !important;
  border: none !important;
}

.btn-submit-post:hover {
  opacity: 1 !important;
}

/* Bouton danger - Style discret */
.btn-danger,
button.btn-danger,
.btn-delete-bookmark,
.btn-delete-thread,
.btn-delete-post,
.btn-close-panel {
  background: transparent;
  color: inherit;
  border: none;
  font-family: 'Terminal', sans-serif;
  font-weight: normal;
  cursor: pointer;
  transition: opacity 0.2s ease;
  opacity: 0.6;
}

.btn-danger:hover,
button.btn-danger:hover,
.btn-delete-bookmark:hover,
.btn-delete-thread:hover,
.btn-delete-post:hover,
.btn-close-panel:hover {
  opacity: 1;
}

/* Bouton secondaire - Style discret */
.btn-secondary,
button.btn-secondary,
input[type="button"].btn-secondary,
.new-thread-form button[type="button"],
#add-bookmark-panel button[type="button"] {
  background: transparent;
  color: inherit;
  border: none;
  font-family: 'Terminal', sans-serif;
  font-weight: normal;
  padding: 8px 15px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  opacity: 0.6;
}

.btn-secondary:hover,
button.btn-secondary:hover,
input[type="button"].btn-secondary:hover,
.new-thread-form button[type="button"]:hover,
#add-bookmark-panel button[type="button"]:hover {
  opacity: 1;
}

/* Tailles spéciales pour les boutons carrés/icônes */
.btn-icon,
.btn-delete-bookmark,
.btn-delete-thread,
.btn-delete-post,
.btn-close-panel,
.btn-edit-mode {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-delete-bookmark {
  width: 25px;
  height: 25px;
  font-size: 1.2em;
}

.btn-delete-thread,
.btn-delete-post,
.btn-close-panel {
  width: 24px;
  height: 24px;
  font-size: 1.2em;
}

.btn-edit-mode {
  padding: 5px 10px;
  font-size: 1.2em;
}

/* Boutons pleine largeur */
.btn-full-width {
  width: 100%;
}

/* -----------------------
   STYLES SPÉCIFIQUES POUR LA NAVIGATION
------------------------ */

.HEAD {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 3rem;
  padding: 20px 20px 0 20px;
  margin: 0 auto;
  text-align: left;
  max-width: 1024px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.HEAD-left {
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
}

.HEAD-left img {
  margin: 0;
  display: block;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.HEAD-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.HEAD img {
  margin-bottom: 0;
}

.navigation form {
  margin: 10px 0;
  display: flex;
  gap: 5px;
  align-items: center;
}

.navigation form input[type="text"] {
  flex: 1;
  padding: 8px;
  border: 2px solid #000;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
}

.navigation form input[type="submit"] {
  white-space: nowrap;
  font-family: 'Terminal', sans-serif;
}

.ip-container {
  padding: 10px;
  margin-top: 10px;
  border: 2px solid #000;
}

.ip-container button {
  margin-top: 10px;
}

.sidebar-image-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.separator {
  color: #000;
  font-weight: bold;
  margin: 0;
  display: block;
}

/* -----------------------
   BOOKMARK DRAG & DROP
------------------------ */

.bookmarks-list {
  list-style: none;
  padding: 0;
}

.bookmark-item {
  position: relative;
  padding: 0;
  margin: 0;
}

.bookmark-item.dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}

.bookmark-item.drag-over {
  border-top: 3px solid chartreuse;
  padding-top: 8px;
}

.bookmark-link {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  text-decoration: none;
  font-size: 1em;
  display: inline-block;
  width: calc(100% - 30px);
}

.btn-delete-bookmark {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}


#add-bookmark-panel-container {
  list-style: none !important;
  padding: 0 !important;
  margin: 10px 0 !important;
}

#add-bookmark-panel {
  background: #fff !important;
  padding: 15px !important;
  border: 2px solid #000 !important;
  box-sizing: border-box;
}

#add-bookmark-panel h4 {
  font-family: 'Terminal' !important;
  font-size: 1.2em !important;
  margin-top: 0 !important;
  margin-bottom: 15px !important;
  font-weight: bold !important;
  color: #000 !important;
}

#add-bookmark-panel input[type="text"] {
  font-family: 'Terminal' !important;
  font-size: 1em !important;
  padding: 10px !important;
  width: 100% !important;
  margin-bottom: 10px !important;
  border: 2px solid #000 !important;
  box-sizing: border-box !important;
  background: #fff !important;
  color: #000 !important;
}

#add-bookmark-panel input[type="text"]::placeholder {
  color: #666 !important;
  opacity: 1 !important;
}

#add-bookmark-panel label {
  font-family: 'Terminal' !important;
  font-size: 1em !important;
  color: #000 !important;
  display: flex !important;
  align-items: center !important;
  margin-bottom: 15px !important;
}

#add-bookmark-panel input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  margin-right: 8px !important;
  cursor: pointer !important;
}

/* Styles pour le mode édition */
.edit-mode .bookmark-item {
  cursor: move;
}

.edit-mode .bookmark-item:hover {
  background-color: rgba(0, 255, 0, 0.1);
}


.sidebar-right h2 {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: clamp(1.5em, 4vw, 2.5em);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.sidebar-right ul {
  list-style: none;
  padding: 0;
}

.sidebar-right ul li {
  margin: 8px 0;
}

.sidebar-right ul li a {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  text-decoration: none;
  font-size: 1em;
}

/* Styles identiques aux playlists pour les favoris dans la navigation (desktop) */
.navigation .bookmarks-list li.bookmark-item {
  margin: 0;
  padding: 0;
  position: relative;
}

.navigation .bookmark-link {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  text-decoration: none;
  font-size: 1em;
  width: auto;
  display: inline;
}

.navigation .bookmark-item .separator {
  margin: 0;
  display: block;
}

.thread-bonjour {
  font-family: 'Stitches', 'Terminal', sans-serif;
}

h2.albums {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 52px;
  font-weight: bold;
}

.clock-container {
  position: relative;
  width: 100%;
  min-height: 60vh;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 2.5rem 0 0 0;
  overflow: hidden;
  padding: 1rem 0;
}

.clock-background-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Mess', sans-serif;
  font-size: clamp(18em, 45vmin, 45em);
  font-weight: normal;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  white-space: nowrap;
  opacity: 1;
}

/* Utiliser les mêmes couleurs que h1.mess selon le thème */
body.morning .clock-background-letter { color: #00ff77; }
body.afternoon .clock-background-letter { color: #ff0000; }
body.evening .clock-background-letter { color: #000000; }
body.night .clock-background-letter { color: #ff0000; }

.clock-display {
  font-family: 'cube';
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  box-sizing: border-box;
}

.clock-display > * {
  text-align: center !important;
}

/* Variables CSS pour contrôler les tailles - Utilise vmin pour s'adapter au plus petit côté */
:root {
  --clock-dayname-size: clamp(1.5em, 3.5vmin, 3em);
  --clock-day-size: clamp(4.5em, 14vmin, 12em);
  --clock-month-size: clamp(1.5em, 4.5vmin, 3.2em);
  --clock-year-size: clamp(1.8em, 4.5vmin, 4.5em);
  --clock-time-size: clamp(1.8em, 4.5vmin, 4.5em);
}

.clock-dayname {
  font-family: 'bianzhidai_noBG-Cloud';
  font-size: var(--clock-dayname-size);
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  margin: 0 0 0.5rem 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: none;
  box-sizing: border-box;
}

/* Ajustement pour les écrans 4K et très grands écrans */
@media screen and (min-width: 2560px) {
  :root {
    --clock-dayname-size: clamp(1.5em, 3vmin, 3em);
    --clock-day-size: clamp(4.5em, 12vmin, 10em);
    --clock-month-size: clamp(1.5em, 4vmin, 3em);
    --clock-year-size: clamp(1.8em, 4vmin, 4em);
    --clock-time-size: clamp(1.8em, 4vmin, 4em);
  }
}

/* Ajustement spécifique pour les écrans ultra-larges (3440px+) */
@media screen and (min-width: 3440px) {
  :root {
    --clock-dayname-size: clamp(1.5em, 2.5vmin, 2.5em);
    --clock-day-size: clamp(4.5em, 10vmin, 9em);
    --clock-month-size: clamp(1.5em, 3.5vmin, 2.5em);
    --clock-year-size: clamp(1.8em, 3.5vmin, 3.5em);
    --clock-time-size: clamp(1.8em, 3.5vmin, 3.5em);
  }
  
  .clock-background-letter {
    font-size: clamp(18em, 35vmin, 35em);
  }
}

.clock-day {
  font-family: 'cube';
  font-size: var(--clock-day-size);
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  margin: 0 0 0.5rem 0;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
}

.clock-month {
  font-family: 'cube';
  font-size: var(--clock-month-size);
  width: 100%;
  max-width: 100%;
  display: block;
  text-align: center;
  margin: 0 0 0.5rem 0;
  padding: 0;
  line-height: 1;
  box-sizing: border-box;
}

.clock-year {
  font-family: 'cube';
  font-size: var(--clock-year-size);
  width: 100%;
  max-width: 100%;
  display: block;
  margin: 0 0 0.5rem 0;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
}

.clock-time {
  font-family: 'cube';
  font-size: var(--clock-time-size);
  width: 100%;
  max-width: 100%;
  display: block;
  margin: 0;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
}

.day-info {
  font-family: 'cube';
  font-size: var(--clock-month-size);
  width: 100%;
  display: block;
  margin: 1rem 0 0 0;
  padding: 0;
  text-align: left;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* -----------------------
   BOARD STYLES
------------------------ */

.board-container {
  margin-bottom: 2rem;
}

.board-header {
  margin-bottom: 10px;
}

.board-header > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.threads-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.thread-item {
  margin-bottom: 10px;
  position: relative;
  transition: background-color 0.2s;
}

.thread-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.thread-item.dragging {
  opacity: 0.5;
  cursor: grabbing !important;
}

.thread-item.drag-over {
  border-top: 3px solid chartreuse;
  padding-top: 8px;
}

.thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
  position: relative;
  margin: 2px 0;
  gap: 8px;
}

/* En mode édition, le header n'est plus cliquable pour ouvrir/fermer */
.edit-mode .thread-header {
  cursor: move;
}

.thread-title {
  flex: 1;
  font-family: 'bianzhidai_noBG-Cloud', sans-serif !important;
  font-size: 2em;
  font-weight: bold;
  padding-right: 8px;
}

.thread-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-delete-thread {
  margin: 0;
}

.thread-content {
  padding: 10px;
  max-height: 500px;
  overflow-y: auto;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: visible;
  min-width: 0;
}

.posts-container {
  margin-bottom: 15px;
}

.post-item {
  margin-bottom: 10px;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  overflow: visible;
  position: relative;
}

.post-content {
  flex: 1;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 0.9em;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  min-width: 0;
  overflow: visible;
  padding-right: 8px;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-delete-post {
  margin: 0;
}

.post-content a {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  display: inline;
}

.post-form {
  margin-top: 10px;
}

.post-input {
  width: 100%;
  padding: 8px;
  border: 2px solid #000;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 0.9em;
  resize: vertical;
  margin-bottom: 5px;
  box-sizing: border-box;
}

.btn-submit-post {
  padding: 10px;
  font-size: 1em;
  width: 100%;
  font-family: 'Terminal', sans-serif;
  cursor: pointer;
}

/* Panneau de création de thread intégré */
.new-thread-panel {
  margin-bottom: 15px;
  padding: 10px;
}

.new-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-right: 32px;
  position: relative;
}

.btn-close-panel {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}

.new-thread-header h3 {
  margin: 0;
  font-family: 'cube';
  font-size: 1.2em;
}


.new-thread-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-thread-form input[type="text"],
.new-thread-form textarea {
  width: 100%;
  padding: 8px;
  border: 2px solid #000;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 1em;
  box-sizing: border-box;
}

.new-thread-form textarea {
  resize: vertical;
  min-height: 80px;
}

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

.new-thread-form button {
  flex: 1;
  font-size: 1em;
}

/* Styles pour le mode édition des threads */
.edit-mode .thread-item {
  cursor: move;
}

.edit-mode .thread-item:hover {
  background-color: rgba(0, 255, 0, 0.1);
}

/* -----------------------
   PLAYLIST PANEL STYLES
------------------------ */

.playlist-container {
  margin-bottom: 2rem;
}

.playlist-header {
  margin-bottom: 10px;
}

.playlist-bookmarks-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.playlist-bookmarks-list .bookmark-item {
  position: relative;
  padding: 0;
  margin: 8px 0;
}

/* Panneau de création de bookmark pour la playlist */
.new-playlist-bookmark-panel {
  margin-bottom: 15px;
  padding: 10px;
}

.new-playlist-bookmark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-right: 32px;
  position: relative;
}

.new-playlist-bookmark-header h3 {
  margin: 0;
  font-family: 'cube';
  font-size: 1.2em;
}

.new-playlist-bookmark-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.new-playlist-bookmark-form input[type="text"] {
  width: 100%;
  padding: 8px;
  border: 2px solid #000;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 1em;
  box-sizing: border-box;
}

.new-playlist-bookmark-buttons {
  display: flex;
  gap: 10px;
}

.new-playlist-bookmark-form button {
  flex: 1;
  font-size: 1em;
}

/* Theme-specific board styles */

/* Board bio text styles */
.board-bio-text {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 256px;
  font-weight: bold;
  line-height: 1.1;
}

/* Board bio text colors for each theme */
body.morning .board-bio-text {
  color: #000000;
}

body.afternoon .board-bio-text {
  color: #222222;
}

body.evening .board-bio-text {
  color: #ffffff;
}

body.night .board-bio-text {
  color: #ffffff;
}

/* -----------------------
   BOARD GALLERY STYLES
------------------------ */

/* Board gallery cards */
.board-gallery-panel {
  margin-top: 20px;
  margin-bottom: 2rem;
}

.board-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.board-gallery-title {
  margin: 0;
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  font-size: 52px;
  font-weight: bold;
  width: 100%;
  position: relative;
}

.board-gallery-add-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: 2px solid black;
  color: black;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  transition: all 0.2s ease;
}

.board-gallery-add-btn:hover {
  background: black;
  color: white;
  border-color: white;
}

body.night .board-gallery-add-btn,
body.evening .board-gallery-add-btn {
  background: white;
  border: 2px solid black;
  color: black;
}

body.night .board-gallery-add-btn:hover,
body.evening .board-gallery-add-btn:hover {
  background: black;
  color: white;
  border-color: white;
}

.board-gallery-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.board-gallery-header-actions button {
  color: inherit;
}

.board-entry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.board-entry-card {
  border: none;
  border-radius: 0;
  padding: 12px;
  display: flex !important;
  flex-direction: row !important;
  gap: 15px;
  background: rgba(255, 255, 255, 0.08);
  align-items: flex-start;
}

body.night .board-entry-card,
body.evening .board-entry-card {
  border: none;
  background: rgba(0, 0, 0, 0.35);
}

.board-entry-image {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  order: 2;
  margin-right: 10px;
}

.board-entry-image img {
  width: 100%;
  border-radius: 0;
  object-fit: contain;
  max-height: none;
  height: auto;
  border: none;
}

body.night .board-entry-image img,
body.evening .board-entry-image img {
  border: none;
}

.board-entry-text {
  flex: 0 0 50%;
  width: 50%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  order: 1;
}

.board-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75em;
  opacity: 0.8;
}

.board-entry-category {
  font-family: 'Terminal', 'Courier New', 'Courier', monospace;
  letter-spacing: 0.1em;
}

.board-entry-title {
  margin: 0;
  font-size: 1.1em;
  font-family: 'cube';
}

.board-entry-content {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
  white-space: pre-wrap;
}

.board-entry-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.btn-delete-entry {
  background: none;
  border: 1px solid currentColor;
  padding: 6px 10px;
  cursor: pointer;
}
