/* --- COMMENTAIRES.CSS : Style Premium "Once Human" (Final V10) --- */

/* 1. CONFIGURATION GLOBALE */
.commentaires-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    font-family: 'h73light', sans-serif;
    color: #e0e0e0;
}

/* 2. FORMULAIRE FLOTTANT */
.commentaire-form-container {
    background: rgba(10, 15, 20, 0.6);
    border: 1px solid rgba(104, 253, 214, 0.1);
    border-radius: 4px;
    padding: 20px;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    margin-bottom: 10px;
    position: relative;
}

.commentaire-form-container:focus-within {
    background: rgba(10, 15, 20, 0.9);
    border-color: rgba(104, 253, 214, 0.3);
    box-shadow: 0 0 20px rgba(104, 253, 214, 0.05);
}

.textarea-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.commentaire-input {
    width: 100%;
    min-height: 40px;
    max-height: 300px;
    background: transparent;
    border: none; 
    color: #fff;
    font-family: 'h73light', sans-serif;
    font-size: 1rem;
    padding: 10px 15px;
    resize: none; 
    overflow-y: hidden;
    line-height: 1.5;
    box-sizing: border-box;
    display: block;
    text-align: left;
}

.commentaire-input:focus { outline: none; }
.commentaire-input::placeholder { color: rgba(255, 255, 255, 0.3); font-style: italic; }

/* --- EFFET SCANNER "DATA STREAM" (STYLE SIDEBAR) --- */
.focus-line {
    height: 2px;
    width: 0%; /* Invisible par défaut */
    position: absolute;
    bottom: -1px;
    left: 0;
    z-index: 5;
    opacity: 0;
    transition: width 0.2s ease-out, opacity 0.2s;

    /* Le même dégradé que la sidebar, mais orienté vers la droite */
    background: linear-gradient(to right, 
        transparent 0%, 
        rgba(104, 253, 214, 0) 30%,
        rgba(104, 253, 214, 1) 50%, /* Coeur brillant */
        rgba(104, 253, 214, 0) 70%,
        transparent 100%
    );
    
    /* Taille double pour permettre le mouvement */
    background-size: 200% 100%;
    
    /* Petit glow pour accentuer l'effet énergie */
    box-shadow: 0 0 8px rgba(104, 253, 214, 0.6);
}

.commentaire-input:focus + .focus-line { 
    width: 100%;
    opacity: 1;
    /* Animation Aller-Retour fluide comme la sidebar */
    animation: scanLine 4s ease-in-out infinite; 
}

@keyframes scanLine {
    0% { background-position: 0% 0%; }    /* Gauche */
    50% { background-position: 100% 0%; } /* Droite */
    100% { background-position: 0% 0%; }  /* Gauche */
}

/* --- BOUTONS FORMULAIRE --- */
.form-actions, .edit-comment-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px; /* Espace entre Annuler et Envoyer */
    opacity: 0.9;
    transition: opacity 0.3s;
}
.commentaire-form-container:focus-within .form-actions { opacity: 1; }

/* BOUTON PUBLIER / ENREGISTRER */
.btn-submit-premium {
    background: rgba(104, 253, 214, 0.05);
    border: 1px solid #68fdd6;
    color: #68fdd6;
    padding: 8px 25px;
    border-radius: 4px;
    font-family: 'h73bold', sans-serif;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 5px rgba(104, 253, 214, 0.1); 
}
.btn-submit-premium:hover {
    background: #68fdd6;
    color: #000;
    box-shadow: 0 0 15px rgba(104, 253, 214, 0.4);
    transform: translateY(-1px);
}

/* NOUVEAU : BOUTON ANNULER PREMIUM (Style Alerte/Rouge) */
.btn-cancel-premium {
    background: rgba(255, 82, 82, 0.05);
    border: 1px solid #ff5252;
    color: #ff5252;
    padding: 8px 20px;
    border-radius: 4px;
    font-family: 'h73bold', sans-serif;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8;
}

.btn-cancel-premium:hover {
    background: #ff5252;
    color: #fff;
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.4);
    transform: translateY(-1px);
}

/* 3. LISTE DES COMMENTAIRES */
.liste-threads { 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.commentaire, .commentaire-item {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid transparent; 
    padding: 12px 15px; 
    position: relative;
    transition: all 0.3s ease;
    
    display: flex;
    flex-direction: column;
    height: auto !important; 
    min-height: 0 !important;
    flex-grow: 0 !important;
    justify-content: flex-start !important;
}

.commentaire:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0) 100%);
    border-left-color: #68fdd6;
}

