/**
 * CSS pour l'affichage détaillé d'une news
 * Fichier: /assets/css/pages/view-news.css
 * Route: GET /news/{slug}
 */

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */

.news-view-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   BLOC COMPLET DE LA NEWS
   ======================================== */

.news-complete-card {
    background: white;
    border: 3px solid #6B7BA8;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* ========================================
   EN-TÊTE: IMAGE + TITRE + AUTEUR
   ======================================== */

.news-top-wrapper {
    padding: 25px;
}

.news-header-section {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

/* Image à gauche */
.news-img-left {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
}

.news-img-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-img-placeholder {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    border-radius: 8px;
}

/* Contenu à droite */
.news-header-content {
    flex: 1;
}

.news-header-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.news-title {
    flex: 1;
    font-size: 1.8em;
    color: #333;
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
}

/* Photo auteur petit (à droite du titre) - RECTANGULAIRE */
.news-author-photo-inline {
    flex-shrink: 0;
    width: 60px;
    height: 80px;
}

.news-author-photo-inline a {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #667eea;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.news-author-photo-inline a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.news-author-photo-inline img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Métadonnées */
.news-meta-info {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
}

.news-source {
    font-weight: 600;
    color: #764ba2;
}

.news-date {
    color: #999;
}

/* ========================================
   CONTENU PRINCIPAL (CORPS TEXTE)
   ======================================== */

.news-body-full {
    margin-top: 25px;
}

.news-paragraph {
    color: #333;
    line-height: 1.8;
    font-size: 1em;
    margin-bottom: 20px;
    text-align: justify;
}

.news-paragraph:last-child {
    margin-bottom: 0;
}

/* ========================================
   SÉPARATEUR HORIZONTAL
   ======================================== */

.horizontal-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 25px 0;
}

/* ========================================
   FOOTER: VOTES ET INFOS AUTEUR
   ======================================== */

.news-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
    flex-wrap: wrap;
    gap: 20px;
}

/* Section votes */
.news-votes-section {
    display: flex;
    gap: 10px;
    align-items: center;
}

.news-vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
    color: #666;
}

.news-vote-btn:hover {
    border-color: #999;
    background: #f5f5f5;
}

.news-vote-btn.active {
    border-color: #999;
    background: #f5f5f5;
    color: #666;
}

.news-vote-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.news-vote-btn .like-count,
.news-vote-btn .dislike-count {
    color: #666;
}

/* Info auteur */
.news-author-info {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
}

.news-author-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.news-author-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.news-views {
    display: inline-block;
    padding: 2px 8px;
    background: #f0f0f0;
    border-radius: 12px;
}

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

.news-comments-section {
    padding: 25px;
}

.comments-title {
    font-size: 1.3em;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: 700;
}

/* Formulaire commentaire principal */
.news-comment-form-main {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 25px;
}

.news-comment-form-main form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-comment-form-main textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95em;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.news-comment-form-main textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.news-comment-form-main button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    align-self: flex-start;
}

.news-comment-form-main button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Prompt connexion */
.comments-login-prompt {
    text-align: center;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 25px;
}

.comments-login-prompt p {
    margin: 0;
}

.comments-login-prompt a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.comments-login-prompt a:hover {
    text-decoration: underline;
}

/* Liste des commentaires */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   COMMENTAIRES PRINCIPAUX
   ======================================== */

.comment-main-container {
    margin-bottom: 20px;
}

.comment-card {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
}

.comment-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* En-tête du commentaire */
.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.comment-author-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.comment-author-link:hover {
    color: #667eea;
}

.comment-author-link img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-author-link strong {
    font-weight: 600;
}

.comment-date {
    margin-left: auto;
    font-size: 0.8em;
    color: #999;
}

/* Contenu du commentaire */
.comment-content {
    color: #333;
    line-height: 1.5;
    font-size: 0.95em;
    margin-bottom: 12px;
}

/* Votes sur commentaire */
.comment-votes {
    display: flex;
    gap: 8px;
    align-items: center;
}

.comment-vote-btn {
    padding: 4px 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
}

.comment-vote-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.comment-vote-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.comment-reply-btn {
    padding: 4px 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s;
    color: #666;
}

.comment-reply-btn:hover {
    border-color: #667eea;
    color: #667eea;
    background: #f5f7ff;
}

/* ========================================
   RÉPONSES AUX COMMENTAIRES
   ======================================== */

.replies-list {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-reply-container {
    margin-bottom: 15px;
}

.comment-card.reply-style {
    background: #fafafa;
    border-left: 3px solid #667eea;
}

/* ========================================
   FORMULAIRES DE RÉPONSE
   ======================================== */

.reply-form-container {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.reply-form-container form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reply-form-container textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
}

.reply-form-container textarea:focus {
    outline: none;
    border-color: #667eea;
}

.reply-buttons {
    display: flex;
    gap: 8px;
    font-size: 0.9em;
}

.reply-buttons button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.reply-buttons button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.reply-buttons button[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.reply-buttons button[type="button"] {
    background: white;
    border: 1px solid #ddd;
    color: #666;
}

.reply-buttons button[type="button"]:hover {
    border-color: #667eea;
    color: #667eea;
}

.reply-form-placeholder {
    margin-top: 10px;
}

/* ========================================
   ÉTAT VIDE
   ======================================== */

.no-comments {
    text-align: center;
    padding: 40px 20px;
    background: #f5f5f5;
    border-radius: 8px;
    color: #999;
}

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

@media (max-width: 768px) {
    .news-view-container {
        padding: 10px;
    }
    
    .news-header-section {
        flex-direction: column;
        gap: 15px;
    }
    
    .news-img-left,
    .news-img-placeholder {
        width: 100%;
        height: 250px;
    }
    
    .news-header-row {
        flex-direction: column;
    }
    
    .news-title {
        font-size: 1.4em;
    }
    
    .news-author-photo-inline {
        align-self: flex-start;
    }
    
    .news-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-meta-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .replies-list {
        padding-left: 12px;
    }
    
    .comment-header {
        flex-wrap: wrap;
    }
    
    .comment-date {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .news-complete-card {
        border-radius: 0;
    }
    
    .news-top-wrapper {
        padding: 15px;
    }
    
    .news-title {
        font-size: 1.2em;
    }
    
    .news-header-row {
        gap: 10px;
    }
    
    .news-author-photo-inline {
        width: 50px;
        height: 50px;
    }
    
    .news-paragraph {
        font-size: 0.95em;
    }
    
    .comment-vote-btn,
    .comment-reply-btn {
        font-size: 0.75em;
        padding: 3px 6px;
    }
}
