/* =====================================================
   STYLES DÉPARTEMENT ENFANTS (MJFG) - VERSION AMÉLIORÉE
   Compatible avec le système de thèmes CMCI Obili
   Inspiré du style bibliothèque pour cohérence
   ===================================================== */

/* ==================== VARIABLES HÉRITÉES ==================== */
/* 
   Les variables de couleur sont héritées du fichier base.css via :root
   --primary-color, --primary-light, --primary-dark
   --secondary-color, --accent-color
   --shadow-color, --shadow-light, --shadow-heavy
   etc.
*/

/* ==================== HEADER DÉPARTEMENT ==================== */
.enfants-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    padding: 40px 30px 30px;
    margin-bottom: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 30px var(--shadow-color);
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.6s ease-out;
}

/* Effet de fond animé rotatif */
.enfants-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

/* Pattern répété en arrière-plan */
.enfants-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 50px,
        rgba(255, 255, 255, 0.03) 50px,
        rgba(255, 255, 255, 0.03) 100px
    );
    pointer-events: none;
}

.enfants-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.enfants-header p {
    font-size: 1.05rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    line-height: 1.4;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.enfants-header i {
    margin-right: 10px;
    font-size: 1em;
    animation: bounce 2s infinite;
}

/* Adaptation pour thème noir */
[data-theme="black"] .enfants-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

/* ==================== NAVIGATION HORIZONTALE ==================== */
.enfants-nav {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 0;
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-light);
    animation: fadeIn 0.6s ease-out 0.3s backwards;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.enfants-nav-container {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.3) rgba(255,255,255,0.1);
}

.enfants-nav-item {
    flex: 0 0 auto;
    padding: 15px 28px;
    color: white;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    backdrop-filter: blur(5px);
}

/* Indicateur animé sous l'item */
.enfants-nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--accent-color);
}

.enfants-nav-item:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateY(-2px);
}

.enfants-nav-item:hover::before {
    width: 80%;
}

.enfants-nav-item.active {
    background: rgba(255,255,255,0.25);
    color: var(--accent-color);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.enfants-nav-item.active::before {
    width: 80%;
}

.enfants-nav-item i {
    margin-right: 8px;
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

.enfants-nav-item:hover i {
    transform: scale(1.2) rotate(5deg);
}

/* ==================== GRILLE DE PUBLICATIONS (Style Bibliothèque) ==================== */
.publications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 35px;
    padding: 30px 0;
}

/* ==================== CARTES PUBLICATIONS (Style Portfolio Amélioré) ==================== */
.card,
.publication-card {
    background: white;
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e8eaed;
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
}

/* Animation séquentielle des cartes */
.card:nth-child(1),
.publication-card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2),
.publication-card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3),
.publication-card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4),
.publication-card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5),
.publication-card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6),
.publication-card:nth-child(6) { animation-delay: 0.6s; }

.card:hover,
.publication-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 45px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

