/* ========================================
   COMMENTAIRES MODERNES - DESIGN REDESIGN
   À ajouter à style.css
======================================== */

/* ========================================
   SECTION COMMENTAIRES
======================================== */

.comments-area {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1rem;
}

/* ========================================
   EN-TÊTE COMMENTAIRES
======================================== */

.comments-header {
    margin-bottom: 2rem;
}

.comments-title {
    font-size: 2rem;
    font-weight: 800;
    color: #3D5A80; /* Bleu au lieu de noir */
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #98C1D9;
}

.comments-title i {
    color: #EE6C4D;
    font-size: 1.8rem;
}

.comments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, #EE6C4D 0%, #ff8b6d 100%);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 800;
    padding: 0 0.5rem;
}

/* ========================================
   LISTE DES COMMENTAIRES
======================================== */

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

.comment-item {
    margin-bottom: 2rem;
}

/* Commentaires enfants (réponses) */
.children {
    list-style: none;
    padding-left: 3rem;
    margin-top: 1.5rem;
}

.children .comment-item {
    margin-bottom: 1.5rem;
}

/* ========================================
   CORPS DU COMMENTAIRE
======================================== */

.comment-body-modern {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #E0FBFC 100%);
    border-radius: 16px;
    border: 2px solid #98C1D9;
    transition: all 0.3s ease;
    position: relative;
}

.comment-body-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(41, 50, 65, 0.15);
    border-color: #3D5A80;
}

/* ========================================
   AVATAR
======================================== */

.comment-avatar {
    flex-shrink: 0;
    position: relative;
}

.comment-avatar .avatar-image {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid #98C1D9;
    box-shadow: 0 4px 12px rgba(41, 50, 65, 0.1);
    transition: all 0.3s ease;
}

.comment-body-modern:hover .avatar-image {
    border-color: #EE6C4D;
    transform: scale(1.05);
}

/* Badge auteur */
.author-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #EE6C4D 0%, #ff8b6d 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(238, 108, 77, 0.4);
}

.author-badge i {
    color: white;
    font-size: 0.7rem;
}

/* ========================================
   CONTENU COMMENTAIRE
======================================== */

.comment-wrapper {
    flex: 1;
    min-width: 0; /* Pour le text truncate */
}

/* En-tête */
.comment-header {
    margin-bottom: 0.75rem;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #3D5A80; /* Bleu plus doux */
}

.comment-author-name a {
    color: #5a7ca8; /* Bleu encore plus clair */
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-author-name a:hover {
    color: #EE6C4D;
}

.comment-author-name a i {
    opacity: 0.6;
    margin-left: 0.25rem;
}

/* Label auteur */
.author-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #EE6C4D 0%, #ff8b6d 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.author-label i {
    font-size: 0.7rem;
}

/* Meta du commentaire */
.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.comment-time {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #6b8dbc; /* Bleu gris plus clair */
    text-decoration: none;
    transition: color 0.3s ease;
}

.comment-time:hover {
    color: #EE6C4D;
}

.comment-time i {
    font-size: 0.85em;
}

.comment-reply,
.comment-edit {
    display: inline-block;
}

.comment-reply a,
.comment-edit a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: white;
    color: #3D5A80;
    border: 2px solid #98C1D9;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.comment-reply a:hover,
.comment-edit a:hover {
    background: #3D5A80;
    color: white;
    border-color: #3D5A80;
    transform: translateY(-2px);
}

.comment-reply a i,
.comment-edit a i {
    font-size: 0.8em;
}

/* Contenu du texte */
.comment-content {
    color: #4a5568; /* Gris plus doux au lieu de #293241 */
    line-height: 1.7;
    font-size: 1rem;
}

.comment-content p {
    margin-bottom: 0.75rem;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.comment-content a {
    color: #5a7ca8; /* Bleu plus doux */
    text-decoration: underline;
    text-decoration-color: #98C1D9;
    transition: all 0.3s ease;
}

.comment-content a:hover {
    color: #EE6C4D;
    text-decoration-color: #EE6C4D;
}

/* Message de modération */
.comment-awaiting-moderation {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.comment-awaiting-moderation i {
    color: #ffc107;
}

/* ========================================
   NAVIGATION DES COMMENTAIRES
======================================== */

.comment-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0;
}

.comment-navigation a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #3D5A80;
    border: 2px solid #98C1D9;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.comment-navigation a:hover {
    background: #3D5A80;
    color: white;
    border-color: #3D5A80;
    transform: translateY(-2px);
}

