/**
 * WhatsApp-like Text Formatting Styles
 * Pour les articles et commentaires
 */

/* Container pour le contenu formaté */
.wa-formatted {
    line-height: 1.7;
}

.wa-formatted p {
    margin-bottom: 0.75rem;
}

.wa-formatted p:last-child {
    margin-bottom: 0;
}

/* Code inline */
.wa-code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.9em;
    color: #d63384;
}

/* Bloc monospace (```) */
.wa-monospace {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 0.875em;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 1rem 0;
}

/* Citation (blockquote) */
.wa-quote {
    border-left: 4px solid var(--bs-primary, #0d6efd);
    background-color: rgba(13, 110, 253, 0.05);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 0 6px 6px 0;
}

.wa-quote p {
    margin-bottom: 0.25rem;
    color: #555;
}

.wa-quote p:last-child {
    margin-bottom: 0;
}

/* Citation inline (pour commentaires) */
.wa-quote-inline {
    display: block;
    border-left: 3px solid var(--bs-primary, #0d6efd);
    padding-left: 0.75rem;
    color: #666;
    background-color: rgba(13, 110, 253, 0.03);
    margin: 0.25rem 0;
}

/* Liste à puces */
.wa-list {
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
}

.wa-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.35rem;
}

.wa-list li::before {
    content: '•';
    position: absolute;
    left: 0.5rem;
    color: var(--bs-primary, #0d6efd);
    font-weight: bold;
}

/* Liste numérotée */
.wa-list-numbered {
    list-style: none;
    padding-left: 0;
    margin: 0.75rem 0;
    counter-reset: wa-counter;
}

.wa-list-numbered li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.35rem;
    counter-increment: wa-counter;
}

.wa-list-numbered li::before {
    content: counter(wa-counter) '.';
    position: absolute;
    left: 0.25rem;
    color: var(--bs-primary, #0d6efd);
    font-weight: 600;
}

/* Texte barré */
.wa-formatted del {
    color: #999;
    text-decoration: line-through;
}

/* Aide de formatage */
.wa-format-help {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px dashed #dee2e6;
}

.wa-format-help code {
    background-color: rgba(0, 0, 0, 0.08);
    padding: 0.1em 0.3em;
    border-radius: 3px;
    margin: 0 0.25rem;
    font-size: 0.85em;
}

/* Preview container */
.wa-preview {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    min-height: 100px;
    background-color: #fff;
}

.wa-preview-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animation pour la preview en temps réel */
.wa-preview-content {
    transition: all 0.2s ease;
}

/* Styles spécifiques pour le thème admin */
.admin-theme .wa-monospace {
    background-color: #1a1a2e;
    color: #e0e0e0;
    border-color: #333;
}

.admin-theme .wa-code {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Responsive */
@media (max-width: 768px) {
    .wa-monospace {
        padding: 0.75rem;
        font-size: 0.8em;
    }
    
    .wa-format-help {
        font-size: 0.85em;
    }
    
    .wa-format-help code {
        display: block;
        margin: 0.25rem 0;
    }
}