/* Conteneur d'image pour publication */
.publication-image-container {
    position: relative;
    height: 250px;
    background: linear-gradient(135deg, var(--light-bg) 0%, #e9ecef 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 3px solid var(--primary-color);
}

.publication-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .publication-image,
.publication-card:hover .publication-image {
    transform: scale(1.08);
}

.no-image-placeholder {
    color: #cbd5e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.no-image-placeholder i {
    font-size: 4rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.no-image-placeholder span {
    font-size: 0.9rem;
    color: #a0aec0;
}

/* Contenu de la carte */
.card-body,
.publication-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

/* Badge de type/catégorie */
.publication-badge,
.card-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
    margin-bottom: 12px;
}

/* Titre de la carte */
.card-title,
.publication-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 12px;
    line-height: 1.4;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.card:hover .card-title,
.publication-card:hover .publication-title {
    color: var(--primary-color);
}

/* Texte de la carte */
.card-text,
.publication-excerpt {
    color: #4a5568;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Métadonnées (date, auteur, etc.) */
.publication-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #718096;
}

.publication-meta i {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Boutons d'action */
.btn-primary,
.btn-view-publication {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-top: auto;
    box-shadow: 0 4px 15px var(--shadow-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
}

.btn-primary:hover,
.btn-view-publication:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-heavy);
    color: white;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

.btn-primary i,
.btn-view-publication i {
    font-size: 1.1rem;
}

/* Adaptation pour thème noir */
[data-theme="black"] .card,
[data-theme="black"] .publication-card {
    background: var(--medium-bg);
    border-color: var(--border-color);
}

[data-theme="black"] .card-body,
[data-theme="black"] .publication-content {
    background: var(--medium-bg);
}

[data-theme="black"] .card-title,
[data-theme="black"] .publication-title {
    color: var(--dark-text);
}

[data-theme="black"] .card-text,
[data-theme="black"] .publication-excerpt {
    color: rgba(224, 224, 224, 0.8);
}

/* ==================== STATISTIQUES DASHBOARD ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 6px 20px var(--shadow-color);
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out backwards;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: rotate 15s linear infinite;
}

.stats-card:nth-child(1) { animation-delay: 0.1s; }
.stats-card:nth-child(2) { animation-delay: 0.2s; }
.stats-card:nth-child(3) { animation-delay: 0.3s; }
.stats-card:nth-child(4) { animation-delay: 0.4s; }

.stats-card:hover {
    transform: scale(1.03) translateY(-3px);
    box-shadow: 0 10px 35px var(--shadow-heavy);
}

.stats-card i {
    font-size: 2.5em;
    margin-bottom: 10px;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

.stats-card h3 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    z-index: 1;
}

.stats-card p {
    font-size: 1rem;
    opacity: 0.95;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* ==================== PAGES STATIQUES (Objectifs, Organisation) ==================== */
.static-content {
    animation: fadeIn 0.8s ease-out;
}

.objectives-grid {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.objective-item {
    background: white;
    padding: 30px;
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    animation: slideInLeft 0.6s ease-out backwards;
    display: flex;
    align-items: start;
    gap: 20px;
}

.objective-item:nth-child(1) { animation-delay: 0.1s; }
.objective-item:nth-child(2) { animation-delay: 0.2s; }
.objective-item:nth-child(3) { animation-delay: 0.3s; }
.objective-item:nth-child(4) { animation-delay: 0.4s; }

.objective-item:hover {
    transform: translateX(10px);
    box-shadow: 0 8px 30px var(--shadow-color);
    border-left-width: 8px;
}

.objective-item i {
    color: var(--primary-color);
    font-size: 2.5rem;
    min-width: 60px;
}

.objective-content h4 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 700;
}

.objective-content p {
    color: #4a5568;
    line-height: 1.7;
    margin: 0;
}

/* Adaptation pour thème noir */
[data-theme="black"] .objective-item {
    background: var(--medium-bg);
    border-left-color: var(--accent-color);
}

[data-theme="black"] .objective-content h4 {
    color: var(--dark-text);
}

[data-theme="black"] .objective-content p {
    color: rgba(224, 224, 224, 0.8);
}

/* ==================== ÉQUIPE / MEMBRES ==================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.team-member {
    text-align: center;
    padding: 30px 25px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out backwards;
}

.team-member:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 35px var(--shadow-color);
}

.team-member-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 8px 20px var(--shadow-color);
    transition: transform 0.3s ease;
}

.team-member:hover .team-member-avatar {
    transform: scale(1.1) rotate(5deg);
}

.team-member h5 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.team-member p {
    color: #718096;
    font-size: 0.9rem;
    margin: 0;
}

/* Adaptation pour thème noir */
[data-theme="black"] .team-member {
    background: var(--medium-bg);
}

[data-theme="black"] .team-member h5 {
    color: var(--dark-text);
}

/* ==================== ANNONCES (Style Épinglé) ==================== */
.announcements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.announcement-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 30px 25px 25px;
    position: relative;
    transition: all 0.3s ease;
    border-top: 5px solid var(--accent-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.announcement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

/* Punaise d'épinglage */
.announcement-pin {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: #e74c3c;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 2;
}

.announcement-pin::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
}

.announcement-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.announcement-date i {
    color: var(--primary-color);
}

.announcement-card h5 {
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.announcement-card p {
    color: #4a5568;
    line-height: 1.6;
    flex-grow: 1;
}

.announcement-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #718096;
}

/* Adaptation pour thème noir */
[data-theme="black"] .announcement-card {
    background: var(--medium-bg);
    border-top-color: var(--accent-color);
}

[data-theme="black"] .announcement-card h5 {
    color: var(--dark-text);
}

[data-theme="black"] .announcement-card p {
    color: rgba(224, 224, 224, 0.8);
}

/* ==================== MESSAGE VIDE (État vide) ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    animation: fadeIn 0.8s ease-out;
}

.empty-state i {
    font-size: 5rem;
    color: #cbd5e0;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.5rem;
    font-weight: 700;
}

.empty-state p {
    color: #718096;
    font-size: 1rem;
}

/* Adaptation pour thème noir */
[data-theme="black"] .empty-state h3 {
    color: var(--dark-text);
}

[data-theme="black"] .empty-state p {
    color: rgba(224, 224, 224, 0.6);
}

/* ==================== LOADING STATE ==================== */
.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* ==================== SCROLLBAR PERSONNALISÉE ==================== */
.enfants-nav-container::-webkit-scrollbar {
    height: 6px;
}

.enfants-nav-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.enfants-nav-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.enfants-nav-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .publications-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .enfants-header {
        padding: 50px 20px 40px;
    }
    
    .enfants-header h1 {
        font-size: 2rem;
    }
    
    .enfants-header p {
        font-size: 1.1rem;
    }
    
    .enfants-nav-item {
        padding: 15px 25px;
        font-size: 0.9rem;
    }
    
    .publications-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .stats-card {
        padding: 25px 20px;
    }
    
    .stats-card h3 {
        font-size: 2.5rem;
    }
    
    .stats-card i {
        font-size: 2.5em;
    }
    
    .objective-item {
        padding: 20px;
        flex-direction: column;
        text-align: center;
    }
    
    .objective-item i {
        font-size: 2rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }
    
    .announcements-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .publication-image-container {
        height: 200px;
    }
}

@media (max-width: 576px) {
    .enfants-header {
        padding: 30px 15px 25px;
        margin-bottom: 30px;
    }
    
    .enfants-header h1 {
        font-size: 1.6rem;
    }
    
    .enfants-header p {
        font-size: 1rem;
    }
    
    .enfants-nav-item {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .enfants-nav-item i {
        display: block;
        margin: 0 0 5px 0;
        font-size: 1.3em;
    }
    
    .publications-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .announcements-grid {
        grid-template-columns: 1fr;
    }
    
    .card-title,
    .publication-title {
        font-size: 1.1rem;
        min-height: auto;
    }
    
    .card-body,
    .publication-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .btn-primary,
    .btn-view-publication {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== UTILITAIRES ==================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.badge-accent {
    background: var(--accent-color);
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

.section-title {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

[data-theme="black"] .section-title {
    color: var(--accent-color);
}

/* ==================== FIN DU FICHIER ==================== */
