/* Rainbow Line Animation */
@keyframes shimmer {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.rainbow-line {
    height: 5px;
    background: linear-gradient(to right, #FFB5BA, #B5E6FF, #FFE1B5, #B5FFD0, #FFB5BA);
    opacity: 0.8;
    background-size: 200% 100%;
    animation: shimmer 20s infinite linear;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

/* Variables */
:root {
    --primary-color: #669933;
    --secondary-color: #25a2c3;
    --background-color: #ffffff;
    --text-color: #333333;
    --sidebar-width: 240px;
    --header-height: 80px;
    --footer-height: 300px;
    --border-color: #eee;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;

}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px 60px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Header et Navigation */
.header {
    grid-area: header;
    background: white;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03); */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    height: 80px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0.8rem 2rem;
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.header-book-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--primary-color);
    text-decoration: none;
    line-height: 1.15;
}

.header-book-link img {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(40, 97, 124, .18);
}

.header-book-link span,
.header-book-link small {
    display: block;
}

.header-book-link strong {
    font-size: .82rem;
}

.header-book-link small {
    margin-top: .16rem;
    color: #6c6c6c;
    font-size: .68rem;
}

.header-actions .espaceprivee-btn {
    margin-left: 0;
}

.logo {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.3rem 0;
}

.logo img {
    height: 3.5rem;
    width: auto;
    z-index: 1;
    margin: 15px 0 0 15px;
}

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.main-nav a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

.main-nav a:hover {
    color: #fff;
    background: linear-gradient(135deg, #7896bb 0%, #5b7fae 100%);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 100vw;
    height: 3px;
    background: linear-gradient(to right, rgba(0, 182, 255, 0), rgba(17, 160, 248, 0.2) 19.75%, rgba(30, 110, 175, 1), rgba(16, 149, 243, 0.2) 79.83%, rgba(0, 165, 255, 0));
    );
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-in-out;
    transform-origin: center;
}

.main-nav a:hover::after {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
    box-shadow: 0 0 15px rgba(239, 68, 176, 0.4);
}

.main-nav ul li.active a::after {
    opacity: 1;
    transform: translateX(-50%) scaleX(1);
    box-shadow: 0 0 15px rgba(239, 68, 176, 0.4);
}

/* Layout */
main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 10px;
    margin-top: calc(var(--header-height) + 2px);
    padding-bottom: 30px;
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    box-sizing: border-box;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f5f5f5;
    border-radius: 20px 0 0 20px;
}

body.sidebar-hidden main {
    margin-left: 0;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: white;
    /* border-right: 1px solid #eee; */
    overflow-y: auto;
    z-index: 100;
    padding: 20px 10px;
    box-sizing: border-box;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-image: linear-gradient(to right, rgba(239, 67, 177, 0) 31.51%, rgba(70, 170, 241, 0.23) 56.3%, transparent 84.03%);
}


body.sidebar-hidden .sidebar {
    transform: translateX(-100%);
}

a {
    color: var(--primary-color);
}

