/**
 * Styles pour le système de commentaires amélioré
 * Style réseau social pour Black Orion Theme
 */
.emoji-mart-container {
  margin: 0 !important;
  padding: 0 !important;
}
.emoji-mart {
  transform: none !important;
  left: 0 !important;
  top: 0 !important;
}
.deleted-comment-wrapper {
  padding: 1em;
  margin: .5em 0;
  background-color: #1A1A1A;
  border-left: 4px solid var(--color-gold-dark, #B8860B); /* Using darker gold for deleted comments */
  border-radius: 4px;
  color: #E6E6E6;
  font-style: italic;
}
.deleted-comment-title {
  font-weight: bold;
  color: var(--color-gold-dark, #B8860B);
  margin-bottom: .3em;
}
.deleted-comment-text {
  margin: 0;
}

/* Conteneur principal des commentaires */
.project-comments-section {
    margin: 40px 0;
}

.project-comments-container {
    max-width: 1200px;
    margin: 0 auto;
}

.project-comments-card {
    background-color: var(--color-black-dark, #0A0A0A);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    overflow: visible;
    width: 100%;
    margin: 0 auto;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid rgba(212, 160, 23, 0.2);
}

.card-header .section-title {
    margin: 0;
    color: var(--color-white, #FFFFFF);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
}

.card-header .section-title i {
    margin-right: 10px;
    color: var(--color-gold-primary, #FFD700);
}

.card-body {
    padding: 20px;
}

/* Formulaire de commentaire (principal et inline) */
.custom-comment-form,
.inline-reply-form,
.edit-comment-form {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(10, 10, 10, 0.8);
    border-radius: 8px;
}

.inline-reply-form,
.edit-comment-form {
    margin-top: 15px;
    width: 100%;
    min-width: 300px;
    max-width: 600px;
    box-sizing: border-box;
}

.comment-form-title {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--color-white, #FFFFFF);
    font-size: 1.4rem;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #E6E6E6;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: 5px;
    background-color: #1A1A1A;
    color: var(--color-white, #FFFFFF);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--color-gold-primary, #FFD700);
    outline: none;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-submit-comment {
    padding: 8px 20px;
    background-color: var(--color-gold-primary, #FFD700);
    color: var(--color-black-dark, #0A0A0A);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-submit-comment:hover {
    background-color: var(--color-gold-medium, #D4A017);
}

.btn-cancel-reply {
    padding: 8px 20px;
    background-color: rgba(10, 10, 10, 0.8);
    color: #E0E0E0;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-reply:hover {
    background-color: rgba(10, 10, 10, 1);
}

/* Message de connexion pour utilisateurs non connectés */
.login-to-comment {
    padding: 20px;
    background-color: rgba(10, 10, 10, 0.8);
    border-radius: 8px;
    text-align: center;
    margin-bottom: 30px;
}

.login-to-comment p {
    color: #E6E6E6;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.btn-login {
    display: inline-block;
    padding: 10px 25px;
    background-color: var(--color-gold-primary, #FFD700);
    color: var(--color-black-dark, #0A0A0A);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-login:hover {
    background-color: var(--color-gold-medium, #D4A017);
}

/* Conteneur principal des commentaires */
.custom-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

/* Appliquer un layout similaire aux replies à l’intérieur du premier commentaire */
.comment-item .comment-avatar {
    float: left;
    margin-right: 15px;
}

.comment-item .comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-item .comment-content {
    overflow: hidden;
}

/* Styles communs pour les commentaires et réponses */
.comment-item,
.reply-item {
    background-color: rgba(10, 10, 10, 0.8);
    padding: 15px;
    border-radius: 8px;
}

/* Réponse individuelle */
.reply-item {
    display: flex;
    background-color: rgba(10, 10, 10, 0.8);
    padding: 12px;
    border-radius: 8px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/* Ligne verticale pour indiquer la hiérarchie */
.comment-item::before,
.reply-item::before {
    content: '';
    position: absolute;
    left: 0px;
    top: 0;
    height: 100%;
    width: 2px;
}

/* Couleurs pour chaque niveau, using gold shades for hierarchy */
.reply-item.depth-1::before {
    background-color: rgba(255, 215, 0, 0.5);
}
.reply-item.depth-2::before {
    background-color: rgba(212, 160, 23, 0.5);
}
.reply-item.depth-3::before {
    background-color: rgba(184, 134, 11, 0.5);
}
.reply-item.depth-4::before {
    background-color: rgba(255, 215, 0, 0.3);
}
.reply-item.depth-5::before {
    background-color: rgba(212, 160, 23, 0.3);
}
.reply-item.depth-6::before {
    background-color: rgba(184, 134, 11, 0.3);
}
.reply-item.depth-7::before {
    background-color: rgba(255, 215, 0, 0.2);
}
.reply-item.depth-8::before {
    background-color: rgba(212, 160, 23, 0.2);
}
.reply-item.depth-9::before {
    background-color: rgba(184, 134, 11, 0.2);
}
.reply-item.depth-10::before {
    background-color: rgba(255, 215, 0, 0.1);
}

.reply-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Indicateur "Réponse à" pour depth 3+ */
.reply-to {
    font-size: 12px;
    color: var(--color-white, #FFFFFF);
    margin-bottom: 22px;
    margin-left: 20px;
    font-style: italic;
}

/* Avatar (commun pour commentaires et réponses) */
.comment-avatar,
.reply-avatar {
    flex-shrink: 0;
}

/* Avatar et contenu */
.comment-avatar img,
.reply-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.comment-avatar img {
    width: 50px;
    height: 50px;
}

.reply-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* Contenu (commun pour commentaires et réponses) */
.comment-content,
.reply-content {
    flex: 1;
}

/* En-tête (commun pour commentaires et réponses) */
.comment-header,
.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.comment-author,
.reply-author {
    font-weight: 600;
    color: var(--color-gold-primary, #FFD700);
    font-size: 1.1rem;
}

.reply-author {
    font-size: 1rem;
    margin-left: 13px;
}

.reply-to::before {
    display: inline-block;
    margin-right: 6px;
    color: var(--color-gold-primary, #FFD700);
    font-weight: bold;
    transform: translateY(1px);
}

.comment-date,
.reply-date {
    color: var(--color-gold-primary, #FFD700);
    font-size: 0.9rem;
    margin-right: 12px;
}

.reply-date {
    font-size: 0.85rem;
}

/* Texte (commun pour commentaires et réponses) */
.comment-text,
.reply-text {
    color: var(--color-white, #FFFFFF);
    margin-bottom: 15px;
    line-height: 1.5;
}

.reply-text {
    font-size: 0.95rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Pied de page (commun pour commentaires et réponses) */
.comment-footer,
.reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

/* Actions (commun pour commentaires et réponses) */
.comment-actions,
.reply-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 13px;
}

.btn-reply,
.btn-edit-comment,
.btn-delete-comment {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-white, #FFFFFF);
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reply:hover,
.btn-edit-comment:hover {
    background-color: rgba(212, 160, 23, 0.2);
}

.btn-delete-comment:hover {
    background-color: var(--color-gold-dark, #B8860B);
}

/* Réactions (commun pour commentaires et réponses) */
.comment-reactions,
.reply-reactions {
    display: flex;
    gap: 10px;
    margin-bottom: 13px;
}

.btn-reaction {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-white, #FFFFFF);
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reaction:hover {
    color: var(--color-gold-primary, #FFD700);
}

.btn-reaction.active[data-reaction="like"] {
    color: var(--color-gold-primary, #FFD700);
}

.btn-reaction.active[data-reaction="dislike"] {
    color: var(--color-gold-dark, #B8860B); /* Using darker gold for dislike */
}

.btn-reaction.active[data-reaction="heart"] {
    color: #FF00A7; /* Retaining pink for heart to keep it intuitive */
}

/* Bouton pour charger plus de réponses */
.load-more-replies {
    margin-top: 10px;
    margin-left: 20px;
    text-align: left;
}

/* Formulaire inline */
.inline-reply-form {
    margin-top: 10px;
    background-color: rgba(10, 10, 10, 0.8);
    padding: 15px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

/* Ne pas imbriquer avec décalage */
.comment-replies .comment-replies {
    margin-right: -10px;
    margin-left: -31px;
    margin-bottom: 5px;
}

/* Réduire légèrement les avatars pour les réponses imbriquées */
.reply-item.depth-2 .reply-avatar img,
.reply-item.depth-3 .reply-avatar img {
    width: 35px;
    height: 35px;
}

/* Indicateur visuel de profondeur avec des couleurs */
.reply-item.depth-1 {
    background-color: #1A1A1A;
}
.reply-item.depth-2 {
    background-color: #202020;
}
.reply-item.depth-3 {
    background-color: #262626;
}
.reply-item.depth-4 {
    background-color: #2C2C2C;
}
.reply-item.depth-5 {
    background-color: #323232;
}
.reply-item.depth-6 {
    background-color: #383838;
}
.reply-item.depth-7 {
    background-color: #3E3E3E;
}
.reply-item.depth-8 {
    background-color: #444444;
}
.reply-item.depth-9 {
    background-color: #4A4A4A;
}
.reply-item.depth-10 {
    background-color: #505050;
}

.btn-load-more {
    background-color: transparent;
    border: 1px solid rgba(212, 160, 23, 0.2);
    color: #E6E6E6;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-load-more:hover {
    background-color: rgba(212, 160, 23, 0.2);
    color: var(--color-white, #FFFFFF);
}

/* Toggle des sous-réponses */
.sub-replies-toggle {
    margin-bottom: 10px;
}

.show-sub-replies {
    color: var(--color-gold-primary, #FFD700);
    text-decoration: none;
}

.show-sub-replies:hover {
    text-decoration: underline;
}

/* Emoji picker */
.comment-emoji-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 10px;
}

.emoji-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: rgba(10, 10, 10, 0.8);
    color: #E0E0E0;
    border: none;
    border-radius: 5px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emoji-toggle:hover {
    background-color: rgba(212, 160, 23, 0.2);
}

.emoji-picker {
    display: none;
    z-index: 10;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    background-color: rgba(10, 10, 10, 0.8);
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    max-width: 100%;
}

.emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
}

.emoji-item:hover {
    background-color: rgba(212, 160, 23, 0.2);
}

/* Message quand il n'y a pas de commentaires */
.no-comments {
    text-align: center;
    padding: 30px;
    color: #E0E0E0;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(-10px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}
a.btn-login.black-orion-login-link {
    text-decoration: none; /* enlève le soulignement */
}

a.btn-login.black-orion-login-link:hover,
a.btn-login.black-orion-login-link:focus {
    color: #ffd700; /* couleur au survol, ex : jaune/or */
    text-decoration: none;
}
/* --- Responsive comment thread cleanup --- */
@media (max-width: 768px) {
    .comment-item,
    .reply-item {
        flex-direction: column !important;
        align-items: flex-start;
        padding: 12px;
    }
    /* Masquer complètement le toggle et la toolbar émojis */
    button.emoji-toggle,
    button#emojiToggle,
    button[id^="inlineEmojiToggle"],
    .comment-emoji-toolbar,
    .emoji-picker {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .comment-avatar,
    .reply-avatar {
        margin: 0 0 10px 0;
    }
    .comment-header,
    .reply-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .comment-date,
    .reply-date {
        margin: 0;
        font-size: 0.8rem;
    }
    .reply-to {
        margin-left: 0;
        font-size: 0.75rem;
        margin-bottom: 10px;
    }
    .comment-text,
    .reply-text {
        font-size: 0.95rem;
    }
    .comment-actions,
    .reply-actions,
    .comment-reactions,
    .reply-reactions {
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 10px;
    }
    .comment-footer,
    .reply-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    /* Suppression des lignes de profondeur */
    .reply-item::before {
        display: none;
    }
    /* Annulation de l’indentation */
    .comment-replies {
        margin-left: 0 !important;
        padding-left: 0 !important;
    }
    .reply-item {
        margin-left: 0 !important;
        padding-left: 3px;
        border-left: 4px solid rgba(255, 255, 255, 0.08);
    }
    /* Taille avatar responsive */
    .comment-avatar img,
    .reply-avatar img {
        width: 40px;
        height: 40px;
    }
    /* Formulaire */
    .inline-reply-form,
    .edit-comment-form,
    .custom-comment-form {
        padding: 15px;
    }
    .form-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .btn-submit-comment,
    .btn-cancel-reply {
        width: 100%;
    }
    /* Emoji picker responsive */
    .emoji-picker {
        grid-template-columns: repeat(6, 1fr);
        padding: 8px;
    }
    .comment-item .comment-content {
        overflow: inherit;
    }
}