/* css/components/interactions.css */

/* --- Section Interactions dans le lecteur --- */
.chapter-interactions-container {
  padding: 0;
  margin-top: 0.5rem;
}

.reader-controls-sidebar .chapter-interactions-container {
  padding-top: 1.5rem;
}

#reader-viewer-container + .chapter-interactions-container {
  padding: 1.5rem 5%;
  background-color: var(--clr-bg-card-dark);
}

.chapter-like-button {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 8px;
  border: 2px solid #5d5d5f;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--clr-text-sub-dark);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.5rem;
}

.chapter-like-button .fa-heart {
  margin-right: 0.5rem;
  color: inherit;
}

.chapter-like-button:hover {
  border-color: var(--clr-text-sub);
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--clr-text-sub);
}

.chapter-like-button.liked {
  border-color: #ff4757;
  background-color: rgba(255, 71, 87, 0.1);
  color: #ff4757;
}

/* --- Section des commentaires --- */
.comments-section {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

/* NOUVEAU : Styles pour le floutage des spoilers */
.comments-section.spoiler-hidden::before {
  content: "Afficher les commentaires (Risque de spoil)";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(21, 23, 26, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-weight: 600;
  color: var(--clr-text-dark);
  cursor: pointer;
  z-index: 2;
  padding: 1rem;
}

.comments-section.spoiler-hidden .comments-section-header,
.comments-section.spoiler-hidden .comment-form,
.comments-section.spoiler-hidden .comment-list {
  filter: blur(8px);
  pointer-events: none;
}
/* FIN NOUVEAU */

.comments-section-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--clr-text-sub-dark);
  padding-bottom: 0.5rem;
}

.comment-form textarea {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  padding: 0.8rem;
  border-radius: 6px;
  border: 1px solid #5d5d5f;
  background-color: rgba(0, 0, 0, 0.2);
  color: var(--clr-text-dark);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.comment-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.comment-form-actions button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.comment-form-actions button[type="submit"] {
  background-color: var(--clr-primary-dark);
  color: #fff;
}

.comment-form-actions .chapter-like-button {
  width: auto;
  margin-bottom: 0;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}

.comment-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-form p.form-message {
  font-size: 0.85rem;
  color: var(--clr-text-sub-dark);
  margin-top: 0.3rem;
  text-align: left;
}

.comment-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-item {
  display: flex;
  gap: 0.8rem;
}

/* MODIFIÉ : Le conteneur .comment-avatar peut maintenant contenir une image */
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--clr-primary-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  /* NOUVEAU : Styles pour quand c'est une image */
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.comment-content {
  flex-grow: 1;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.comment-username {
  font-weight: 700;
  color: var(--clr-text-dark);
}

.comment-timestamp {
  font-size: 0.75rem;
  color: var(--clr-text-sub-dark);
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  margin-top: 0.5rem;
}

.comment-like-button {
  background: none;
  border: none;
  color: var(--clr-text-sub-dark);
  cursor: pointer;
  font-size: 0.8rem;
}

.comment-like-button .fa-heart {
  margin-right: 0.3rem;
}

.comment-like-button.liked {
  color: #ff4757;
}
