/* CSS pour les pages d'articles */

/* Styles pour la section de partage */
.share-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e9ecef;
    margin-top: 2rem;
}

.share-section h5 {
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 15px;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-btn {
    min-width: 45px;
    height: 45px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    font-size: 16px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-btn i {
    font-size: 18px;
}

/* Styles spécifiques pour chaque réseau social */
.social-btn.btn-primary {
    background: linear-gradient(135deg, #1877f2, #0e5fcc);
}

.social-btn.btn-info {
    background: linear-gradient(135deg, #1da1f2, #0c85d0);
}

.social-btn.btn-success {
    background: linear-gradient(135deg, #25d366, #128c7e);
}

.social-btn.btn-danger {
    background: linear-gradient(135deg, #ff0000, #cc0000);
}

.social-btn.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

/* Animation pour le bouton de copie */
.btn-outline-primary {
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

/* Styles pour le résumé de l'article */
.article-summary {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--primary-green, #2E7D32);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-summary .lead {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #2c3e50 !important;
    font-weight: 600;
}

.article-summary .lead::before {
    content: "📝";
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .share-buttons {
        justify-content: center;
    }
    
    .social-btn {
        min-width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .social-btn i {
        font-size: 16px;
    }
    
    .article-summary {
        padding: 15px;
        margin-bottom: 1.5rem;
    }
    
    .article-summary .lead {
        font-size: 1rem;
    }
}

/* Tooltip pour les boutons de partage */
.social-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Header de l'article */
.article-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-green) 100%);
    position: relative;
    overflow: hidden;
}

.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.article-header .container {
    position: relative;
    z-index: 1;
}

/* Contenu de l'article */
.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--black);
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--primary-green);
}

.article-body h2 {
    font-size: 1.8rem;
    border-bottom: 3px solid var(--accent-green);
    padding-bottom: 0.5rem;
}

.article-body h3 {
    font-size: 1.5rem;
}

.article-body h4 {
    font-size: 1.3rem;
}

.article-body p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-green);
    background-color: var(--light-gray);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    margin: 1.5rem 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.article-body th,
.article-body td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.article-body th {
    background-color: var(--primary-green);
    color: white;
    font-weight: 600;
}

.article-body tr:hover {
    background-color: var(--light-gray);
}

/* Articles similaires */
.related-articles .card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
}

.related-articles .card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.related-articles .card-img-top {
    transition: transform 0.3s ease;
}

.related-articles .card:hover .card-img-top {
    transform: scale(1.05);
}

/* Section de partage */
.share-section {
    background-color: var(--light-gray);
    border-top: 1px solid #e0e0e0;
}

.share-section .btn {
    transition: all 0.3s ease;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
}

.share-section .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Tags */
.badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 992px) {
    .related-articles-sidebar {
        margin-top: 2rem;
    }
    
    .sticky-top {
        position: relative !important;
        top: 0 !important;
    }
}

