/* Articles Similaires Sidebar Animée */

/* Container principal de la sidebar */
.related-articles-sidebar {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.related-articles-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2E7D32, #1B5E20);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background: #2E7D32;
}

/* Liste des articles similaires */
.related-articles-list {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.related-articles-list::-webkit-scrollbar {
    width: 4px;
}

.related-articles-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.related-articles-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.related-articles-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Carte d'article similaire */
.related-article-item {
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: slideInUp 0.6s ease forwards;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.related-article-card {
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.related-article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2E7D32, #1B5E20);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.related-article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 125, 50, 0.15);
    border-color: rgba(46, 125, 50, 0.3);
}

.related-article-card:hover::before {
    transform: scaleX(1);
}

/* Image de l'article similaire */
.related-article-image {
    position: relative;
    height: 80px;
    overflow: hidden;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article-card:hover .related-article-image img {
    transform: scale(1.05);
}

.related-article-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

/* Contenu de l'article similaire */
.related-article-content {
    padding: 1rem;
}

.related-article-title {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.related-article-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-article-title a:hover {
    color: #2E7D32;
}

.related-article-meta,
.related-article-date {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    color: #6c757d;
    font-size: 0.75rem;
}

.related-article-meta i,
.related-article-date i {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* Message aucun article */
.no-related-articles {
    text-align: center;
    padding: 2rem 1rem;
    color: #6c757d;
}

.no-related-articles i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-related-articles p {
    margin: 0;
    font-size: 0.8rem;
}

/* Amélioration du contenu principal */
.article-main-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
}

.article-hero-image {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.article-hero-image img {
    transition: transform 0.3s ease;
}

.article-hero-image:hover img {
    transform: scale(1.02);
}

.article-hero-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    pointer-events: none;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #2c3e50;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body h1, .article-body h2, .article-body h3,
.article-body h4, .article-body h5, .article-body h6 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-body h1 { font-size: 2rem; }
.article-body h2 { font-size: 1.75rem; }
.article-body h3 { font-size: 1.5rem; }
.article-body h4 { font-size: 1.25rem; }
.article-body h5 { font-size: 1.1rem; }
.article-body h6 { font-size: 1rem; }

/* Responsive Design */
@media (max-width: 991.98px) {
    .related-articles-sidebar {
        margin-bottom: 2rem;
    }
    
    .related-article-item {
        animation-delay: 0s !important;
    }
    
    .article-main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .related-articles-sidebar {
        padding: 1rem;
    }
    
    .sidebar-title {
        font-size: 1rem;
    }
    
    .related-article-image {
        height: 100px;
    }
    
    .related-article-content {
        padding: 0.75rem;
    }
    
    .related-article-title {
        font-size: 0.85rem;
    }
    
    .article-main-content {
        padding: 1rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
}

/* Animations avancées */
.related-article-card {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de pulsation subtil sur le titre */
.sidebar-title {
    position: relative;
}

.sidebar-title::before {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Amélioration des badges de tags */
.article-body .badge {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.article-body .badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Amélioration du sticky */
@media (min-width: 992px) {
    .sticky-top {
        position: -webkit-sticky;
        position: sticky;
    }
}

/* Effet de parallax subtil sur le scroll */
.article-main-content {
    position: relative;
}

.article-main-content::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, #f8f9fa, transparent);
    pointer-events: none;
}

/* Amélioration de la lisibilité */
.related-article-title a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Animation de chargement */
.related-articles-list {
    position: relative;
}

.related-articles-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%, transparent 75%, #f8f9fa 75%);
    background-size: 20px 20px;
    animation: shimmer 1.5s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-articles-list:hover::before {
    opacity: 0;
}

@keyframes shimmer {
    0% {
        background-position: -20px 0;
    }
    100% {
        background-position: 20px 0;
    }
}