/* Sidebar et Navigation */
.sidebar-section {
    margin-bottom: 25px;
    padding-right: 20px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-item:hover {
    transform: translateX(5px);
    background: linear-gradient(135deg, #9fc4f7 0%, #dcf1f3 100%);
}

/* Unique hover effects only for main navigation items */
.sidebar-item[href="/"]:hover {
    background: linear-gradient(135deg, #9fc4f7 0%, #dcf1f3 100%);
}

.sidebar-item:has(i.fa-leaf):hover {
    background: linear-gradient(135deg, #85c99e 0%, #c2e6cc 100%);
}

.sidebar-item:has(i.fa-lightbulb):hover {
    background: linear-gradient(135deg, #ffd700 0%, #fff4b3 100%);
}

.sidebar-item:has(i.fa-compass):hover {
    background: linear-gradient(135deg, #ff9966 0%, #ffcc99 100%);
}
.sidebar-item i {
    margin-right: 12px;
    font-size: 20px;
    color: #87b5f1;
    opacity: 0.9;
    width: 24px;
    text-align: center;
}

.sidebar-section a {
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-section a:hover {
    color: var(--primary-color);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-color);
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-height: 160px;
    transition: max-height 0.3s ease-out;
}

.categories-list.show-all {
    max-height: 800px; /* hauteur pour tous les éléments */
}

.categories-list li {
    margin-bottom: 10px;
}

.categories-list a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.see-more-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.empty {
   position: relative; /* Pour positionner le texte par rapport à ce conteneur */
    width: 83vw; /* 100 % de la largeur de la fenêtre */
    height: 55vh; /* 100 % de la hauteur de la fenêtre */
    display: flex; /* Utiliser Flexbox pour centrer le contenu */
    justify-content: center; /* Centrer horizontalement */
    align-items: center; /* Centrer verticalement */
    text-align: center; /* Centrer le texte */
    font-size: 1.5rem;
    color: #606060;
}

.empty::after {
    content: ' 🍒'; /* Emoji à afficher */
    display: block; /* Afficher l'emoji sur une nouvelle ligne */
    font-size: 3rem; /* Ajustez la taille de l'emoji selon vos besoins */
    margin-top: 10px; /* Espacement entre le texte et l'emoji */
}

.toggle-categories {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    font-size: 0.8rem;
    padding: 5px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.toggle-categories i {
    margin-left: 5px;
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.toggle-categories.expanded i {
    transform: rotate(180deg);
}

.see-more {
    font-size: 0.85rem;
    display: block;
    text-align: center;
    padding: 5px 0;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin: 0 0 10px 13px;
    padding: 0;
}

.see-more {
    font-size: 0.85rem;
    display: block;
    text-align: center;
    margin: 5px 15px 0;
    color: #666;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gestion du voir plus/moins */
.toggle-categories .less {
    display: none;
}

.toggle-categories.expanded .more {
    display: none;
}

.toggle-categories.expanded .less {
    display: inline;
}

.categories-list .sidebar-item:nth-child(n+5) {
    display: none;
}

.categories-list.show-all .sidebar-item:nth-child(n+5) {
    display: flex;
}

/* Produit du jour */
.product-day {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 12px;
    padding: 15px;
    color: white;
    margin-top: 30px;
}

.product-day .sidebar-title {
    color: white;
    margin-bottom: 15px;
}

.product-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    text-align: center;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: white;
}

.product-info p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.btn-product {
    display: inline-block;
    background: white;
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Produit du jour widget */
.product-of-day {
    margin: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(40, 97, 124, 0.2);
}

.product-widget {
    background: transparent;
}

.product-image {
    width: 100%;
    height: 150px;
    margin-bottom: 1rem;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-widget h4 {
    font-size: 1rem;
    margin: 0.8rem 0;
    color: white;
    padding: 0 0.5rem;
}

.product-price {
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0.8rem 0;
    padding: 0 0.5rem;
}

.product-link {
    display: inline-block;
    width: calc(100% - 1rem);
    margin: 0.5rem;
    padding: 0.8rem;
    background: white;
    color: var(--primary-color);
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.product-link:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-1px);
}


/* produit du jour sidebar */

.sidebar-section.sidebar-product-day {
 background: linear-gradient(to bottom right, #5c7fae, #152236);
border-radius: 12px;
padding: 15px;
color: white;
margin-top: 30px;
transition: transform 0.6s ease-in-out;
position: relative; /* Ajout de position relative */
overflow: hidden; /* Ajout de overflow hidden */
}


.sidebar-section.sidebar-product-day::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -10px;
    right: -1px;
    bottom: -1px;
    background-image: linear-gradient(to right, transparent, #5b7fae 3%, transparent 97%, transparent);
    background-size: 100% 20%;
    background-repeat: repeat-y;
        animation: sidebar-product-day-line-flow 30s linear infinite;
     animation-delay: 5s;
     z-index: 1;
    border-radius: inherit;
    mix-blend-mode: lighten;
    pointer-events: none;
     opacity: 0;

}
@keyframes sidebar-product-day-line-flow {
    0%, 70%, 100%{
        background-position: 0% 0%;
        opacity: 0;
    }
     15%{
         background-position: 0% 100%;
         opacity: 0.5;
    }
    33.33%, 50%{
          background-position: 0% 100%;
         opacity: 0.1;

      }

}


.sidebar-section.sidebar-product-day .sidebar-title {
color: white;
margin-bottom: 15px;
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 1px;
margin: 0 0 10px 0;
padding: 0;
border-bottom: 2px solid var(--primary-color);
padding-bottom: 0.5rem;
}

.sidebar-product-day .sidebar-product-content {
    display: flex;
    flex-direction: column;
}



.sidebar-product-day .sidebar-product-image-wrapper {
position: relative;
width: 100%;
overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sidebar-product-day .sidebar-product-image {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease-in-out;
border: 2px solid rgba(255,255,255,0.2);
border-radius: 8px;
}

.sidebar-product-day .sidebar-desire-meter {
position: absolute;
bottom: 5px;
right: 5px;
display: flex;
align-items: center;
}

.sidebar-product-day .sidebar-desire-icon {
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.8rem;
border-radius: 50%;
transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
background: var(--secondary-color);
border: 1px solid rgba(91, 127, 173, 0.22);
cursor: pointer;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
position: relative;
}
.sidebar-product-day .sidebar-score {
position: absolute;
top: -10px;
right: -5px;
background-color: var(--primary-color);
color: white;
border-radius: 50%;
padding: 2px 5px;
font-size: 12px;
font-weight: bold;
}


.sidebar-product-day .sidebar-product-info {
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.sidebar-product-day .sidebar-product-info h3 {
    font-size: 1em;
    margin-bottom: 5px;
    color: #fff;
     display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-product-day .sidebar-product-info p {
    font-size: 0.9em;
    color: #fff;
    margin-bottom: 10px;
     display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-product-day .sidebar-btn-product {
    background-color: #5b7fae;
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
    font-size: 0.9em;
}

.sidebar-product-day .sidebar-btn-product:hover {
    background-color: #80a5d5;
color:#fff;
}

.sidebar-product-day .sidebar-product-actions {
    display: flex;
    justify-content: space-between;
     align-items: center;
}
.sidebar-product-day .sidebar-btn-product {
     margin-left: 10px;
}

.sidebar-product-day .sidebar-product-info .sidebar-product-price  {
font-size: 1.1rem;
color: var(--primary-color);
font-weight: bold;
margin: 0.5rem 0;
}


/* Styles for dynamic categories container */
.dynamic-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    justify-content: center;
}

.category-button {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #5b7fae;
    /* background: linear-gradient(135deg, #9fc4f7 0%, #dcf1f3 100%); */
    background: linear-gradient(to bottom right, rgba(183, 211, 250, 0.11) 8.4%, #ddf1f3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-button i {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.category-button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffd6f5 0%, #e8d9ff 100%);
    color: #2e2e2e;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sidebar-item.active {
    background: linear-gradient(135deg, #ffd6f5 0%, #e8d9ff 100%);
    color: #2e2e2e;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.2rem;
    padding: 0;
    margin-top: 30px;
}

@media (min-width: 1400px) {
    .articles-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

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

.article-card {
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    overflow: hidden;
    background: #fff;
    /* border-bottom: 2px solid rgba(91, 154, 84, 0.57); */
    }
    
    /* .article-card.cherjournal-widget {
        border-bottom: none !important;
    } */

.article-image {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
}

.article-image.loaded {
    background: none;
    animation: none;
}

.article-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s ease-in-out;
    opacity: 0;
}

.article-image img.loaded {
    opacity: 1;
}

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

/* Animation delay pour chaque image */
.article-card:nth-child(1) .article-image img { animation-delay: 0.05s; }
.article-card:nth-child(2) .article-image img { animation-delay: 0.1s; }
.article-card:nth-child(3) .article-image img { animation-delay: 0.15s; }
.article-card:nth-child(4) .article-image img { animation-delay: 0.2s; }
.article-card:nth-child(5) .article-image img { animation-delay: 0.25s; }
.article-card:nth-child(6) .article-image img { animation-delay: 0.3s; }
.article-card:nth-child(7) .article-image img { animation-delay: 0.35s; }
.article-card:nth-child(8) .article-image img { animation-delay: 0.4s; }
.article-card:nth-child(9) .article-image img { animation-delay: 0.45s; }
.article-card:nth-child(10) .article-image img { animation-delay: 0.5s; }

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.article-content {
    padding: 1rem;
    padding-top: 0.5rem;
    position: relative;
    margin-top: -12px;
}

.article-card:hover .article-image img {
    transform: scale(1.08);
}

.article-categories {
    margin-top: -0.5em;
}

.category {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(40, 97, 124, 0.2);
    margin: 12px 0 0 -3px;
    transform: translateY(-50%);
    text-decoration: none;
}

.article .category {
    padding: 0.6rem 1.2rem;
    font-size: 1rem;

}


/* Catégories avec voir plus */
.categories-list {
    position: relative;
    overflow: hidden;
    max-height: 160px;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease-in-out,
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: translateY(0);
    transform-origin: top;
}

.categories-list.collapsed {
    max-height: 160px;
    opacity: 0.95;
    transform: translateY(0);
}

.categories-list.expanded {
    opacity: 1;
    transform: translateY(0);
}

.toggle-categories {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    font-size: 0.8rem;
    padding: 5px 0;
    cursor: pointer;
    transition: color 0.2s ease;
}

.toggle-categories i {
    margin-left: 5px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.toggle-categories .less i {
    transform: rotate(180deg);
}

footer {
    grid-area: footer;
    /*background: linear-gradient(to bottom right, #5c7fae, #152236); */
    color: white;
    padding: 40px 20px;
    margin-left: var(--sidebar-width);
    min-height: var(--footer-height);
    position: relative;
    z-index: 90;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.sidebar-hidden footer {
    margin-left: 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding: 0 20px;
}

.footer-section:first-child p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-top: 10px;
}

.footer-section h4 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 40px;
    color: var(--text-color);
}

.footer-section .category {
    transform: none !important;
    font-size: 0.7em;
    padding: 0.1rem 0.6rem;
    margin: 0 0 0 5px; 
}

/* Main Content avec padding-top pour fixed header */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 2rem;
}

.featured-articles h1 {
    font-size: 2.8rem;
    margin-bottom: 3rem;
    color: #333;
    text-align: center;
    font-weight: 800;
    position: relative;
}

.featured-articles h1::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #7896bb, #5b7fae);
    border-radius: 2px;
}

/* Article Full Page - Style Vitrine */
.article-full {
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
    margin: 0 auto;
    overflow: hidden;
    transition: transform 0.3s ease, max-width 0.3s ease;
}

.article-full .article-content {
    padding: 3rem;
    position: relative;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #87b5f1;
}

.article-full .article-body {
    margin-top: 2rem;
}

body.sidebar-hidden .article-full {
    max-width: 1400px;
}

/* Article Full Page */
.article-header {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.article-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-full:hover .article-main-image {
    transform: scale(1.05);
}

.article-full h1 {
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    font-weight: 800;
}

.article-full .article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.article-full .article-meta time {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(239, 68, 176, 0.2);
}

.article-full .article-categories {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.article-full .category {
    background: var(--secondary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.article-full .category:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}



/* Toggle Sidebar */
.sidebar-toggle {
    position: fixed;
    top: calc(var(--header-height) - 25px);
    left: 10px;
    z-index: 1001;
    background: white;
    border: none;
    border-radius: 4px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover {
    background: var(--primary-color);
    transform: rotate(90deg);
    box-shadow: 0 2px 8px rgba(40, 97, 124, 0.2);
}

.sidebar-toggle i {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toggle:hover i {
    color: white;
}

/* Quand la sidebar est cachée, on inverse l'état initial */
.sidebar-hidden .sidebar-toggle {
    transform: rotate(90deg);
}

.sidebar-hidden .sidebar-toggle:hover {
    transform: rotate(0deg);
}

.sidebar-collapsed {
    transform: translateX(-100%) !important;
}

body.sidebar-hidden main {
    margin-left: 0;
}

/* Fond dégradé animé */


.title-article {
    background-image: linear-gradient(to bottom right, #40516e, #2b4d76);
    color: white;
    padding: 0.2rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(40, 97, 124, 0.2);
    transform: translateY(-120%);
    text-decoration: none;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    transition: transform 0.6s ease-in-out; /* Ajout de la transition */
}

.title-article::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background-image: linear-gradient(45deg, #5b7fae, #5b7fae 1%, transparent 20%, transparent 80%, #5b7fae 99%, #5b7fae);
    background-size: 300% 300%;
    animation: border-flow-title 30s linear infinite forwards;
    animation-delay: 5s;
    z-index: 1;
    border-radius: inherit;
    mix-blend-mode: lighten;
    pointer-events: none;
    filter: blur(0.6px);
    opacity: 0;
}

@keyframes border-flow-title {
    0% {
        background-position: 0% 0%;
         opacity: 0;
    }
    15% {
         background-position: 0% 0%;
         opacity: 0.5;
    }
     33.33% {
        background-position: 0% 0%;
        opacity: 0.5;
    }
    50% {
        background-position: 100% 100%;
        opacity: 0.5;
    }
    60%{
        background-position: 100% 100%;
        opacity: 0.5;
    }
     85%{
         background-position: 100% 100%;
          opacity: 0;
    }
      100% {
        background-position: 0% 0%;
         opacity: 0;
    }
}


/* Styles de la page article */


.title-tag {
    margin-bottom: 1.5rem;
}

.title-tag h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: #87b5f1;
    margin: 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.article-meta .category {
    margin: 0;
    transform: none;
    transition: transform 0.2s ease;
}

.article-meta .category:hover {
    transform: translateY(-2px);
}

/* Pour la page article uniquement */
.article-full .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    text-align: left;
}

/* Styles pour le toggle des catégories */
.categories-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.categories-toggle-btn {
    background: none;
    border: 1px solid var(--rose);
    color: var(--rose);
    padding: 5px 10px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
}

.categories-toggle-btn:hover,
.categories-toggle-btn.active {
    background-color: var(--rose);
    color: white;
}

.categories-toggle-btn i {
    margin-right: 5px;
}

.categories-list {
    display: block;
    opacity: 1;
}

.categories-list.active {
    display: block;
    opacity: 1;
}

/* Animation de transition */
.categories-list {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.categories-list.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Style pour les catégories de l'article */
.article-category {
    font-weight: 500;
    border: 1px solid var(--rose);
    background-color: var(--rose-light);
}

.article-category:hover {
    background-color: var(--rose);
    color: white;
}

.categories-list .sidebar-item.hidden {
    display: none;
}

.categories-list.show-all .sidebar-item.hidden {
    display: flex;
}

.toggle-categories {
    cursor: pointer;
    color: var(--rose);
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.toggle-categories .less {
    display: none;
}

.categories-list.show-all + .toggle-categories .more {
    display: none;
}

.categories-list.show-all + .toggle-categories .less {
    display: inline;
}

.sidebar-item.hidden {
    display: none;
}

.categories-list.show-all .sidebar-item.hidden {
    display: flex;
}

.toggle-categories {
    cursor: pointer;
    color: var(--rose);
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
}

.toggle-categories .less {
    display: none;
}

.categories-list.show-all + .toggle-categories .more {
    display: none;
}

.categories-list.show-all + .toggle-categories .less {
    display: inline;
}

.article-category {
    font-weight: 500;
    border: 1px solid var(--rose);
    background-color: var(--rose-light);
}

.article-category:hover {
    background-color: var(--rose);
    color: white;
}

/* Pages d'erreur */
.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
}

.error-content {
    max-width: 600px;
}

.error-content h1 {
    font-size: 6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.error-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-content p {
    margin-bottom: 2rem;
}

.error-content .btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.error-content .btn:hover {
    background-color: var(--primary-color-dark);
}

/* Responsive */


@media (max-width: 1400px) {
    .articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1200px) {
    .header-content {
        padding: 0.8rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        padding: 0.8rem;
    }

    .header-actions {
        position: absolute;
        top: 8px;
        right: 10px;
        gap: .4rem;
    }

    .header-book-link span {
        display: none;
    }

    .header-book-link img {
        width: 38px;
        height: 38px;
        border-radius: 9px;
    }

    .header-actions .espaceprivee-btn {
        position: static !important;
        right: auto !important;
        margin: 0 !important;
    }
    .article-content {
        font-size: 1rem;
    }

    .sidebar {
       z-index: 999 !important;
    }

   .logo img { 
    margin: 0;
    }

    main {
        margin-left: 0;
        width: 100%;
        margin-top: calc(var(--header-height) + 10px);
    }

    .main-nav {
        margin: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.95);
        padding: 15px 20px;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 998;
        border-top: 1px solid rgba(150, 150, 150, 0.5);
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
        .main-nav.user-connected::before {
        content: "\f6fa"; /* Code de l'icône fa-mask */
        font-family: "Font Awesome 5 Free";
        font-weight: 900;
        position: absolute;
        left: 25px;
        top: 50%;
        transform: translateY(-50%);
        color: #5b7fae;
        font-size: 1.2em;
        z-index: 2;
    }

    .main-nav ul {
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
        margin: 0;
        padding: 0;
    }

    .main-nav li {
        margin: 0 10px;
    }

    .main-content {
        padding-top: 8rem;
    }

.sidebar-toggle {
bottom: 10px;
right: 10px;
top: initial;
left: initial;
}

    .featured-articles h1 {
        font-size: 2.2rem;
    }

    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .espaceprivee-btn {
        padding: 0.6rem !important;
        display: inline-grid !important;
        right: 10px !important;
        text-align: center !important;
        gap: 0 !important;
        font-size: 0.7em !important;
        margin-left: 0 !important;
        position: absolute !important;
        }
        .populaire {
display: inline-block;
margin: 10px 0 !important;
}




.title-tag {
width: 90% !important;
padding: 30px 20px 45px 40px !important;
margin-right: calc(-1 * ((100vw - 100%) / 2));
padding-right: calc((100vw - 100%) / 2);
}

.title-tag h1 {
font-size: 1.3rem !important;
}

footer {

margin-left: 0;
}

.footer-content {
display: inline-grid;
grid-template-columns: repeat(2, 1fr);
}

.espaceprivee-cards-grid {

margin: -2rem auto 2rem !important;

}

.espaceprivee-page .welcome-disconnect-section {
padding: 0 !important;
}


}

@media (max-width: 580px) {
    
    .header-content {
        flex-direction: column;
        padding: 0.8rem;
    }

    .header-actions {
        width: auto;
    }

 main {
        padding:0;
    }

    .main-nav ul {
        justify-content: center;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin: 0;
        padding: 0;
    }

    .main-nav li {
        margin: 0;
    }

    .main-content {
        padding-top: 8rem;
    }

    .featured-articles h1 {
        font-size: 2.2rem;
    }
 
.meter-container {
margin-top: -35px !important;
}

.type-text.question {
margin-top: 20px !important;
position: absolute !important;
width:500px !important;
max-width: 500px !important;
}




    .espaceprivee-btn {
        width: 45px;
        margin-top:42px;
        padding: 5px !important;
        line-height:10px;
        font-size:0.6em !important;
        }
        
        .page-title {
font-size: 1.5rem !important;
}

.article-card {
height: 350px !important;
}

.espaceprivee-page .welcome-disconnect-section .disconnect-button, .disconnect-button {

position: fixed;
top:110px;
right:10px;
}

 /*   .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }
        .category {
padding: 0.2rem 0.5rem;
font-size: 0.55rem;
margin-bottom: 0.2rem;
margin-right: 0.6rem;
margin-left:-0.6rem;
}
        .category-link {
padding: 0.5rem !important;
font-size: 0.8em !important;
}
        .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
*/

}


/* Sur la page d'accueil */

.none {
    display: none;
}

.article-card .article-meta {
    text-align: center;
    margin-top: 0.4rem;
    display: block; 
}

.article-card .article-meta time {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(68, 167, 238, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.article-card .article-excerpt {
    font-size: 1rem;
    line-height: 1.3;
    padding: 0.5em 0;
    color: #606060;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: calc(1rem * 1.4 * 3);
    text-overflow: ellipsis;
}

/* Pour la page article uniquement */
.article-full .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    text-align: left;
}

/* Layout de base (desktop) */



/* Styles pour uniformiser les cartes d'articles sur la page d'accueil */
.article-card {
    width: 100%;
    height: 330px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.article-card .article-title a {
    color: #87b5f1;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.2em;
}

.logo {
z-index:1;
}

/* Private Room Button */
.espaceprivee-btn {
    background-color: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 2.5rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(40, 97, 124, 0.2);
    position: relative;
    overflow: hidden;
    animation: glow 22s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: 0.5s;
}

.espaceprivee-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.8) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    animation: shine 22s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    animation-delay: 0.5s;
}


.espaceprivee-page .welcome-disconnect-section .disconnect-button, .disconnect-button{
    font-size: 0.7rem !important;
    background: #000;
    color: #FFF;
border: 1px solid #333; 
    padding: 3px 6px;
    border-radius: 8px;
    transform-origin: -2%;
     cursor: pointer;
     text-decoration: none; /* Ajout pour supprimer le soulignement */
      display: inline-flex;
    align-items: center;
    margin-left: 1rem; /* Ajout : marge à gauche du bouton */    
}
.espaceprivee-page .welcome-disconnect-section .disconnect-button i, .disconnect-button i {
    margin-left: 0.3rem; /* Ajout : espace à gauche de l'icône */
     order: 1;  /* Modification : l'icône à droite */
}

.user-menu span  {
    background: linear-gradient(to bottom right, #5c7fae, #152236);
    border-radius: 20px; 
padding: 5px;
color: #fff;
}

@keyframes shine {
    0% {
        left: -75%;
        opacity: 0;
    }
    20% {
        left: -25%;
        opacity: 1;
    }
    35% {
        left: 25%;
        opacity: 1;
    }
    50% {
        left: 125%;
        opacity: 0;
    }
    100% {
        left: 125%;
        opacity: 0;
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 2px 4px rgba(40, 97, 124, 0.2);
    }
    20% {
        box-shadow: -8px 2px 15px rgba(91, 127, 174, 0.5),
                    -1px 0 5px rgba(91, 127, 174, 0.4);
    }
    35% {
        box-shadow: 0 2px 20px rgba(91, 127, 174, 0.6),
                    0 0 8px rgba(91, 127, 174, 0.5);
    }
    50% {
        box-shadow: 8px 2px 15px rgba(91, 127, 174, 0.5),
                    1px 0 5px rgba(91, 127, 174, 0.4);
    }
    65% {
        box-shadow: 0 2px 4px rgba(40, 97, 124, 0.2);
    }
    100% {
        box-shadow: 0 2px 4px rgba(40, 97, 124, 0.2);
    }
}

.espaceprivee-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(239, 68, 176, 0.4);
}

.espaceprivee-btn i {
    font-size: 0.9em;
}

/* Styles pour la liste des catégories */
.categories-list {
    max-height: 160px;
    overflow: initial;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
    position: relative;
    will-change: max-height;
}

.categories-list a {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

.categories-list a:nth-child(n+5) {
    opacity: 0;
    transform: translateY(-10px);
}

.categories-list.expanded a:nth-child(n+5) {
    opacity: 1;
    transform: translateY(0);
}

/* Styles spécifiques pour le toggle */
.toggle-categories {
    cursor: pointer;
    text-align: center;
    padding: 8px 0;
    color: #666;
    font-size: 0.8rem;
}

/* Styles pour les icônes du toggle */
.toggle-categories .more i,
.toggle-categories .less i {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 5px;
}

/* Rotation spécifique pour l'icône "moins" */
.toggle-categories .less i.fa-chevron-down {
    transform: rotate(180deg);
}

.toggle-categories:hover {
    color: #444;
}

.highlighted {
    border: 3px solid rgba(239, 68, 176, 0.5);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Sidebar : quatre catégories compactes, sans chevauchement avec le bouton. */
.sidebar-section .categories-list {
    max-height: none;
    overflow: visible;
}

.sidebar-section .categories-list .sidebar-item:nth-child(n+5) {
    display: none;
    opacity: 0;
    transform: none;
}

.sidebar-section .categories-list.expanded .sidebar-item:nth-child(n+5) {
    display: flex;
    opacity: 1;
}

.sidebar-section .toggle-categories {
    position: relative;
    clear: both;
    margin-top: 8px;
}

/* Cartes d'accueil : la taxonomie complète reste sur l'article, la miniature reste lisible. */
.article-card {
    display: flex;
    flex-direction: column;
}

.article-card .article-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.article-card .article-categories .category:nth-child(n+3) {
    display: none;
}

.article-card .article-meta {
    flex: 0 0 auto;
    margin-top: auto;
}

.dynamic-categories-toggle {
    display: none;
}

@media (max-width: 680px) {
    .dynamic-categories {
        gap: 0.4rem;
        margin-bottom: 1rem;
        padding: 0.75rem 0.25rem;
    }

    .dynamic-categories .category-button {
        padding: 0.42rem 0.72rem;
        font-size: 0.78rem;
    }

    .dynamic-categories .category-button:nth-of-type(n+5) {
        display: none;
    }

    .dynamic-categories.expanded .category-button:nth-of-type(n+5) {
        display: inline-flex;
    }

    .dynamic-categories-toggle {
        display: inline-flex;
        align-items: center;
        border: 0;
        background: transparent;
        color: #5b7fae;
        cursor: pointer;
        font: inherit;
        font-size: 0.78rem;
        padding: 0.45rem 0.65rem;
    }

    .dynamic-categories-toggle .less,
    .dynamic-categories.expanded .dynamic-categories-toggle .more {
        display: none;
    }

    .dynamic-categories.expanded .dynamic-categories-toggle .less {
        display: inline;
    }
}