@media (max-width: 768px) {
    /* Header responsive */
    .article-header {
        padding: 3rem 0 2rem !important;
    }
    
    .article-header .display-5 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .article-header .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start !important;
    }
    
    .article-header .d-flex span {
        margin-right: 0 !important;
        margin-bottom: 0.25rem;
    }
    
    /* Contenu responsive */
    .article-body {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .article-body h2 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }
    
    .article-body h3 {
        font-size: 1.3rem;
        margin-top: 1.25rem;
    }
    
    .article-body h4 {
        font-size: 1.1rem;
    }
    
    /* Images responsive */
    .article-body img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 1rem 0;
    }
    
    /* Sidebar responsive */
    .related-articles-sidebar {
        background: var(--light-gray);
        border-radius: 12px;
        padding: 1.5rem;
        margin-top: 2rem;
    }
    
    .sidebar-title {
        font-size: 1.1rem;
        margin-bottom: 1rem !important;
    }
    
    .related-article-item {
        margin-bottom: 1rem;
    }
    
    .related-article-card {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .related-article-image img {
        height: 60px;
        object-fit: cover;
    }
    
    .related-article-title {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .related-article-meta,
    .related-article-date {
        font-size: 0.75rem;
    }
    
    /* Tags responsive */
    .tags-section .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        margin: 0.25rem;
    }
    
    /* Boutons de partage responsive */
    .share-section {
        margin-top: 2rem;
    }
    
    .share-section .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        margin: 0.25rem;
    }
    
    .share-section .social-btn {
        padding: 0.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    /* Header mobile */
    .article-header {
        padding: 2rem 0 1.5rem !important;
    }
    
    .article-header .display-5 {
        font-size: 1.5rem;
        line-height: 1.1;
    }
    
    .article-header .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.8rem;
    }
    
    /* Contenu mobile */
    .article-content {
        padding: 2rem 0 !important;
    }
    
    .article-body {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .article-body h2 {
        font-size: 1.4rem;
    }
    
    .article-body h3 {
        font-size: 1.2rem;
    }
    
    .article-body p {
        margin-bottom: 1rem;
    }
    
    /* Sidebar mobile */
    .related-articles-sidebar {
        padding: 1rem;
        margin-top: 1.5rem;
    }
    
    .sidebar-title {
        font-size: 1rem;
        margin-bottom: 0.75rem !important;
        text-align: center;
    }
    
    .related-article-item {
        margin-bottom: 0.75rem;
    }
    
    .related-article-card {
        padding: 0.75rem;
        flex-direction: row;
        align-items: center;
    }
    
    .related-article-image {
        width: 60px;
        height: 60px;
        margin-right: 0.75rem;
        margin-bottom: 0;
    }
    
    .related-article-image img {
        width: 100%;
        height: 100%;
        border-radius: 6px;
    }
    
    .related-article-content {
        flex: 1;
    }
    
    .related-article-title {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }
    
    .related-article-meta,
    .related-article-date {
        font-size: 0.7rem;
        margin-bottom: 0.1rem;
    }
    
    /* Tags mobile */
    .tags-section {
        text-align: center;
    }
    
    .tags-section .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        margin: 0.2rem;
        display: inline-block;
    }
    
    /* Partage mobile */
    .share-section {
        text-align: center;
    }
    
    .share-section h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .share-section .btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin: 0.2rem;
        display: inline-block;
    }
    
    .share-section .social-btn {
        padding: 0.4rem;
        font-size: 0.9rem;
        margin: 0.1rem;
    }
    
    /* Amélioration générale mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .article-main-content {
        padding: 0;
    }
}

/* Tablettes (entre mobile et desktop) */
@media (min-width: 577px) and (max-width: 992px) {
    .article-header {
        padding: 3.5rem 0 2.5rem !important;
    }
    
    .article-header .display-5 {
        font-size: 2rem;
    }
    
    .related-articles-sidebar {
        padding: 1.25rem;
        margin-top: 1.5rem;
    }
    
    .related-article-image img {
        height: 70px;
    }
    
    .article-body {
        font-size: 1.05rem;
    }
}

/* Optimisation pour les très petits écrans */
@media (max-width: 400px) {
    .article-header .display-5 {
        font-size: 1.3rem;
    }
    
    .article-header .d-flex span {
        font-size: 0.85rem;
    }
    
    .article-body {
        font-size: 0.9rem;
    }
    
    .article-body h2 {
        font-size: 1.3rem;
    }
    
    .article-body h3 {
        font-size: 1.1rem;
    }
    
    .share-section .btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-body > * {
    animation: fadeInUp 0.6s ease-out;
}

/* Scrollbar personnalisée pour les articles longs */
.article-body::-webkit-scrollbar {
    width: 8px;
}

.article-body::-webkit-scrollbar-track {
    background: var(--light-gray);
}

.article-body::-webkit-scrollbar-thumb {
    background: var(--primary-green);
    border-radius: 4px;
}

.article-body::-webkit-scrollbar-thumb:hover {
    background: var(--dark-green);
}