/* Header */
.commentaire-header {
    display: flex; 
    align-items: center; 
    gap: 12px; 
    margin-bottom: 8px;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 4px;
    border: 1px solid rgba(104, 253, 214, 0.3);
    object-fit: cover;
}
.info-auteur { 
    display: flex; 
    flex-direction: column; 
    line-height: 1.1; 
    align-items: flex-start !important;
}
.nom-utilisateur { 
    font-family: 'h73bold', sans-serif; 
    color: #68fdd6; 
    font-size: 0.95rem; 
    letter-spacing: 0.5px; 
}
.date-commentaire { 
    font-size: 0.7rem; 
    color: #777; 
    font-style: italic; 
    margin-top: 2px; 
}

/* BOUTON OPTIONS DÉDIÉ */
.options-wrapper { position: relative; margin-left: auto; }

.btn-options {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 32px; 
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #888;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.btn-options:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.btn-options svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Contenu */
.commentaire-content {
    color: #d0d0d0;
    line-height: 1.4;
    font-size: 0.95rem;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    padding-left: 44px;
    text-align: left !important;
    width: 100%;
    flex-grow: 0;
}
.commentaire-content p {
    margin: 0 !important; 
    padding: 0 !important;
    text-align: left !important;
}

/* Actions */
.commentaire-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    padding-right: 5px;
    margin-top: 0;
}

/* Vote Pill */
.vote-container {
    display: flex; align-items: center; gap: 2px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2px 8px;
    transition: all 0.3s ease;
}
.vote-container:hover { border-color: rgba(104, 253, 214, 0.3); background: rgba(255, 255, 255, 0.08); }

.btn-vote {
    background: none; border: none; cursor: pointer; padding: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #888; transition: all 0.2s; border-radius: 50%;
}
.btn-vote:hover { color: #fff; }
.btn-vote svg { width: 14px; height: 14px; fill: currentColor; }
.btn-vote.active-up { color: #68fdd6; }
.btn-vote.active-down { color: #ff5252; }
.score-vote { font-family: 'h73bold', sans-serif; color: #e0e0e0; font-size: 0.8rem; margin: 0 5px; min-width: 15px; text-align: center; }

/* Boutons texte */
.btn-repondre {
    background: none; border: none; color: #888;
    font-size: 0.75rem; font-family: 'h73bold', sans-serif; text-transform: uppercase;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; border-radius: 4px; transition: all 0.2s;
}
.btn-repondre:hover { color: #68fdd6; background: rgba(104, 253, 214, 0.1); }
.btn-repondre svg { width: 12px; height: 12px; fill: currentColor; }

/* --- MENU D'OPTIONS --- */
.comment-options-menu {
    background: rgba(15, 18, 22, 0.98) !important;
    border: 1px solid rgba(104, 253, 214, 0.2) !important;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(104, 253, 214, 0.1);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    z-index: 100;
    animation: menuOpen 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: top right;
}

@keyframes menuOpen {
    from { opacity: 0; transform: scale(0.8) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.menu-btn-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
    background: transparent; border: none; border-radius: 4px; cursor: pointer;
    font-family: 'h73light', sans-serif; font-size: 0.85rem; text-transform: uppercase;
    letter-spacing: 1px; text-align: left; color: #a0a0a0; transition: all 0.2s ease;
    border-left: 2px solid transparent;
}

.menu-btn-item svg { width: 16px; height: 16px; fill: currentColor; opacity: 0.6; transition: opacity 0.2s; }

.menu-btn-item.edit:hover {
    background: linear-gradient(90deg, rgba(104, 253, 214, 0.1), transparent);
    color: #68fdd6; border-left-color: #68fdd6; padding-left: 15px;
}
.menu-btn-item.edit:hover svg { opacity: 1; filter: drop-shadow(0 0 5px #68fdd6); }

.menu-btn-item.delete:hover {
    background: linear-gradient(90deg, rgba(255, 82, 82, 0.1), transparent);
    color: #ff5252; border-left-color: #ff5252; padding-left: 15px;
}
.menu-btn-item.delete:hover svg { opacity: 1; filter: drop-shadow(0 0 5px #ff5252); }

.menu-btn-item:not(:last-child) { border-bottom: 1px solid rgba(255, 255, 255, 0.03); }

/* Threads */
.thread-replies {
    margin-top: 5px; margin-left: 15px; position: relative; padding-left: 20px;
    border-left: 1px solid rgba(104, 253, 214, 0.15);
}
.commentaire.is-reply {
    background: rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 0 4px 4px 0; margin-bottom: 5px; padding: 10px 12px;
    text-align: left !important;
}
.thread-replies::before {
    content: ''; position: absolute; top: 0; left: -1px; width: 1px; height: 15px;
    background: linear-gradient(to bottom, #68fdd6, rgba(104, 253, 214, 0.15));
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.commentaire { animation: fadeIn 0.3s ease-out; }