/* --- Forum général --- */
.forum-main {
  background: #23273a;
  min-height: 92vh;
  padding: 40px 0 60px 0;
}

.forum-post-section {
  max-width: 600px;
  margin: 0 auto 32px auto;
  background: #181a29;
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(40,40,70,0.12);
  padding: 28px 22px 22px 22px;
  color: #fff;
}
.forum-post-section h2 {
  color: #ffa500;
  margin-bottom: 13px;
  font-size: 1.2em;
}
#post-form textarea {
  width: 100%;
  border-radius: 9px;
  padding: 12px;
  border: 1px solid #f3e5c5;
  resize: vertical;
  font-size: 1.04em;
  background: #fffbe6;
  color: #2b2b2b;
  margin-bottom: 12px;
  min-height: 66px;
  box-sizing: border-box; /* <-- Ajoute ça pour forcer le padding à être bien compté ! */
}
.post-form-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.post-img-upload input[type="file"] {
  display: none;
}
.post-img-upload span {
  background: #ffa500;
  color: #fff;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 0.97em;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 2px 8px #ffc9b459;
  transition: background .18s;
}
.post-img-upload span:hover {
  background: #ff6700;
}
#post-image-preview img {
  display: block;
  max-width: 90px;
  max-height: 80px;
  margin: 11px 0 0 0;
  border-radius: 7px;
  box-shadow: 0 1px 5px #0002;
}

/* --- Feed --- */
.forum-feed-section {
  max-width: 730px;
  margin: 0 auto;
  background: #181a29;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(40,40,70,0.15);
  padding: 30px 22px 25px 22px;
  color: #fff;
}
.forum-feed-section h2 {
  color: #ffa500;
  font-size: 1.18em;
  margin-bottom: 20px;
}
.forum-post-card {
  background: #fffbe6;
  color: #23273a;
  border-radius: 11px;
  margin-bottom: 28px;
  box-shadow: 0 2px 12px #ff670011;
  padding: 18px 13px 13px 13px;
  position: relative;
  overflow: hidden;
  transition: box-shadow .19s;
}
.forum-post-card .forum-post-header {
  display: flex;
  align-items: center;
  margin-bottom: 9px;
}
.forum-post-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 9px;
  border: 2px solid #ffa500;
  background: #fff;
}
.forum-post-user {
  font-weight: bold;
  font-size: 1.04em;
  margin-right: 8px;
}
.forum-post-date {
  font-size: 0.89em;
  color: #ff9100;
  opacity: .8;
}
.forum-post-img {
  display: block;
  max-width: 210px;
  max-height: 160px;
  margin: 10px 0;
  border-radius: 8px;
  box-shadow: 0 2px 9px #0001;
}
.forum-post-content {
  font-size: 1.07em;
  margin-bottom: 6px;
  white-space: pre-line;
  text-align: center; /* centrage horizontal du texte */
}

.forum-comment-list {
  margin-top: 13px;
  padding-left: 0;
  list-style: none;
}
.forum-comment {
  background: #fff3cd;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 0.98em;
  color: #2b2b2b;
  position: relative;
  box-shadow: 0 1px 3px #0001;
}
.forum-comment-user {
  font-weight: bold;
  color: #d17800;
}
.forum-comment-date {
  color: #666;
  font-size: 0.86em;
  margin-left: 7px;
}
.forum-comment-form {
  margin-top: 7px;
  display: flex;
  align-items: flex-end;
  gap: 8px;

  position: relative;
  overflow: visible; /* Ajoute ça si nécessaire */
}
.forum-comment-form textarea {
  flex: 1;
  resize: none;
  border-radius: 7px;
  padding: 8px;
  min-height: 34px;
  max-height: 100px;
  font-size: .99em;
}
.forum-comment-form button {
  background: #ffa500;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 6px 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s;
}
.forum-comment-form button:hover {
  background: #ff6700;
}

.forum-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: #ff6700;
  font-size: 1.16em;
  font-weight: 500;
  cursor: pointer;
  transition: color .17s, transform .14s;
  outline: none;
  padding: 2px 0 2px 0;
  user-select: none;
}

.forum-like-btn .like-icon {
  font-size: 1.4em;
  line-height: 1;
  transition: color .19s, filter .19s;
  /* Animation scale on click/active */
}

.forum-like-btn .like-count {
  font-size: 0.99em;
  margin-left: 3px;
}
.forum-like-btn.liked .like-icon {
  color: #ff2200;
  filter: drop-shadow(0 2px 7px #ffb47866);
}
.forum-like-btn.liked {
  color: #ffa500;
}
.forum-like-btn:active .like-icon {
  transform: scale(1.25);
}

/* Ajoute un hover sympa */
.forum-like-btn:hover .like-icon {
  filter: brightness(1.2) drop-shadow(0 1px 3px #ffb47855);
  transform: scale(1.15);
}

.forum-like-btn.liked {
  color: #ffa500;
}
.forum-post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 2px;
  min-height: 28px;
}
.forum-delete-btn, .forum-comment-delete-btn {
  background: #ff2f2f;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 3px 11px 3px 9px;
  font-size: 0.97em;
  cursor: pointer;
  margin-left: 3px;
  transition: background .17s;
}
.forum-delete-btn:hover, .forum-comment-delete-btn:hover {
  background: #b40000;
}
.forum-comment-avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 7px;
  border: 2px solid #ffa500;
  background: #fff;
  vertical-align: middle;
}
.forum-comment-user-block {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}