/* ========================================
   FORMULAIRE DE COMMENTAIRE
======================================== */

.comment-form-modern {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #E0FBFC 0%, #ffffff 100%) !important;
    border-radius: 16px;
    border: 2px solid #98C1D9;
    color-scheme: light !important; /* Force le mode clair */
}

/* Forcer aussi sur #commentform */
#commentform,
.comment-respond {
    background: linear-gradient(135deg, #E0FBFC 0%, #ffffff 100%) !important;
    color-scheme: light !important;
}

.comment-reply-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #3D5A80; /* Bleu au lieu de noir */
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comment-reply-title i {
    color: #EE6C4D;
    font-size: 1.5rem;
}

.cancel-comment-reply {
    margin-left: auto;
}

.cancel-comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    background: white;
    color: #dc3545;
    border: 2px solid #dc3545;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cancel-comment-reply a:hover {
    background: #dc3545;
    color: white;
}

/* Champs du formulaire */
.comment-form-modern p {
    margin-bottom: 1.5rem;
}

.comment-form-modern label,
#commentform label {
    display: block;
    font-weight: 600;
    color: #4a5568 !important; /* Gris plus doux, forcé */
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.comment-form-modern .required,
#commentform .required {
    color: #EE6C4D !important;
    font-weight: 700;
}

.comment-form-modern input[type="text"],
.comment-form-modern input[type="email"],
.comment-form-modern input[type="url"],
.comment-form-modern textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #98C1D9;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    color: #111827 !important; /* Texte très foncé, force l'affichage */
    background: #ffffff !important; /* Fond blanc forcé */
    transition: all 0.3s ease;
    -webkit-text-fill-color: #111827 !important; /* Pour Safari */
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Forcer les styles pour tous les sélecteurs possibles */
#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea,
textarea#comment,
input#author,
input#email,
input#url {
    color: #111827 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 2px solid #98C1D9 !important;
}

/* Important pour forcer les styles sur les navigateurs */
.comment-form-modern textarea {
    color: #111827 !important;
    background-color: #ffffff !important;
}

.comment-form-modern input::placeholder,
.comment-form-modern textarea::placeholder,
#commentform input::placeholder,
#commentform textarea::placeholder {
    color: #9ca3af !important; /* Placeholder gris clair */
    opacity: 1 !important; /* Force l'opacité */
    -webkit-text-fill-color: #9ca3af !important;
}

/* Assurer que le texte reste lisible quand on tape */
.comment-form-modern textarea:focus,
.comment-form-modern input:focus,
#commentform textarea:focus,
#commentform input:focus {
    color: #111827 !important; /* Texte encore plus foncé au focus */
    background: #ffffff !important;
    background-color: #ffffff !important;
}

.comment-form-modern input:focus,
.comment-form-modern textarea:focus {
    outline: none;
    border-color: #3D5A80;
    box-shadow: 0 0 0 4px rgba(61, 90, 128, 0.1);
}

.comment-form-modern textarea {
    resize: vertical;
    min-height: 150px;
}

/* Grille pour nom/email/site */
.comment-form-modern .comment-form-author,
.comment-form-modern .comment-form-email,
.comment-form-modern .comment-form-url {
    display: inline-block;
    width: calc(33.333% - 1rem);
    margin-right: 1.5rem;
}

.comment-form-modern .comment-form-url {
    margin-right: 0;
}

/* Bouton submit */
.comment-form-modern .submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #EE6C4D 0%, #ff8b6d 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(238, 108, 77, 0.3);
}

.comment-form-modern .submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(238, 108, 77, 0.4);
}

.comment-form-modern .submit-button:active {
    transform: translateY(0);
}

.comment-form-modern .submit-button i {
    font-size: 0.9em;
}

/* ========================================
   MESSAGE AUCUN COMMENTAIRE
======================================== */

