:root {
    --primary-color: #ff2e63;
    --secondary-color: #08d9d6;
    --accent-color: #ffcc00;
    --dark-color: #252a34;
    --light-color: #eaeaea;
    --flame-highlight: #ff6b35;
    --flame-dark: #cc2e50;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
}

/* Container principal */
.detail-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1f2e 100%);
    padding: 40px 0;
}

/* En-tête de la formation */
.formation-header {
    background: linear-gradient(135deg, var(--primary-color), var(--flame-highlight));
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.formation-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="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    opacity: 0.3;
}

.formation-header .container {
    position: relative;
    z-index: 2;
}

.formation-title {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.formation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.meta-item i {
    color: var(--accent-color);
}

/* Badge de difficulté */
.badge-difficulte {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.badge-debutant {
    background: var(--success-color);
    color: white;
}

.badge-intermediaire {
    background: var(--warning-color);
    color: var(--dark-color);
}

.badge-avance {
    background: var(--danger-color);
    color: white;
}

/* Section principale */
.formation-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.formation-image {
    width: 100%;
    max-width: 400px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.formation-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-color);
    margin-bottom: 30px;
}

/* Boutons d'action */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-inscription {
    background: linear-gradient(135deg, var(--primary-color), var(--flame-highlight));
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-inscription:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 46, 99, 0.3);
    color: white;
    text-decoration: none;
}

.btn-inscrit {
    background: var(--success-color);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Section des avis */
.avis-section {
    background: white;
    border-radius: 15px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-title i {
    color: var(--primary-color);
}

.note-moyenne {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, var(--accent-color), #ffd700);
    border-radius: 15px;
    color: var(--dark-color);
    font-weight: bold;
}

/* Container pour la note moyenne avec boutons */
.note-moyenne-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

.note-moyenne-container .note-moyenne {
    margin-bottom: 0;
    padding: 15px;
    flex: 1;
}

/* Actions des avis */
.avis-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.avis-actions .btn {
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

/* Message vide inline */
.message-vide-inline {
    display: flex;
    align-items: center;
    color: #6c757d;
    font-size: 1.1rem;
    font-weight: 500;
}

.message-vide-inline i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.etoiles {
    display: flex;
    gap: 5px;
}

.etoile {
    color: #ffd700;
    font-size: 1.2rem;
}

.etoile.vide {
    color: #ddd;
}

/* Carte d'avis */
.avis-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s ease;
}

.avis-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.avis-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 15px;
}

.avis-auteur {
    font-weight: bold;
    color: var(--dark-color);
}

.avis-note {
    display: flex;
    gap: 3px;
}

.avis-texte {
    color: #666;
    line-height: 1.6;
}

/* Formations similaires */
.formations-similaires {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.formation-similaire-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.formation-similaire-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.formation-similaire-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.formation-similaire-titre {
    font-weight: bold;
    color: var(--dark-color);
    margin-bottom: 10px;
}

.formation-similaire-note {
    color: var(--primary-color);
    font-weight: bold;
}

/* Message vide */
.message-vide {
    text-align: center;
    padding: 40px;
    color: #666;
}

.message-vide i {
    font-size: 3rem;
    color: #ddd;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .formation-title {
        font-size: 2rem;
    }
    
    .formation-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .formation-content {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn-inscription,
    .btn-inscrit {
        text-align: center;
        justify-content: center;
    }
}

/* Section contenu de la formation */
.formation-contenu-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.formation-contenu-section .section-title {
    color: var(--dark-color);
    font-weight: bold;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formation-contenu-section .section-title i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* Liste des chapitres */
.chapitres-liste {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chapitre-card {
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.chapitre-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(255, 46, 99, 0.1);
}

.chapitre-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.chapitre-titre {
    color: var(--dark-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapitre-titre i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.chapitre-info {
    background: var(--secondary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chapitre-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Liste des leçons */
.lecons-liste {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 20px;
}

.lecon-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    transition: all 0.3s ease;
}

.lecon-item:hover {
    background: #f8f9fa;
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.lecon-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.lecon-info i {
    color: var(--secondary-color);
    font-size: 1rem;
}

.lecon-titre {
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.lecon-duree {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
    font-size: 0.85rem;
    font-weight: 500;
}

.lecon-duree i {
    color: var(--accent-color);
    font-size: 0.9rem;
}

/* Badges de statut des leçons */
.badge-en-ligne {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.badge-hors-ligne {
    background: linear-gradient(135deg, var(--danger-color), #e74c3c);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.badge-en-ligne i,
.badge-hors-ligne i {
    font-size: 0.7rem;
}

/* Styles pour les leçons hors ligne */
.lecon-hors-ligne {
    opacity: 0.7;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef) !important;
    border-left: 4px solid var(--danger-color) !important;
}

.lecon-hors-ligne .lecon-titre {
    color: #6c757d;
    text-decoration: line-through;
}

.lecon-hors-ligne .lecon-info i {
    color: #6c757d !important;
}

.lecon-hors-ligne .lecon-duree {
    color: #adb5bd;
}

/* Animation pour les badges */
.badge-en-ligne,
.badge-hors-ligne {
    transition: all 0.3s ease;
    animation: fadeInBadge 0.5s ease-out;
}

.badge-en-ligne:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

.badge-hors-ligne:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

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

/* Amélioration de la structure lecon-meta */
.lecon-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive pour la section contenu */
@media (max-width: 768px) {
    .formation-contenu-section {
        padding: 20px;
    }
    
    .chapitre-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .lecons-liste {
        padding-left: 10px;
    }
    
    .lecon-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .lecon-duree {
        align-self: flex-end;
    }
    
    .badge-en-ligne,
    .badge-hors-ligne {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
}