.emoji-btn {
  background: none;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  transition: transform 0.13s;
  margin-left: 2px;
  padding: 0 4px;
}
.emoji-btn:hover {
  transform: scale(1.16);
}
.post-form-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}
#post-content { flex: 1; }

.emoji-btn, .emojis-list, .picker-wrap, .forum-post-content, .forum-comment, textarea, input {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "NotoColorEmoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "Segoe UI Symbol", "Segoe UI", "Arial", sans-serif !important;
}




.forum-post-img,
.gallery-preview img {
  display: block;
  width: 100%;
  max-width: 600px;      /* Ajuste à la largeur de ta carte, ex : 100% ou 600px max */
  max-height: 400px;     /* Pour éviter qu’une image verticale soit trop grande */
  height: auto;
  object-fit: contain;   /* Pour ne jamais rogner l’image */
  margin: 0 auto 15px auto; /* Centrée, un peu d’espace en bas */
  border-radius: 10px;   /* Facultatif pour le look “Facebook” */
  box-shadow: 0 2px 12px #0001; /* Facultatif pour un léger effet */
  background: none;      /* PAS de background ! */
}


/*-------------------------------------------------------*/

emoji-picker {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 9999;
  position: absolute;
}

emoji-picker.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

emoji-picker .arrow {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

emoji-picker.visible .arrow {
  opacity: 1;
  transform: scale(1);
}



/*-------------------------------------------------------*/
/* Custom confirm dialog */

.custom-confirm {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.confirm-box {
  background: #fff;
  padding: 22px 26px;
  border-radius: 12px;
  box-shadow: 0 6px 22px #0003;
  max-width: 340px;
  width: 90%;
  text-align: center;
  font-size: 1em;
  color: #2b2b2b;
}
.confirm-actions {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
}
.confirm-actions button {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.95em;
}
#confirm-cancel {
  background: #ccc;
}
#confirm-ok {
  background: #ff2f2f;
  color: white;
}
#confirm-ok:hover {
  background: #b40000;
}

/*-------------------------------------------------------*/

#confirm-dialog {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 5, 10, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  padding: 10px;
}

#confirm-dialog .confirm-box {
  background: #1a1c2e;
  color: #fffbe6;
  padding: 24px 20px;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 6px 26px rgba(255,165,0,0.18);
  text-align: center;
  font-size: 1.05em;
  border: 2px solid #ffa50099;
  animation: pop-in 0.25s ease;
  position: relative;
}

#confirm-dialog .confirm-box::before {
  content: "⚠️";
  font-size: 2.1em;
  display: block;
  margin-bottom: 10px;
}

#confirm-dialog .confirm-buttons {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

#confirm-dialog button {
  flex: 1;
  min-width: 100px;
  max-width: 140px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

#confirm-ok {
  background-color: #ff4500;
  color: #fff;
}
#confirm-ok:hover {
  background-color: #c13d00;
  transform: scale(1.06);
}

#confirm-cancel {
  background-color: #444;
  color: #ccc;
}
#confirm-cancel:hover {
  background-color: #666;
  color: #fff;
  transform: scale(1.05);
}

@keyframes pop-in {
  from {
    transform: scale(0.88);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}


/*-------------------------------------------------------*/




@media (max-width: 700px) {
  .gallery-preview img {
    width: 98vw;
    height: 130px;
    border-radius: 10px;
  }
}



.gallery-preview img:hover {
  transform: scale(1.10);
  box-shadow: 0 8px 32px #ffa50055;
}

@media (max-width: 700px) {
  .gallery-preview img {
    max-width: 48vw;
    max-height: 85px;
  }
}
@media (max-width: 500px) {
  .gallery-preview img {
    max-width: 90vw;
    max-height: 66vw;
  }
}


/* Responsive */
@media (max-width: 800px) {
  .forum-main,
  .forum-feed-section,
  .forum-post-section {
    padding-left: 3vw;
    padding-right: 3vw;
  }
}
@media (max-width: 500px) {
  .forum-post-section, .forum-feed-section {
    padding: 12px 3vw 10px 3vw;
    border-radius: 10px;
  }
  .forum-post-avatar { width: 32px; height: 32px; }
  .forum-post-card { padding: 12px 6px 8px 6px; }
}


@media (max-width: 500px) {
  emoji-picker {
    left: 50% !important;
    transform: translateX(-50%) scale(0.95);
    width: 92vw !important;
  }

  emoji-picker.visible {
    transform: translateX(-50%) scale(1);
  }
}