.no-comments {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #E0FBFC 0%, #ffffff 100%);
    border-radius: 16px;
    border: 2px solid #98C1D9;
    color: #3D5A80;
    font-size: 1.1rem;
}

.no-comments i {
    font-size: 2rem;
    color: #EE6C4D;
    margin-bottom: 1rem;
    display: block;
}

/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .comments-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comment-body-modern {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .children {
        padding-left: 1rem;
    }
    
    .comment-avatar .avatar-image {
        width: 48px;
        height: 48px;
    }
    
    .author-badge {
        width: 20px;
        height: 20px;
    }
    
    .author-badge i {
        font-size: 0.6rem;
    }
    
    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .comment-form-modern {
        padding: 1.5rem;
    }
    
    .comment-form-modern .comment-form-author,
    .comment-form-modern .comment-form-email,
    .comment-form-modern .comment-form-url {
        width: 100%;
        margin-right: 0;
    }
    
    .comment-reply-title {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .cancel-comment-reply {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .comments-area {
        padding: 0 0.5rem;
    }
    
    .comment-body-modern {
        padding: 0.75rem;
    }
    
    .comment-form-modern {
        padding: 1rem;
    }
    
    .comment-navigation {
        flex-direction: column;
    }
}

/* ========================================
   ANIMATIONS
======================================== */

@keyframes slideInComment {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.comment-item {
    animation: slideInComment 0.5s ease backwards;
}

.comment-item:nth-child(1) { animation-delay: 0.1s; }
.comment-item:nth-child(2) { animation-delay: 0.2s; }
.comment-item:nth-child(3) { animation-delay: 0.3s; }
.comment-item:nth-child(4) { animation-delay: 0.4s; }
.comment-item:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   DARK MODE (OPTIONNEL)
======================================== */

@media (prefers-color-scheme: dark) {
    .comment-body-modern {
        background: linear-gradient(135deg, #293241 0%, #3D5A80 100%);
        border-color: #3D5A80;
    }
    
    .comment-author-name {
        color: #E0FBFC;
    }
    
    .comment-content {
        color: #E0FBFC;
    }
    
    .comment-form-modern {
        background: linear-gradient(135deg, #293241 0%, #3D5A80 100%);
        border-color: #3D5A80;
    }
    
    .comment-form-modern input,
    .comment-form-modern textarea {
        background: #1a1d29;
        border-color: #3D5A80;
        color: #E0FBFC;
    }
}


/* ========================================
   SURCHARGE MAXIMALE - FIX FORMULAIRE
   Cette section doit rester EN DERNIER
======================================== */

/* Force absolue du fond blanc et texte noir */
body .comment-form-modern textarea,
body .comment-form-modern input[type="text"],
body .comment-form-modern input[type="email"],
body .comment-form-modern input[type="url"],
body #commentform textarea,
body #commentform input[type="text"],
body #commentform input[type="email"],
body #commentform input[type="url"],
body textarea#comment,
body input#author,
body input#email,
body input#url {
    color: #111827 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 2px solid #98C1D9 !important;
    -webkit-text-fill-color: #111827 !important;
}

/* Placeholder visible */
body .comment-form-modern input::placeholder,
body .comment-form-modern textarea::placeholder,
body #commentform input::placeholder,
body #commentform textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

/* Focus states */
body .comment-form-modern textarea:focus,
body .comment-form-modern input:focus,
body #commentform textarea:focus,
body #commentform input:focus {
    color: #111827 !important;
    background: #ffffff !important;
    border-color: #3D5A80 !important;
}

/* Container background */
body .comment-form-modern,
body #commentform,
body .comment-respond {
    background: linear-gradient(135deg, #E0FBFC 0%, #ffffff 100%) !important;
}

/* WebKit specific fixes */
@supports (-webkit-appearance: none) {
    .comment-form-modern input,
    .comment-form-modern textarea,
    #commentform input,
    #commentform textarea {
        -webkit-appearance: none !important;
        color: #111827 !important;
        background: #ffffff !important;
    }
}

/* Firefox specific fixes */
@-moz-document url-prefix() {
    .comment-form-modern input,
    .comment-form-modern textarea,
    #commentform input,
    #commentform textarea {
        color: #111827 !important;
        background: #ffffff !important;
    }
}
