/* ===== DESIGN SYSTEM QIFU - DOUX PASTEL ===== */

/* Variables CSS globales */
:root {
    /* Couleurs principales - Palette Pastel */
    --primary-color: #74b9ff;
    --primary-light: #a29bfe;
    --primary-dark: #0984e3;
    
    --secondary-color: #55efc4;
    --secondary-light: #81ecec;
    --secondary-dark: #00b894;
    
    --accent-color: #ff7675;
    --accent-light: #fd79a8;
    --accent-dark: #e84393;
    
    --success-color: #55efc4;
    --warning-color: #fdcb6e;
    --info-color: #74b9ff;
    
    /* Couleurs de fond - Palette Pastel */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-dark: #636e72;
    --bg-light: #ddd6fe;
    
    /* Couleurs de texte - Palette Pastel */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --text-white: #ffffff;
    
    /* Bordures - Style Pastel Arrondi */
    --border-color: #ddd;
    --border-radius: 20px;
    --border-radius-sm: 15px;
    --border-radius-lg: 25px;
    
    /* Ombres - Douces et Colorées */
    --shadow-sm: 0 2px 10px rgba(116, 185, 255, 0.2);
    --shadow-md: 0 4px 15px rgba(116, 185, 255, 0.3);
    --shadow-lg: 0 8px 25px rgba(116, 185, 255, 0.4);
    
    /* Espacement */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Polices */
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
}

/* ===== TYPOGRAPHIE PASTEL ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

h4 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

h5 {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 1rem;
}

/* ===== SYSTÈME DE BOUTONS PASTEL ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Bouton principal - Style Pastel */
.btn-primary {
    background: var(--secondary-color);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(85, 239, 196, 0.3);
}

.btn-primary:hover {
    background: var(--secondary-dark);
    color: var(--text-white);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(85, 239, 196, 0.4);
}

/* Bouton secondaire - Style Pastel */
.btn-secondary {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    box-shadow: 0 2px 10px rgba(116, 185, 255, 0.3);
}

.btn-secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
}

/* Bouton danger */
.btn-danger {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: var(--text-white);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent-color));
}

/* Bouton succès */
.btn-success {
    background: linear-gradient(135deg, var(--success-color), #229954);
    color: var(--text-white);
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954, var(--success-color));
}

/* Bouton déconnexion - Style Pastel */
.logout-btn {
    background: var(--accent-color);
    color: var(--text-white);
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 118, 117, 0.3);
}

.logout-btn:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.4);
}

/* Bouton simple - Style Pastel */
.simple-btn {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(116, 185, 255, 0.3);
}

.simple-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
}

/* Bouton de fermeture - Style Pastel */
.close-btn {
    background: var(--accent-light);
    border: none;
    color: var(--text-white);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(253, 121, 168, 0.3);
}

.close-btn:hover {
    background: var(--accent-dark);
    transform: scale(1.1);
}

/* ===== SYSTÈME D'INPUTS PASTEL ===== */
.input {
    width: 100%;
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 14px;
    background: #f8f9fa;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(116, 185, 255, 0.1);
}

.input::placeholder {
    color: var(--text-light);
}

.input:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Input avec icône */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    color: var(--text-secondary);
    pointer-events: none;
}

.input-group .input {
    padding-left: calc(var(--spacing-xl) + var(--spacing-md));
}

/* ===== CONTAINERS ET LAYOUTS ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.card {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

/* ===== CLASSES UTILITAIRES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

/* ===== PAGE DE CONNEXION ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-image: url('../media/img/sable zen.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 2;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 10px 20px rgba(0, 0, 0, 0.05);
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.logo-container {
    margin-bottom: var(--spacing-xl);
}

.logo {
    width: 80px;
    height: auto;
    margin-bottom: var(--spacing-md);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

.app-title {
    font-family: var(--font-secondary);
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

/* Styles pour la liste des tags disponibles */
.tags-overview {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.tags-overview h4 {
    margin: 0 0 15px 0;
    color: var(--text-color);
    font-size: 16px;
}

.available-tags-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px 0;
}

.tag-item {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    min-height: 40px;
}

.tag-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tag-name {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
}

.no-tags-available {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.login-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: var(--text-white);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    margin-top: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.error-message {
    color: #e74c3c;
    background: #ffeaea;
    padding: 10px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    font-size: 13px;
    border: 1px solid #f5c6cb;
}

/* ===== PAGE DASHBOARD ===== */
.dashboard-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
/* Header styles removed - header no longer used */

/* Logo animations removed */

/* User section styles removed - moved to sidebar */

.user-role {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role.role-administrateur {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.user-role.role-utilisateur {
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
}

.user-role.role-lecteur {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.settings-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 13px;
}

.settings-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.logout-btn {
    padding: 8px 16px;
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 13px;
}

.logout-btn:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-1px);
}

/* Main Container sans header - pleine hauteur */
.main-container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    height: 100vh;
}

/* Sidebar avec les tags */
.tags-sidebar {
    width: 300px;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    padding: 20px;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
    display: none; /* Caché par défaut */
}

/* Visible uniquement sur l'onglet permissions */
#gestion-permissions.active ~ .tags-sidebar,
.tags-sidebar.show {
    display: block;
}

/* Responsive pour la sidebar des tags */
@media (max-width: 1200px) {
    .tags-sidebar {
        display: none !important;
    }
}

/* Sidebar principale */
.sidebar {
    width: 280px;
    background: var(--bg-primary);
    border-right: 2px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Logo du sidebar */
.sidebar-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.sidebar-logo-img {
    width: 100%;
    height: auto;
    border-radius: 50%;
    box-shadow: var(--shadow-soft);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 15px;
}

.nav-item {
    margin-bottom: var(--spacing-sm);
}

.nav-item.special {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.nav-separator {
    margin: 20px 0 10px 0;
    padding: 0;

}

.separator-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.user-formations-list {
    margin-bottom: 10px;
}

.formation-menu-item {
    margin-bottom: 4px;
}

.formation-link {
    width: 100%;
    text-align: left;
    padding: 10px 30px 10px 40px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 400;
    border-left: 4px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: auto;
}

.formation-link:hover {
    background: rgba(24, 127, 234, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.formation-link.active {
    background: rgba(24, 127, 234, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.formation-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: linear-gradient(135deg, var(--primary-color), #667eea);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

/* Titre complet des formations dans la sidebar */
.formation-menu-item .formation-link .formation-title-full {
    white-space: normal !important;
    word-wrap: break-word !important;
    line-height: 1.3 !important;
    max-width: none !important;
    text-overflow: unset !important;
    overflow: visible !important;
    display: block !important;
    font-size: 13px !important;
}

/* Styles pour l'affichage des formations */
.formation-navigation {
    margin-bottom: 20px;
}

.btn-back {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-back:hover {
    background: var(--primary-hover);
    transform: translateX(-2px);
}

.formation-meta-info {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
}

.meta-badge {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.formation-content {
    line-height: 1.7;
}

.formation-content h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin: 30px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.formation-content h3 {
    color: var(--text-color);
    font-size: 20px;
    margin: 25px 0 12px 0;
}

.formation-content p {
    margin-bottom: 16px;
    text-align: justify;
    color: var(--text-color);
}

.formation-content ul,
.formation-content ol {
    margin: 16px 0;
    padding-left: 20px;
}

.formation-content li {
    margin-bottom: 8px;
    color: var(--text-color);
}

.formation-content blockquote {
    background: rgba(var(--primary-color-rgb), 0.05);
    border-left: 4px solid var(--primary-color);
    margin: 20px 0;
    padding: 20px;
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.formation-content blockquote p {
    margin: 0;
    color: var(--text-color);
}

.nav-link {
    width: 100%;
    text-align: left;
    padding: 15px 30px;
    background: none;
    border: none;
    color: black;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 500;
    border-left: 4px solid transparent;
}

.nav-link:hover {
    background: rgba(24, 127, 234, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.nav-link.active {
    background: rgba(24, 127, 234, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}


/* Bouton de déconnexion dans la sidebar */
.nav-item.logout-item {
    margin-top: auto;
    border-top: 1px solid var(--border-light);
    padding-top: 15px;
}

.nav-item.logout-item .nav-link {
    color: var(--accent-color);
    font-weight: 600;
    background: transparent;
    border: 2px solid var(--accent-color);
    border-radius: var(--border-radius);
    margin: 10px 0;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-item.logout-item .nav-link:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0;
    background: #fafafa;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

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

.tab-content h2 {
    font-family: "Caveat", Sans-serif;
    font-size: 40px;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-weight: 800;
    text-align: center;
}

.content-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    height: 90vh;
}

.content-card h3 {
    font-family: var(--font-secondary);
    font-size: 24px;
    color: var(--secondary-color);
    margin: 25px 0 15px 0;
    font-weight: 600;
}

.content-card h4 {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: var(--primary-color);
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.content-card p {
    margin-bottom: 15px;
    color: var(--text-dark);
    line-height: 1.7;
}

.course-list,
.meditation-types {
    list-style: none;
    margin: 20px 0;
}

.course-list li,
.meditation-types li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-dark);
    position: relative;
    padding-left: 20px;
}

.course-list li:before,
.meditation-types li:before {
    content: "✓";
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.course-list li:last-child,
.meditation-types li:last-child {
    border-bottom: none;
}

.wellbeing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.wellbeing-item {
    background: rgba(24, 127, 234, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    border-left: 4px solid var(--primary-color);
}

.development-areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.area-card {
    background: rgba(249, 152, 47, 0.05);
    border-radius: var(--border-radius);
    padding: 20px;
    border-top: 4px solid var(--secondary-color);
    transition: var(--transition);
}

.area-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.spiritual-quote {
    background: rgba(24, 127, 234, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-family: var(--font-secondary);
    font-size: 18px;
    color: var(--text-dark);
}

/* Section Téléchargements */
.download-section {
    margin-top: 20px;
}

.files-list {
    margin-bottom: 30px;
    background: rgba(24, 127, 234, 0.02);
    border-radius: var(--border-radius);
    padding: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    color: var(--text-dark);
    font-weight: 500;
}

.download-btn {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.download-btn:hover {
    background: #1564c4;
    transform: translateY(-1px);
}

.download-all-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #e6881a 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    width: 100%;
    margin-top: 20px;
}

.download-all-btn:hover {
    background: linear-gradient(135deg, #e6881a 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.no-files {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* ===== MODAL CODE HTML ===== */
.html-code-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 80vh;
}

.html-code-editor {
    display: flex;
    flex-direction: column;
    height: 70vh;
}

.editor-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(24, 127, 234, 0.05);
}

.tab-btn:hover:not(.active) {
    background: rgba(24, 127, 234, 0.02);
    color: var(--text-dark);
}

.tab-content-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tab-pane {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-pane.active {
    display: flex;
}

.html-code-textarea {
    width: 100%;
    flex: 1;
    min-height: 300px;
    padding: 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #f8f9fa;
    color: var(--text-dark);
    resize: vertical;
}

.html-code-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.code-tools {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-light);
}

.quick-templates label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-dark);
}

.template-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.template-btn {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid var(--border-light);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.template-btn:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, #1c7ed6 100%);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.html-preview {
    flex: 1;
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: white;
    overflow-y: auto;
    min-height: 300px;
}

.preview-placeholder {
    color: var(--text-light);
    font-style: italic;
    text-align: center;
    margin-top: 50px;
}

.html-preview h1, .html-preview h2, .html-preview h3 {
    margin-top: 0;
    color: var(--text-dark);
}

.html-preview p {
    line-height: 1.6;
    color: var(--text-dark);
}

/* ===== MODAL YOUTUBE ===== */
.youtube-modal {
    max-width: 700px;
    width: 90vw;
}

.youtube-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.youtube-url-input, .youtube-title-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.youtube-url-input:focus, .youtube-title-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.youtube-description-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.youtube-description-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.youtube-options h3, .youtube-size h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text-dark);
}

.option-group, .size-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.checkbox-label, .radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-dark);
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.3s ease;
}

.checkbox-label:hover, .radio-label:hover {
    background-color: rgba(24, 127, 234, 0.05);
}

.checkmark, .radiomark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.radiomark {
    border-radius: 50%;
}

.checkbox-label input[type="checkbox"], .radio-label input[type="radio"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark,
.radio-label input[type="radio"]:checked + .radiomark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.radio-label input[type="radio"]:checked + .radiomark::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.youtube-preview {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.youtube-preview h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-dark);
}

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

.youtube-embed {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.youtube-embed.responsive {
    width: 100%;
    aspect-ratio: 16/9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .header-title {
        font-size: 20px;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--border-light);
        padding: 20px 0;
    }
    
    .nav-link {
        padding: 12px 20px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .content-card {
        padding: 20px;
    }
    
    .wellbeing-grid,
    .development-areas {
        grid-template-columns: 1fr;
    }
    
    .tab-content h2 {
        font-size: 24px;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .app-title {
        font-size: 24px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .tab-content h2 {
        font-size: 22px;
        margin-bottom: 6px;
    }
}

/* ===== MODAL PARAMÈTRES ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--background-white);
    margin: 5% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-medium);
    animation: slideInDown 0.3s ease-out;
    border: 1px solid var(--border-light);
}

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

.modal-header {
    padding: 25px 30px 15px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-secondary);
    font-size: 24px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--secondary-color);
    background: rgba(249, 152, 47, 0.1);
}

.credentials-form {
    padding: 25px 30px 30px;
}

.form-section h3 {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.form-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: 25px 0;
    border-radius: 1px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.cancel-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-light);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
}

.cancel-btn:hover {
    background: var(--border-light);
    color: var(--text-dark);
    transform: translateY(-1px);
}

.save-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1564c4 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
}

.save-btn:hover {
    background: linear-gradient(135deg, #1564c4 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.success-message {
    color: #27ae60;
    background: #d5f4e6;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    margin-top: 15px;
    font-size: 13px;
    border: 1px solid #a3d2ca;
    border-left: 4px solid #27ae60;
}

/* Responsive pour le modal */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header {
        padding: 20px 25px 10px;
    }
    
    .modal-header h2 {
        font-size: 20px;
    }
    
    .credentials-form {
        padding: 20px 25px 25px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .cancel-btn,
    .save-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== INTERFACE D'ADMINISTRATION ===== */

.admin-section {
    width: 100%;
}

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

.admin-header h3 {
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 24px;
    color: var(--secondary-color);
    font-weight: 600;
}

.add-user-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1564c4 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.add-user-btn:hover {
    background: linear-gradient(135deg, #1564c4 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.users-table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 13px;
}

.users-table th {
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.users-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.users-table tr:hover {
    background: rgba(24, 127, 234, 0.02);
}

.role-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.role-badge.role-administrateur {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.role-badge.role-utilisateur {
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
}

.role-badge.role-lecteur {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    min-width: 60px;
    text-align: center;
}

.status-badge.status-active {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.status-badge.status-inactive {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.actions-cell {
    text-align: center;
    white-space: nowrap;
}

.actions-cell button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    margin: 0 2px;
    border-radius: 6px;
    font-size: 16px;
    transition: var(--transition);
}

.edit-btn:hover {
    background: rgba(24, 127, 234, 0.1);
    transform: scale(1.1);
}

.toggle-status-btn:hover {
    background: rgba(249, 152, 47, 0.1);
    transform: scale(1.1);
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

/* Modal utilisateur */
.user-form {
    padding: 25px 30px 30px;
}

.user-form .form-group {
    margin-bottom: 20px;
}

.user-form select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    font-family: var(--font-primary);
    background: white;
}

.user-form select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.user-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-form input[type="checkbox"] {
    width: auto;
    transform: scale(1.2);
}

/* Modal de confirmation */
.confirm-modal {
    max-width: 400px;
}

.confirm-content {
    padding: 25px 30px 30px;
    text-align: center;
}

.confirm-content p {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.confirm-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.delete-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
}

.delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Responsive pour l'administration */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .add-user-btn {
        width: 100%;
        text-align: center;
    }
    
    .users-table {
        font-size: 12px;
    }
    
    .users-table th,
    .users-table td {
        padding: 8px 6px;
    }
    
    .role-badge,
    .status-badge {
        font-size: 10px;
        padding: 3px 6px;
        min-width: auto;
    }
    
    .actions-cell button {
        padding: 4px 6px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .users-table-container {
        font-size: 11px;
    }
    
    .users-table th:nth-child(n+6),
    .users-table td:nth-child(n+6) {
        display: none;
    }
    
    .admin-header h3 {
        font-size: 20px;
    }
}

/* ===== GESTION DES FORMATIONS ===== */

.formations-section {
    width: 100%;
}

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

.formations-header h3 {
    margin: 0;
    font-family: var(--font-secondary);
    font-size: 24px;
    color: var(--secondary-color);
    font-weight: 600;
}

.create-formation-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #e6881a 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.create-formation-btn:hover {
    background: linear-gradient(135deg, #e6881a 0%, var(--secondary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.formations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.formation-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition);
}

.formation-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
}

.formation-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(24, 127, 234, 0.1), rgba(249, 152, 47, 0.1));
}

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

.formation-content {
    padding: 20px;
}

.formation-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.formation-header h4 {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
    flex: 1;
}

.formation-badges {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-end;
}

.category-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.category-badge.category-cours-generaux {
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
}

.category-badge.category-meditation {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.category-badge.category-bien-etre {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.category-badge.category-spiritualite {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.category-badge.category-developpement {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.status-badge.status-published {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.status-badge.status-draft {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.formation-description {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.formation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 12px;
    color: var(--text-light);
}

.formation-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.formation-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.edit-formation-btn {
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
}

.edit-formation-btn:hover {
    background: linear-gradient(135deg, #1564c4, var(--primary-color));
    transform: translateY(-1px);
}

.preview-formation-btn {
    background: linear-gradient(135deg, var(--secondary-color), #e6881a);
    color: white;
}

.preview-formation-btn:hover {
    background: linear-gradient(135deg, #e6881a, var(--secondary-color));
    transform: translateY(-1px);
}

.toggle-publish-btn {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
}

.toggle-publish-btn:hover {
    background: linear-gradient(135deg, #229954, #27ae60);
    transform: translateY(-1px);
}

.delete-formation-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.delete-formation-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-1px);
}

.no-formations {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    background: rgba(24, 127, 234, 0.02);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-light);
}

.no-formations p {
    margin-bottom: 10px;
    font-size: 16px;
}

/* ===== MODAL DE FORMATION ===== */

.formation-modal .modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: 1200px;
    height: 800px;
    margin: 2.5vh auto;
    display: flex;
    flex-direction: column;
}

.formation-editor {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-sidebar {
    width: 300px;
    background: #f8f9fa;
    border-right: 2px solid var(--border-light);
    padding: 20px;
    overflow-y: auto;
}

.editor-sidebar h3 {
    font-family: var(--font-secondary);
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.editor-sidebar .form-group {
    margin-bottom: 15px;
}

.editor-sidebar label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 12px;
}

.editor-sidebar input,
.editor-sidebar select,
.editor-sidebar textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-light);
    border-radius: 6px;
    font-size: 13px;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.editor-sidebar input:focus,
.editor-sidebar select:focus,
.editor-sidebar textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 127, 234, 0.1);
}

.editor-sidebar small {
    color: var(--text-light);
    font-size: 11px;
}

.image-preview {
    margin-top: 10px;
}

.editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.preview-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, var(--secondary-color), #e6881a);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.preview-btn:hover {
    background: linear-gradient(135deg, #e6881a, var(--secondary-color));
    transform: translateY(-1px);
}

.save-btn {
    flex: 1;
    padding: 10px;
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.save-btn:hover {
    background: linear-gradient(135deg, #1564c4, var(--primary-color));
    transform: translateY(-1px);
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-toolbar {
    background: var(--background-white);
    border-bottom: 2px solid var(--border-light);
    padding: 15px 20px;
}

.content-toolbar h3 {
    font-family: var(--font-secondary);
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.toolbar-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tool-btn {
    padding: 8px 12px;
    background: var(--background-white);
    border: 2px solid var(--border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.tool-icon {
    font-weight: bold;
}

.content-editor {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.editor-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    background: var(--background-white);
    border-radius: var(--border-radius);
    border: 2px dashed var(--border-light);
}

.element-item {
    background: var(--background-white);
    border: 2px solid var(--border-light);
    border-radius: var(--border-radius);
    margin-bottom: 15px;
    position: relative;
    transition: var(--transition);
}

.element-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-soft);
}

.element-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: var(--transition);
}

.element-item:hover .element-controls {
    opacity: 1;
}

.element-controls button {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: var(--transition);
}

.move-up, .move-down {
    background: var(--primary-color);
    color: white;
}

.move-up:hover, .move-down:hover {
    background: #1564c4;
}

.delete-element {
    background: #e74c3c;
    color: white;
}

.delete-element:hover {
    background: #c0392b;
}

.element-item input,
.element-item textarea {
    width: 100%;
    padding: 15px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: var(--font-primary);
    resize: vertical;
}

.element-item input:focus,
.element-item textarea:focus {
    outline: none;
}

.heading-input {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    font-family: var(--font-secondary);
}

.subheading-input {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary-color);
    font-family: var(--font-secondary);
}

.paragraph-input {
    line-height: 1.6;
    color: var(--text-dark);
}

.list-container,
.quote-container,
.media-container,
.exercise-container {
    padding: 15px;
}

.list-container small {
    color: var(--text-light);
    font-size: 11px;
    margin-top: 5px;
    display: block;
}

.quote-container {
    background: rgba(24, 127, 234, 0.05);
    border-left: 4px solid var(--primary-color);
}

.quote-input {
    font-style: italic;
    font-family: var(--font-secondary);
    font-size: 16px;
    margin-bottom: 10px;
}

.quote-author {
    font-size: 12px;
    color: var(--text-light);
}

.media-container input[type="file"] {
    margin-bottom: 10px;
}

.preview-image,
.preview-audio,
.preview-video {
    margin: 10px 0;
    border-radius: 6px;
}

.change-media-btn {
    padding: 8px 12px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: var(--transition);
}

.change-media-btn:hover {
    background: #e6881a;
}

.divider-preview {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
}

.divider-preview hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: 10px 0;
}

.exercise-container {
    background: rgba(249, 152, 47, 0.05);
    border-left: 4px solid var(--secondary-color);
}

.exercise-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

/* ===== MODAL DE PRÉVISUALISATION ===== */

.preview-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    height: 600px;
    margin: 5vh auto;
}

.preview-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.formation-preview-header {
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.formation-preview-header h1 {
    font-family: var(--font-secondary);
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.formation-preview-content .content-heading {
    font-family: var(--font-secondary);
    font-size: 28px;
    color: var(--primary-color);
    margin: 30px 0 15px 0;
    font-weight: 600;
}

.formation-preview-content .content-subheading {
    font-family: var(--font-secondary);
    font-size: 24px;
    color: var(--secondary-color);
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.formation-preview-content .content-paragraph {
    line-height: 1.7;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.formation-preview-content .content-list {
    margin: 20px 0;
    padding-left: 25px;
}

.formation-preview-content .content-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.formation-preview-content .content-quote {
    background: rgba(24, 127, 234, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 25px 0;
    font-style: italic;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-family: var(--font-secondary);
    font-size: 18px;
}

.formation-preview-content .content-quote cite {
    display: block;
    text-align: right;
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
    font-style: normal;
}

.formation-preview-content .content-image,
.formation-preview-content .content-audio,
.formation-preview-content .content-video {
    margin: 25px 0;
    text-align: center;
}

.formation-preview-content .image-caption {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 8px;
    font-style: italic;
}

.formation-preview-content .content-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: 30px 0;
}

.formation-preview-content .content-exercise {
    background: rgba(249, 152, 47, 0.05);
    border-left: 4px solid var(--secondary-color);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.formation-preview-content .exercise-title {
    font-family: var(--font-secondary);
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.formation-preview-content .exercise-instruction {
    line-height: 1.6;
    color: var(--text-dark);
}

.formation-preview-content .no-content {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 40px;
}

/* Responsive pour les formations */
@media (max-width: 768px) {
    .formations-grid {
        grid-template-columns: 1fr;
    }
    
    .formation-modal .modal-content {
        width: 95vw;
        height: 95vh;
        margin: 2.5vh auto;
    }
    
    .formation-editor {
        flex-direction: column;
    }
    
    .editor-sidebar {
        width: 100%;
        max-height: 300px;
        border-right: none;
        border-bottom: 2px solid var(--border-light);
    }
    
    .toolbar-buttons {
        justify-content: center;
    }
    
    .tool-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .formations-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .create-formation-btn {
        width: 100%;
        text-align: center;
    }
    
    .formation-actions {
        justify-content: center;
    }
    
    .formation-actions button {
        flex: 1;
        text-align: center;
    }
    
    .preview-modal .modal-content {
        width: 95vw;
        height: 95vh;
    }
    
    .preview-content {
        padding: 20px;
    }
    
    .formation-preview-header h1 {
        font-size: 24px;
    }
}

/* ===== FORMATIONS INTÉGRÉES DANS LE CONTENU ===== */

.formations-section-content {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid var(--border-light);
}

.formations-section-content h3 {
    font-family: var(--font-secondary);
    font-size: 22px;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-weight: 600;
}

.formations-list {
    display: grid;
    gap: 20px;
}

.formation-item {
    display: flex;
    background: rgba(24, 127, 234, 0.02);
    border-radius: var(--border-radius);
    padding: 15px;
    border: 1px solid var(--border-light);
    transition: var(--transition);
    align-items: center;
    gap: 15px;
}

.formation-item:hover {
    background: rgba(24, 127, 234, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
}

.formation-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(24, 127, 234, 0.1), rgba(249, 152, 47, 0.1));
}

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

.formation-item-content {
    flex: 1;
    min-width: 0;
}

.formation-item-content h4 {
    font-family: var(--font-secondary);
    font-size: 18px;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    font-weight: 600;
}

.formation-item-content p {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.formation-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--text-light);
}

.view-formation-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), #1564c4);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: var(--transition);
    font-family: var(--font-primary);
}

.view-formation-btn:hover {
    background: linear-gradient(135deg, #1564c4, var(--primary-color));
    transform: translateY(-1px);
}

/* Responsive pour les formations intégrées */
@media (max-width: 768px) {
    .formation-item {
        flex-direction: column;
        text-align: center;
    }
    
    .formation-item-image {
        width: 120px;
        height: 120px;
        align-self: center;
    }
    
    .formation-item-meta {
        justify-content: center;
    }
    
    .view-formation-btn {
        align-self: center;
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .formations-section-content h3 {
        font-size: 20px;
    }
    
    .formation-item {
        padding: 12px;
    }
    
    .formation-item-content h4 {
        font-size: 16px;
    }
    
    .formation-item-content p {
        font-size: 12px;
    }
}

/* ===== STYLES POUR LA GESTION DES TAGS D'UTILISATEURS ===== */

.tags-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.tags-info i {
    color: var(--primary-color);
    font-size: 18px;
}

.tags-info span {
    color: #666;
    font-weight: 500;
}

.users-tags-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 20px;
}

.users-tags-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.users-tags-table thead {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
}

.users-tags-table th {
    padding: 20px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.users-tags-table td {
    padding: 20px 15px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.users-tags-table tbody tr:hover {
    background: #f8f9fa;
}

.user-info-cell strong {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.user-info-cell small {
    color: #666;
    font-size: 12px;
}

.role-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-badge.role-administrateur {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.role-badge.role-utilisateur {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
}

.role-badge.role-lecteur {
    background: linear-gradient(135deg, #28a745, #1e7e34);
    color: white;
}

.tags-cell {
    max-width: 300px;
}

.assigned-tags-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tag-badge {
    background: linear-gradient(135deg, var(--secondary-color), #6a4c93);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.no-tags-text {
    color: #999;
    font-style: italic;
    font-size: 12px;
}

.more-tags {
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 10px;
}

.btn-manage-tags {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-manage-tags:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 107, 107, 0.3);
}

/* Styles modernes pour le modal de gestion des accès */
.modern-modal {
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.6);
}

.modern-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modern-header {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
}

.header-content {
    flex: 1;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.header-content h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

#userTagsModalTitle {
    color: black !important;
    line-height: 1.3;
}

.header-subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
    line-height: 1.4;
}

.modern-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modern-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(85vh - 200px);
}

.user-info-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
}

.user-details h3 {
    margin: 0 0 8px 0;
    color: var(--text-color);
    font-size: 20px;
    font-weight: 600;
}

.formations-grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.formations-section {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.formations-section.accessible {
    border-color: #28a745;
}

.formations-section.restricted {
    border-color: #dc3545;
}

.section-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.section-info h4 {
    margin: 0 0 5px 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 600;
}

.count-badge {
    background: linear-gradient(135deg, var(--secondary-color), #6a4c93);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.formations-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.formation-access-card {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    margin-bottom: 1px;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    min-height: 26px;
    max-width: 200px;
    width: fit-content;
}

.formation-access-card:hover {
    transform: none;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.formation-access-card.accessible {
    border-color: rgba(40, 167, 69, 0.2);
    background: linear-gradient(135deg, #f8fff9, #f0f8f0);
}

.formation-access-card.accessible:hover {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fff0, #e8f5e8);
}

.formation-access-card.restricted {
    border-color: rgba(220, 53, 69, 0.2);
    background: linear-gradient(135deg, #fff8f8, #f8f0f0);
}

.formation-access-card.restricted:hover {
    border-color: #dc3545;
    background: linear-gradient(135deg, #ffe8e8, #f0e8e8);
}

.formation-image-thumb {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

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

.formation-content {
    flex: 1;
    min-width: 0;
}

.formation-title {
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 250px;
    flex: 1;
}

.formation-description {
    display: none;
}

.access-toggle {
    flex-shrink: 0;
}

.toggle-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 8px;
    transition: all 0.3s ease;
    font-weight: bold;
    flex-shrink: 0;
}

.accessible .toggle-icon {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.restricted .toggle-icon {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.formation-access-card:hover .toggle-icon {
    transform: scale(1.02);
}

.no-formations {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.modern-footer {
    background: #f8f9fa;
    padding: 20px 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    border-top: 1px solid #e9ecef;
}

.btn-secondary,
.btn-primary {
    padding: 15px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

.formation-tag {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.formation-tag.available {
    border-color: #28a745;
}

.formation-tag.available:hover {
    background: #f8fff9;
    border-color: #20c997;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.formation-tag.assigned {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #fff5f5, #ffeaea);
}

.tag-title {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    display: block;
}

.tag-category {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-tag,
.btn-remove-tag {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-add-tag {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

.btn-add-tag:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-remove-tag {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.btn-remove-tag:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.no-available-tags,
.no-tags {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.no-tags {
    display: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
    display: block;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 0;
    line-height: 1.6;
}


/* Responsive pour les tags d'utilisateurs */
@media (max-width: 768px) {
    .users-tags-table-container {
        overflow-x: auto;
    }
    
    .users-tags-table {
        min-width: 600px;
    }
    
    .assigned-tags-preview {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .modern-modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .modern-header {
        padding: 20px;
    }
    
    .header-content h2 {
        font-size: 20px;
    }
    
    .modern-body {
        padding: 20px;
    }
    
    .formations-grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .user-info-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .formation-access-card {
        flex-direction: row;
        text-align: left;
        padding: 3px 4px;
        gap: 3px;
        max-width: 180px;
    }
    
    .formation-title {
        font-size: 9px;
        max-width: 100px;
    }
    
    .formation-image-thumb {
        width: 16px;
        height: 16px;
    }
    
    .toggle-icon {
        width: 14px;
        height: 14px;
        font-size: 7px;
    }
    
    .modern-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
}

/* ===== ONGLETS DYNAMIQUES DE FORMATIONS ===== */
.formation-tab-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 10px;
}

.formation-tab-link .tab-title {
    flex: 1;
    text-align: left;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.formation-tab-link .close-tab {
    opacity: 0;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}

.formation-tab-link:hover .close-tab,
.formation-tab-link.active .close-tab {
    opacity: 1;
}

.formation-tab-link .close-tab:hover {
    background-color: rgba(255, 0, 0, 0.1);
    color: #dc3545;
}

/* Contenu des onglets de formations */
.formation-tab-content {
    padding: 20px;
}

.formation-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}

.formation-header h2 {
    color: var(--primary-color);
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

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

.formation-tag {
    background: linear-gradient(135deg, var(--primary-color), #0066cc);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.formation-description {
    color: var(--text-light);
    font-style: italic;
    margin: 10px 0 0 0;
    line-height: 1.5;
}

/* Responsive pour les onglets de formations */
@media (max-width: 768px) {
    .formation-tab-link .tab-title {
        max-width: 100px;
    }
    
    .formation-header h2 {
        font-size: 24px;
    }
    
    .formation-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== STYLES POUR LES ÉLÉMENTS DE L'ÉDITEUR ===== */

.editor-element {
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.editor-element:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(98, 0, 255, 0.1);
}

.element-toolbar {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.element-type {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.remove-element {
    background: #dc3545;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-element:hover {
    background: #c82333;
    transform: scale(1.1);
}

.element-content {
    padding: 15px;
}

/* Styles spécifiques pour les éléments YouTube */
.youtube-element .element-toolbar {
    background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
    color: white;
}

.youtube-element .element-type {
    color: white;
}

.youtube-embed {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.youtube-embed:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.youtube-embed.responsive {
    transform: none !important;
}

/* Amélioration de l'affichage des vidéos responsives */
.youtube-element .element-content {
    padding: 10px;
}

.youtube-element h3 {
    margin: 10px 0 15px 0 !important;
    font-size: 18px;
    font-weight: 600;
}

.youtube-element p {
    margin: 15px 0 10px 0 !important;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== SYSTÈME DE PERMISSIONS PAR SECTIONS ===== */

/* Interface du profil avec sections accessibles */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color)10 0%, var(--secondary-color)10 100%);
    border-radius: var(--border-radius);
}

.profile-info h3 {
    margin: 0 0 10px 0;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
}

.profile-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 16px;
}

.profile-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    min-width: 120px;
    text-align: center;
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.stat-content h4 {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Grille des sections accessibles */
.profile-sections {
    margin: 30px 0;
}

.profile-sections h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text-dark);
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.section-card {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 15px;
}

.section-card:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.section-icon {
    font-size: 32px;
    min-width: 50px;
    text-align: center;
}

.section-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 600;
}

.section-info p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Actions rapides */
.profile-actions {
    margin-top: 30px;
}

.profile-actions h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--text-dark);
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.quick-action-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(24, 127, 234, 0.3);
}

/* Interface de gestion des sections */
.sections-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1976d2;
    font-size: 14px;
}

.sections-info i {
    font-size: 16px;
}

.sections-overview {
    margin-bottom: 30px;
}

.sections-overview h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: var(--text-dark);
}

.available-sections-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.section-tag {
    background: white;
    padding: 15px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-tag .section-icon {
    font-size: 24px;
    min-width: 40px;
}

.section-tag .section-info {
    flex: 1;
}

.section-tag .section-info strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text-dark);
    font-size: 14px;
}

.section-description {
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.3;
}

.admin-only-badge {
    background: #f44336;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

/* Table des permissions de sections */
.users-sections-table-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.users-sections-table {
    width: 100%;
    border-collapse: collapse;
}

.users-sections-table th {
    background: var(--primary-color);
    color: white;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.users-sections-table td {
    padding: 15px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.users-sections-table tr:last-child td {
    border-bottom: none;
}

.users-sections-table tr:hover {
    background: #f8f9fa;
}

.user-info strong {
    display: block;
    font-size: 14px;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.user-info small {
    font-size: 12px;
    color: var(--text-light);
}

.sections-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.section-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 150px;
    overflow: hidden;
}

.section-badge:hover {
    transform: scale(1.05);
    transition: var(--transition);
}

/* Gestion du site */
.site-management {
    margin-top: 20px;
}

.site-management h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-dark);
}

.pages-list {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
}

.page-item {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-item h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: var(--text-dark);
}

.page-item p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
}

.edit-page-btn, .add-page-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.edit-page-btn:hover, .add-page-btn:hover {
    background: #e68a00;
    transform: translateY(-1px);
}

.add-page-btn {
    padding: 12px 20px;
    font-weight: 600;
}

/* Médiathèque */
.media-section {
    margin-top: 20px;
    height: 90vh;
}

.media-upload {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    border: 2px dashed #dee2e6;
    margin-bottom: 30px;
    text-align: center;
}

.media-upload h3 {
    margin: 0 0 15px 0;
    color: var(--text-dark);
}

.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.upload-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
}

.media-gallery {
    margin-top: 30px;
}

.media-gallery h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: var(--text-dark);
}

.files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.file-item {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    transition: var(--transition);
}

.file-item:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-2px);
}

.file-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.file-info {
    padding: 15px;
}

.file-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info p {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: var(--text-light);
}

.download-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.download-btn:hover {
    background: #e68a00;
}

/* Responsive pour les nouvelles interfaces */
@media (max-width: 768px) {
    .profile-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .profile-stats {
        width: 100%;
        justify-content: space-around;
    }
    
    .sections-grid {
        grid-template-columns: 1fr;
    }
    
    .available-sections-list {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .files-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .section-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .section-icon {
        min-width: auto;
    }
    
    .file-item {
        margin: 0;
    }
    
    .users-sections-table {
        font-size: 12px;
    }
    
    .users-sections-table th,
    .users-sections-table td {
        padding: 10px 8px;
    }
}

/* ===== MODAL DE GESTION DES PERMISSIONS DE SECTIONS ===== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.section-permissions-modal {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.user-info-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

.user-info-summary p {
    margin: 5px 0;
    font-size: 14px;
}

.sections-permissions-form h4 {
    margin: 0 0 10px 0;
    color: var(--text-dark);
    font-size: 16px;
}

.form-hint {
    margin: 0 0 20px 0;
    color: var(--text-light);
    font-size: 14px;
}

.sections-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.section-checkbox-item {
    background: white;
    border: 1px solid var(--border-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.section-checkbox-item:hover {
    box-shadow: var(--shadow-soft);
}

.section-checkbox-label {
    display: flex;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    gap: 12px;
    width: 100%;
}

.section-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
}

.section-checkbox-content {
    flex: 1;
}

.section-checkbox-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.section-checkbox-header .section-icon {
    font-size: 20px;
    min-width: 25px;
}

.section-checkbox-header strong {
    font-size: 14px;
    color: var(--text-dark);
}

.default-section-badge {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-description {
    margin: 0;
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.3;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.btn-cancel, .btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-save {
    background: var(--primary-color);
    color: white;
}

.btn-save:hover {
    background: #1565c0;
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.no-sections {
    color: var(--text-light);
    font-style: italic;
    font-size: 13px;
}

.unknown-section {
    background: #f8d7da;
    border-left: 3px solid #dc3545;
    color: #721c24;
}

/* Responsive pour la modal */
@media (max-width: 768px) {
    .section-permissions-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header, .modal-body {
        padding: 15px;
    }
    
    .section-checkbox-label {
        padding: 12px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-cancel, .btn-save {
        width: 100%;
    }
}

/* ===== SYSTÈME UNIFIÉ DE PERMISSIONS ===== */

/* Styles pour le système unifié de permissions */
.unified-permissions-interface {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.unified-permissions-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    text-align: center;
}

.unified-permissions-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.8em;
}

.unified-permissions-header p {
    margin: 0;
    opacity: 0.9;
}

.permissions-controls {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.permissions-controls .search-group {
    flex: 1;
    min-width: 250px;
}

.permissions-controls .filter-group {
    min-width: 150px;
}

.permissions-controls .actions-group {
    display: flex;
    gap: 10px;
}

.permissions-controls input,
.permissions-controls select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.permissions-controls button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.refresh-btn {
    background: #28a745;
    color: white;
}

.refresh-btn:hover {
    background: #218838;
}

/* Table des permissions unifiées */
.unified-permissions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.unified-permissions-table th {
    background: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.unified-permissions-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.unified-permissions-table tbody tr:hover {
    background: #f8f9fa;
}

.user-info {
    min-width: 150px;
}

.user-info strong {
    display: block;
    color: #333;
    margin-bottom: 2px;
}

.user-info small {
    display: block;
    color: #6c757d;
    font-size: 0.85em;
}

.user-email {
    font-style: italic;
}

.permissions-column {
    min-width: 200px;
    max-width: 300px;
}

.permission-badge {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
    border: 1px solid transparent;
}

.section-badge {
    background: rgba(0,123,255,0.1);
    color: #0056b3;
}

.formation-badge {
    background: rgba(40,167,69,0.1);
    color: #155724;
    border-left: 3px solid #28a745;
}

.no-permissions {
    color: #6c757d;
    font-style: italic;
    font-size: 0.85em;
}

.total-permissions {
    text-align: center;
    font-weight: bold;
    color: #007bff;
    font-size: 1.1em;
}

.actions-cell {
    white-space: nowrap;
}

.btn-edit,
.btn-details {
    padding: 6px 10px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.2s;
}

.btn-edit {
    background: #007bff;
    color: white;
}

.btn-edit:hover {
    background: #0056b3;
}

.btn-details {
    background: #6c757d;
    color: white;
}

.btn-details:hover {
    background: #545b62;
}

.loading-row,
.empty-row {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

/* Modal pour permissions unifiées */
.unified-permissions-modal {
    max-width: 800px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.user-info-summary {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.permissions-tabs {
    margin-bottom: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
    background: rgba(0,123,255,0.05);
}

.tab-button:hover:not(.active) {
    background: #f8f9fa;
    color: #495057;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.form-hint {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

.permissions-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 10px;
}

.permission-checkbox-item {
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s;
}

.permission-checkbox-item:hover {
    background: #f8f9fa;
}

.permission-checkbox-label {
    display: block;
    cursor: pointer;
    padding: 12px;
    margin: 0;
}

.permission-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.permission-checkbox-content {
    display: inline-block;
    width: calc(100% - 30px);
    vertical-align: top;
}

.permission-checkbox-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.permission-icon {
    font-size: 1.2em;
}

.admin-only-badge,
.default-section-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
}

.admin-only-badge {
    background: #dc3545;
    color: white;
}

.default-section-badge {
    background: #28a745;
    color: white;
}

.permission-description {
    margin: 5px 0;
    color: #6c757d;
    font-size: 0.9em;
}

.permission-tag {
    color: #007bff;
    font-family: monospace;
    font-size: 0.8em;
}

/* Modal de détails des permissions */
.permission-details-modal {
    max-width: 700px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.user-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.user-summary h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.permissions-details {
    display: grid;
    gap: 20px;
}

.permissions-section h4 {
    color: #495057;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.permission-detail-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    border-left: 4px solid #007bff;
}

.permission-detail-item strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.permission-detail-item p {
    margin: 5px 0;
    color: #6c757d;
}

.permission-detail-item small {
    color: #6c757d;
    font-style: italic;
}

/* Tags disponibles dans les onglets latéraux */
.available-tags-section {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.available-tags-header {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

/* Visualiseur PDF pour les formations */
.formation-pdf-viewer {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.pdf-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.pdf-viewer-header h3 {
    margin: 0;
    color: #495057;
}

.close-pdf-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.close-pdf-btn:hover {
    background: #c82333;
}

.pdf-viewer-container {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.pdf-indicator {
    color: #28a745;
    font-size: 0.9em;
    font-weight: 500;
}

/* Modal de création de formation */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.modal-close:hover {
    color: #dc3545;
}

.modal-body {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-cancel:hover {
    background: #5a6268;
}

.btn-submit {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: #0056b3;
}

.available-tags-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.2em;
}

.available-tags-list {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.tag-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: all 0.2s;
}

.tag-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.tag-icon {
    font-size: 1.5em;
    margin-right: 12px;
    width: 40px;
    text-align: center;
}

.tag-info {
    flex: 1;
}

.tag-info strong {
    display: block;
    color: #333;
    margin-bottom: 3px;
}

.tag-code {
    background: rgba(0,123,255,0.1);
    color: #007bff;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    font-family: monospace;
    margin-left: 8px;
}

.tag-description {
    margin: 5px 0 0 0;
    color: #6c757d;
    font-size: 0.9em;
}

.default-badge,
.admin-badge {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7em;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 8px;
}

.default-badge {
    background: #28a745;
    color: white;
}

.admin-badge {
    background: #dc3545;
    color: white;
}

.no-tags {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 30px;
}

/* Modal overlay commune */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(3px);
}

.modal-overlay .modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.btn-cancel,
.btn-save {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #545b62;
}

.btn-save {
    background: #007bff;
    color: white;
}

.btn-save:hover {
    background: #0056b3;
}

/* Responsiveness */
@media (max-width: 768px) {
    .permissions-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .permissions-controls .search-group,
    .permissions-controls .filter-group {
        min-width: auto;
    }
    
    .bulk-tags-selection {
        grid-template-columns: 1fr;
    }
    
    .unified-permissions-table {
        font-size: 12px;
    }
    
    .permissions-column {
        min-width: 150px;
        max-width: 200px;
    }
    
    .unified-permissions-modal,
    .permission-details-modal {
        width: 95vw;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    transform: translateX(100%);
    animation-fill-mode: forwards;
}

@keyframes slideInRight {
    to {
        transform: translateX(0);
    }
}

.notification.success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8, #007bff);
}

.notification-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* ========================================
   STYLES SPÉCIFIQUES GESTION FORMATIONS PERMISSIONS
   ======================================== */

/* Container principal pour les permissions formations (sans sidebar) */
.formation-permissions-manager {
    max-width: 100%;
}

.formations-permissions-container-full {
    width: 100%;
}

/* Zone principale des permissions formations (pleine largeur) */
.formations-permissions-main-full {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    border: 1px solid var(--border-light);
    width: 100%;
}

/* Table des permissions formations */
.formation-permissions-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.formation-permissions-table th,
.formation-permissions-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

.formation-permissions-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.formation-permissions-table tbody tr:hover {
    background: #f8f9fa;
}

/* Colonnes spécifiques */
.formations-column {
    max-width: 300px;
}

.formation-permission-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin: 2px;
    border: 1px solid #bbdefb;
}

.total-formations {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    min-width: 24px;
    text-align: center;
}

/* Checkboxes utilisateurs formations */
.formation-user-checkbox {
    transform: scale(1.2);
    margin: 0;
}

/* Boutons d'actions formations */
.actions-cell .btn-edit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 5px;
    transition: var(--transition);
}

.actions-cell .btn-edit:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Modal permissions formations */
.formation-permissions-modal .modal-content {
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
}

.formations-permissions-form h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.formations-checkboxes {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.formation-checkbox-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.formation-checkbox-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(24, 127, 234, 0.1);
}

.formation-checkbox-label {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    cursor: pointer;
    gap: 12px;
}

.formation-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    transform: scale(1.2);
}

.formation-checkbox-content {
    flex: 1;
}

.formation-checkbox-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.formation-icon {
    font-size: 16px;
}

.formation-checkbox-header strong {
    color: var(--text-dark);
    flex: 1;
}

.formation-author {
    color: var(--text-light);
    font-size: 11px;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
}

.formation-description {
    color: var(--text-light);
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.formation-tag {
    color: #6c757d;
    font-size: 11px;
    font-family: monospace;
}

/* States et messages */
.no-formations {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
}

.loading-placeholder {
    text-align: center;
    color: var(--text-light);
    padding: 15px;
}

/* Responsive pour la gestion formations */
@media (max-width: 768px) {
    .formations-permissions-container-full {
        width: 100%;
    }
    
    .formations-permissions-main-full {
        padding: 15px;
    }
    
    .formation-permissions-table-container {
        overflow-x: auto;
    }
    
    .formation-permissions-table {
        min-width: 700px;
    }
}

/* ===== DESIGN ÉPURÉ POUR LES ACCÈS ===== */
.simple-permissions-interface {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.simple-permissions-header {
    margin-bottom: 30px;
    text-align: center;
}

.simple-permissions-header p {
    color: var(--text-light);
    font-size: 16px;
}

.simple-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    min-height: 48px;
}

.simple-controls input.input,
.simple-controls select.input {
    flex: 1;
    max-width: 200px;
    min-width: 120px;
}

.simple-controls .simple-btn {
    flex-shrink: 0;
}

.simple-search, .simple-filter {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    min-width: 200px;
}

.simple-search:focus, .simple-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.simple-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.simple-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

.simple-table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.simple-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.simple-table thead {
    background: linear-gradient(135deg, var(--primary-color), #1565c0);
}

.simple-table thead th {
    padding: 18px 20px;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 15px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
}

.simple-table thead th:last-child {
    border-right: none;
}

.simple-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #e8e9ea;
    border-right: 1px solid #f0f1f2;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
}

.simple-table tbody td:last-child {
    border-right: none;
}

.simple-table tbody tr:hover {
    background: #f8f9ff;
}

.simple-table tbody tr:last-child td {
    border-bottom: none;
}

/* Styles spécifiques pour les colonnes */
.user-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.user-info strong {
    font-size: 15px;
    color: var(--text-dark);
    font-weight: 600;
}

.user-info small {
    font-size: 12px;
    color: var(--text-light);
    opacity: 0.8;
}

.permissions-column {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
    min-height: 40px;
}

.permission-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.section-badge {
    border-left: 3px solid;
}

.formation-badge {
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
    color: #1565c0;
}

.no-permissions {
    color: var(--text-light);
    font-style: italic;
    font-size: 13px;
}

.actions-cell {
    text-align: center;
}

/* Actions dans les tableaux épurés */
.simple-table .edit-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 80px;
}

.simple-table .edit-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Messages de chargement épurés */
.loading-row {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 40px !important;
    background: #f8f9fa;
}

.empty-row {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    padding: 40px !important;
    background: #f8f9fa;
}

/* Amélioration des en-têtes de tableaux */
.simple-table thead th {
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.simple-table thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255,255,255,0.3);
}

/* Amélioration de l'alternance des lignes */
.simple-table tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.simple-table tbody tr:nth-child(odd) {
    background-color: white;
}

.simple-table tbody tr:hover {
    background: #e3f2fd !important;
    transform: scale(1.001);
    transition: all 0.2s ease;
}

/* Colonnes spécifiques */
.simple-table td:first-child {
    width: 30%;
    font-weight: 500;
}

.simple-table td:nth-child(2) {
    width: 50%;
}

.simple-table td:last-child {
    width: 20%;
}

/* Amélioration des badges de permissions */
.permission-badge {
    margin: 2px;
    transition: var(--transition);
}

.permission-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Interface responsive améliorée */
@media (max-width: 768px) {
    .simple-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .simple-table thead th {
        padding: 15px 8px;
        font-size: 12px;
    }
    
    .user-info strong {
        font-size: 14px;
    }
    
    .user-info small {
        font-size: 11px;
    }
}

/* Styles pour la gestion des utilisateurs */
.user-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.detail-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    min-width: 60px;
}

.detail-value {
    font-size: 13px;
    color: var(--text-dark);
}

.role-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-administrateur {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.role-utilisateur {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #2196f3;
}

.role-lecteur {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ff9800;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

.status-badge.inactive {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

.delete-btn {
    background: #f44336 !important;
    margin-left: 8px;
}

.delete-btn:hover {
    background: #d32f2f !important;
}

/* Colonne rôle-statut simplifiée */
.role-status-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

/* Styles pour les modales utilisateur */
.user-modal {
    max-width: 500px;
    width: 90%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
    cursor: pointer;
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== DESIGN ÉPURÉ POUR TOUS LES MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
    padding: 24px 28px 16px;
    border-bottom: 2px solid #f0f1f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #666;
    transform: scale(1.1);
}

.modal-body {
    padding: 28px;
}

.modal-tabs {
    display: flex;
    margin-bottom: 24px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
}

.modal-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    color: var(--text-light);
}

.modal-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.permissions-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    background: #f8f9ff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: rgba(24, 127, 234, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
}

/* Amélioration des colonnes du tableau */
.simple-table td:nth-child(1) {
    width: 35%;
}

.simple-table td:nth-child(2) {
    width: 20%;
}

.simple-table td:nth-child(3) {
    width: 20%;
}

.simple-table td:nth-child(4) {
    width: 25%;
}

/* ===== MENU DES FORMATIONS UTILISATEUR ===== */
.user-formations-list {
    margin: 0px
}

.formation-menu-item {
    padding: 8px 12px;
    margin: 4px 0;
    background: #f8f9ff;
    border: 1px solid #e3f2fd;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid var(--primary-color);
}

.formation-menu-item:hover {
    background: #e3f2fd;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(24, 127, 234, 0.15);
}

.formation-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.formation-tag {
    font-size: 10px;
    color: var(--text-light);
    font-family: monospace;
    opacity: 0.7;
}

.formation-loading,
.no-formations,
.error-formations {
    padding: 8px 12px;
    margin: 4px 0;
    text-align: center;
    font-size: 12px;
    border-radius: 6px;
}

.formation-loading {
    background: #f0f1f2;
    color: var(--text-light);
}

.no-formations {
    background: #fff3e0;
    color: #ef6c00;
    border: 1px solid #ffcc02;
}

.error-formations {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #f44336;
}

/* ===== AFFICHAGE PDF FORMATIONS ===== */
.formation-viewer {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.formation-header {
    margin-bottom: 24px;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.formation-header h2 {
    font-size: 28px;
    color: var(--text-dark);
    margin-bottom: 8px;
    font-weight: 700;
}

.formation-description {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.5;
}

.pdf-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-light);
}

.pdf-container iframe {
    width: 100%;
    height: 100vh;
    border: none;
}

/* Responsive pour formations */
@media (max-width: 768px) {
    .formation-viewer {
        padding: 15px;
    }
    
    .formation-header h2 {
        font-size: 24px;
    }
    
    .pdf-container iframe {
        height: 100vh;
    }
    
    .formation-menu-item {
        margin: 2px 0;
        padding: 6px 10px;
    }
    
    .formation-title {
        font-size: 12px;
    }
    
    .formation-tag {
        font-size: 9px;
    }
}

/* Responsive pour design épuré */
@media (max-width: 768px) {
    .simple-controls {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .simple-controls input.input,
    .simple-controls select.input {
        min-width: 100px;
        font-size: 13px;
    }
    
    .simple-controls .simple-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .simple-search, .simple-filter {
        min-width: 100px;
        font-size: 13px;
    }
}

/* Pour les très petits écrans - simple-controls compactes */
@media (max-width: 480px) {
    .simple-controls {
        gap: 5px;
    }
    
    .simple-controls input.input,
    .simple-controls select.input {
        min-width: 80px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .simple-controls .simple-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .simple-controls .simple-btn span {
        display: none;
    }
    
    .simple-controls .simple-btn::before {
        content: attr(data-icon);
    }
}

@media (max-width: 768px) {
    .simple-table-container {
        overflow-x: auto;
    }
    
    .simple-table {
        min-width: 600px;
    }
    
    .simple-permissions-header h2 {
        font-size: 24px;
    }
}

/* ===============================================
   GESTION FORMATIONS STYLES
=============================================== */

.simple-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.simple-header h2 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 600;
}

.simple-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.simple-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
}

.simple-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.simple-empty-state p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.simple-error-state {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.simple-error-state p {
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.simple-actions {
    display: flex;
    gap: 5px;
}

.simple-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.simple-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.simple-btn-primary {
    background: var(--primary-color);
    color: white;
}

.simple-btn-primary:hover {
    background: #0056b3;
}

.simple-btn-secondary {
    background: #6c757d;
    color: white;
}

.simple-btn-secondary:hover {
    background: #545b62;
}

.simple-btn-edit {
    background: #28a745;
    color: white;
    padding: 4px 8px;
}

.simple-btn-edit:hover {
    background: #218838;
}

.simple-btn-delete {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
}

.simple-btn-delete:hover {
    background: #c82333;
}

.simple-btn-view {
    background: #17a2b8;
    color: white;
    padding: 4px 8px;
}

.simple-btn-view:hover {
    background: #138496;
}

.simple-btn-publish {
    background: #6f42c1;
    color: white;
    padding: 4px 8px;
}

.simple-btn-publish:hover {
    background: #5a2d91;
}

/* Viewer de formation dans gestion */
.formation-viewer {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.formation-viewer .simple-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pdf-container {
    flex: 1;
    padding: 0;
    margin: 0;
}

.pdf-container iframe {
    border-radius: 0 0 8px 8px;
}

/* Actions dans le tableau */
.simple-actions {
    display: flex;
    gap: 3px;
    justify-content: center;
}

.simple-actions .simple-btn {
    padding: 4px 6px;
    min-width: 28px;
    justify-content: center;
}

/* Header avec actions multiples */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Container de gestion des formations */
.formations-management-container {
    min-height: 100vh;
}

/* Responsive pour header actions */
@media (max-width: 768px) {
    .simple-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-actions {
        justify-content: space-between;
    }
}

/* Modal d'édition formation */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
}

.modal-close:hover {
    color: #dc3545;
}

.modal-form {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto !important;
    margin: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid #dee2e6;
}

/* =====================================================
   STYLES POUR LE FORUM
   ===================================================== */

.forum-interface {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.forum-header {
    margin-bottom: 30px;
    text-align: center;
}

.forum-header p {
    color: var(--text-light);
    font-size: 16px;
    font-weight: 400;
}

.forum-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    min-height: 48px;
}

.forum-controls input.input {
    flex: 1;
    max-width: 400px;
    min-width: 250px;
}

.forum-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.forum-search {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    min-width: 200px;
}

.forum-search:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 127, 234, 0.1);
}

.forum-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.forum-btn:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

.forum-btn-primary {
    background: var(--primary-color);
    color: white;
}

.forum-btn-primary:hover {
    background: #1565c0;
    transform: translateY(-1px);
}

.forum-filter {
    padding: 10px 15px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
    min-width: 200px;
    background: white;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.forum-filter:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.forum-btn-secondary {
    background: #6c757d;
    color: white;
}

.forum-btn-secondary:hover {
    background: #5a6268;
}

.forum-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.forum-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.forum-content {
    position: relative;
}

.forum-view {
    display: none;
}

.forum-view.active {
    display: block;
}

/* Styles pour les catégories */
.forum-categories-grid {
    display: grid;
    gap: 20px;
}

.forum-category-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.forum-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.category-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.category-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.category-info {
    flex: 1;
}

.category-name {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.category-description {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.5;
}

.category-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #28a745;
}

.stat-label {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-last-activity {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
}

.last-activity strong {
    color: #2c3e50;
}

.activity-date {
    color: #6c757d;
    margin-left: 10px;
}

.no-activity {
    color: #adb5bd;
    font-style: italic;
}

.category-actions {
    display: flex;
    justify-content: flex-end;
}

/* Styles pour les sujets */
.forum-topics-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.topics-header {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.forum-topic-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 20px;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    transition: background-color 0.3s ease;
}

.forum-topic-row:hover {
    background: #f8f9fa;
}

.forum-topic-row:last-child {
    border-bottom: none;
}

.topic-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.topic-status {
    display: flex;
    gap: 5px;
    margin-top: 2px;
}

.topic-pin,
.topic-lock,
.topic-closed {
    font-size: 12px;
}

.topic-content {
    flex: 1;
}

.topic-title {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease;
}


.topic-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
}

.topic-stats {
    display: flex;
    gap: 20px;
    align-items: center;
}

.topic-last-reply {
    text-align: right;
    font-size: 13px;
}

.last-reply {
    color: #6c757d;
}

.reply-author {
    font-weight: 500;
    color: #2c3e50;
}

.reply-date {
    display: block;
    margin-top: 2px;
    font-size: 12px;
}

.no-replies {
    color: #adb5bd;
    font-style: italic;
}

/* Pagination */
.forum-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: white;
    border-top: 1px solid #dee2e6;
}

.forum-pagination button {
    padding: 8px 16px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.forum-pagination button:hover {
    background: #218838;
}

.forum-pagination button:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* États vides */
.forum-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.forum-empty h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 20px;
}

.forum-empty p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 16px;
}

/* Placeholder de chargement */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .forum-interface {
        padding: 10px;
    }
    
    .forum-controls {
        gap: 8px;
        flex-wrap: nowrap;
    }
    
    .forum-controls input.input {
        min-width: 150px;
        font-size: 13px;
    }
    
    .forum-actions {
        gap: 5px;
    }
    
    .forum-actions .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .topics-header,
    .forum-topic-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .topic-stats {
        justify-content: space-around;
    }
    
    .topic-last-reply {
        text-align: left;
    }
    
    .category-stats {
        justify-content: center;
    }
}

/* Pour les très petits écrans - garder la ligne unique mais compacte */
@media (max-width: 480px) {
    .forum-controls {
        gap: 5px;
    }
    
    .forum-controls input.input {
        min-width: 120px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .forum-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .forum-actions .btn span {
        display: none;
    }
    
    .forum-actions .btn::before {
        content: attr(data-icon);
    }
}

/* =========================================
   DESIGN ÉPURÉ POUR LES DISCUSSIONS
   ========================================= */

.discussions-list {
    width: 100%;
}

.discussions-header {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.discussions-header h3 {
    margin: 0 0 8px 0;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
}

.discussions-header p {
    margin: 0;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 400;
}

.discussions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* DESIGN 5 - Moderne avec Icônes */
.discussion-card {
    background: white;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 16px;
    position: relative;
    border: 2px solid transparent;
}

.discussion-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(116, 185, 255, 0.15);
}

.discussion-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.discussion-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.discussion-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    flex: 1;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.3s ease;
}

.discussion-title:hover {
    color: var(--primary-color);
}

.discussion-time {
    font-size: 0.8rem;
    color: var(--text-light);
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 8px;
    flex-shrink: 0;
}

.discussion-content {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.discussion-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.discussion-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.author-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.discussion-delete-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.discussion-delete-btn:hover {
    background: #e74c3c;
    transform: translateY(-1px);
}

/* =========================================
   BOUTONS D'ACTION DANS LES CARTES
   ========================================= */

.discussion-actions {
    display: flex;
    gap: 6px;
}

.discussion-action-btn {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    color: var(--text-dark);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.discussion-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.discussion-action-btn.btn-view:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.discussion-action-btn.btn-delete {
    border-color: #dc3545;
    color: #dc3545;
}

.discussion-action-btn.btn-delete:hover {
    background: #dc3545;
    color: white;
}

.discussion-action-btn i {
    font-size: 11px;
}

/* =========================================
   VUE DÉTAILLÉE DE LA CONVERSATION
   ========================================= */

/* Style Chat Moderne pour les discussions */
.discussion-detail {
    display: none;
    background: white;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    margin: 24px 0;
}

.discussion-detail.active {
    display: block;
    animation: slideIn 0.3s ease-out;
}

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

.topic-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--background-light);
}

.back-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border: var(--primary-color) 2px solid;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-button:hover {
    background: var(--primary-hover);
    color: black;
    border: var(--primary-color) 2px solid;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
}

.conversation {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
    margin-bottom: 30px;
}

.message {
    margin-bottom: 24px;
}

.message.main {
    padding: 24px;
    background: linear-gradient(135deg, rgba(116, 185, 255, 0.1), rgba(85, 239, 196, 0.05));
    border-radius: 20px;
    border-left: 4px solid var(--primary-color);
}

.message.reply {
    padding: 20px;
    background: #fbfcfd;
    border-radius: 16px;
    margin-left: 40px;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.message-avatar {
    min-width: 36px;
    height: 36px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
}

.message-avatar .author-name {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 150px;
}

.message-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dark);
}

.message-content p {
    margin: 0;
}

.author-name {
    font-weight: 600;
    color: var(--text-dark);
}

.admin-badge {
    background: var(--accent-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
}

/* Scrollbar personnalisée pour la conversation */
.conversation::-webkit-scrollbar {
    width: 6px;
}

.conversation::-webkit-scrollbar-track {
    background: var(--background-light);
    border-radius: 3px;
}

.conversation::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 0.7;
}

.conversation::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* Responsive pour le design chat moderne */
@media (max-width: 768px) {
    .discussion-detail {
        padding: 20px;
    }
    
    .topic-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .message.reply {
        margin-left: 20px;
    }
    
    .message-avatar {
        min-width: 32px;
        height: 32px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .message-avatar .author-name {
        font-size: 0.75rem;
        max-width: 120px;
    }
    
    .conversation {
        max-height: 400px;
    }
}

/* =========================================
   FORMULAIRE DE RÉPONSE ÉPURÉ
   ========================================= */

.reply-form {
    background: var(--background-light);
    padding: 24px;
    border-radius: var(--border-radius);
    margin-top: 24px;
    border: 1px solid var(--border-color);
}

.reply-form h3 {
    color: var(--text-dark);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-small);
    padding: 16px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
    background: white;
    box-sizing: border-box;
}

.reply-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.reply-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-small);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reply-submit:active {
    transform: translateY(0);
}

.reply-submit:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

/* Nouveaux styles pour les améliorations du formulaire */
.reply-form-user {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: rgba(78, 115, 223, 0.1);
    border-radius: var(--border-radius-small);
    font-size: 13px;
    color: var(--text-dark);
}

.reply-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.reply-cancel {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-small);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reply-cancel:hover {
    background: var(--accent-color);
}

.reply-char-count {
    margin-top: 8px;
    text-align: right;
    font-size: 12px;
    color: var(--text-light);
}

/* Amélioration des messages/réponses */
.reply-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.reply-item[data-message-id] {
    animation: fadeInUp 0.3s ease-out;
}

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

.no-replies {
    text-align: center;
    padding: 32px;
    color: var(--text-light);
    font-style: italic;
    background: rgba(108, 117, 125, 0.05);
    border-radius: var(--border-radius-small);
    margin: 16px 0;
}

/* =========================================
   ÉTATS VIDES ÉPURÉS
   ========================================= */

.forum-empty {
    text-align: center;
    padding: 64px 32px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    margin: 24px 0;
    border-left: 4px solid var(--primary-color);
}

.forum-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
    color: var(--text-light);
}

.forum-empty h3 {
    margin: 0 0 12px 0;
    color: var(--text-dark);
    font-size: 24px;
    font-weight: 600;
}

.forum-empty p {
    margin: 0 0 24px 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-light);
}

/* =========================================
   RESPONSIVE ÉPURÉ
   ========================================= */

@media (max-width: 768px) {
    .discussion-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .discussion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .discussion-title {
        font-size: 18px;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .discussions-header {
        padding: 20px;
    }
    
    .discussion-detail {
        padding: 24px;
    }
    
    .discussion-card {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .discussion-actions {
        align-self: flex-end;
    }
}

/* =========================================
   MODAL CRÉATION DE SUJET
   ========================================= */

.topic-modal {
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.topic-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--background-light);
    border-radius: 8px 8px 0 0;
}

.topic-modal .modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 20px;
    font-weight: 600;
}

.topic-modal .modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.topic-modal .modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
}

.topic-modal .modal-body {
    padding: 25px;
}

.topic-modal .form-group {
    margin-bottom: 20px;
}

.topic-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.topic-modal .form-group input,
.topic-modal .form-group select,
.topic-modal .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.topic-modal .form-group input:focus,
.topic-modal .form-group select:focus,
.topic-modal .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.topic-modal .form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.topic-modal .form-help {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
    line-height: 1.4;
}

.topic-modal .form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    transform: scale(1.1);
}

.topic-modal .form-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 8px;
}

.topic-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--background-light);
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.topic-modal .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.topic-modal .btn-secondary {
    background: var(--text-light);
    color: white;
}

.topic-modal .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.topic-modal .btn-primary {
    background: var(--primary-color);
    color: white;
}

.topic-modal .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.topic-modal .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Animation d'entrée */
.topic-modal {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .topic-modal {
        width: 95vw;
        max-height: 85vh;
    }
    
    .topic-modal .modal-body {
        padding: 20px;
    }
    
    .topic-modal .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .topic-modal .btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   MÉDIATHÈQUE ÉDUCATIVE AVEC ONGLETS - VERSION AMÉLIORÉE
   ========================================= */

.media-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 25px;
    background: transparent;
    min-height: auto;
}

/* Header médiathèque supprimé - utilise maintenant les titres de sections */

/* Onglets supprimés - navigation maintenant dans le sidemenu */

/* Contenu des onglets simplifié */
.media-content {
    position: relative;
    min-height: auto;
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
}

.media-tab-content {
    display: none;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-tab-content.active {
    display: block;
}

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

/* Section des fichiers simplifié */
.media-files-grid {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.media-section-header {
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 25px;
    border-bottom: 3px solid transparent;
    background: linear-gradient(white, white), linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    background-clip: padding-box, border-box;
    background-origin: border-box;
    position: relative;
}

.media-section-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
}

.media-section-header h3 {
    margin: 0 0 12px 0;
    color: var(--text-dark);
    font-size: 26px;
    font-weight: 700;
    font-family: var(--font-secondary);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.media-section-header p {
    margin: 0;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 500;
}

/* Liste des fichiers */
.media-files-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.media-file-card {
    background: var(--background-light);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.media-file-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(78, 115, 223, 0.15);
    transform: translateY(-2px);
}

.file-icon {
    font-size: 32px;
    min-width: 50px;
    text-align: center;
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.file-details {
    flex: 1;
}

.file-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-dark);
    line-height: 1.2;
}

.file-type {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.file-description {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: var(--text-light);
    font-style: italic;
}

.file-count {
    display: inline-block;
    background: var(--background-light);
    color: var(--text-dark);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
    margin-top: 5px;
}

.file-contents {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.file-contents h5 {
    margin: 0 0 5px 0;
    font-size: 11px;
    color: var(--text-dark);
    font-weight: 600;
    text-transform: uppercase;
}

.file-list {
    margin: 0;
    padding-left: 15px;
    list-style: none;
}

.file-list li {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 2px;
    position: relative;
}

.file-list li:before {
    content: "•";
    color: var(--primary-color);
    position: absolute;
    left: -10px;
}

.file-list .more-files {
    font-style: italic;
    color: var(--primary-color);
}

.expanded-card {
    min-height: 120px;
}

.expanded-card .file-details {
    flex: 1;
    max-width: none;
}

.section-actions {
    margin-top: 15px;
    text-align: center;
}

.download-all-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 115, 223, 0.3);
}

.download-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 115, 223, 0.4);
}

.file-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-download-btn, .media-preview-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 90px;
}

.media-download-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.media-preview-btn {
    background: var(--text-light);
}

.media-preview-btn:hover {
    background: #5a6268;
    transform: scale(1.05);
}

/* État vide amélioré */
.no-files {
    text-align: center;
    padding: 80px 30px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 250, 255, 0.9));
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 2px dashed rgba(24, 127, 234, 0.3);
    margin: 20px 0;
    position: relative;
    overflow: hidden;
}

.no-files::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(24, 127, 234, 0.05), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.no-files .empty-icon {
    font-size: 80px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
    display: inline-block;
    animation: pulse 2s infinite;
}

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

.no-files h3 {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: var(--primary-color);
    font-weight: 700;
    font-family: var(--font-secondary);
}

.no-files p {
    margin: 0;
    font-size: 18px;
    color: var(--text-light);
    font-weight: 500;
}

/* Modal de prévisualisation */
.media-preview-modal {
    max-width: 800px;
    width: 90vw;
}

.media-preview-modal .modal-body {
    text-align: center;
    padding: 20px;
}

/* Modal d'exploration */
.media-explore-modal {
    max-width: 600px;
    width: 90vw;
}

.explore-info {
    background: var(--background-light);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.explore-info p {
    margin: 5px 0;
    font-size: 14px;
}

.explore-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.explore-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 15px;
}

.explore-note .note-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.explore-note .note-icon {
    font-size: 24px;
    margin-top: 2px;
    flex-shrink: 0;
}

.explore-note .note-text {
    flex: 1;
}

.explore-note .note-text p {
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.explore-note .note-text p:first-child {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
}

.explore-note .note-text p:last-child {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 0;
}

/* Mini-sections styling - simplifié pour médiathèque */
.mini-sections-container {
    margin: 0;
    background: transparent;
    padding: 0;
    height: 90vh;
}

.mini-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    height: 90vh;
}

.mini-section-header {
    background: #fff; /* Background blanc */
    color: var(--primary-color);
    padding: 15px 20px;
    text-align: center;
    border-bottom: 2px solid #f8f9fa;
}

.mini-section-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.mini-section-header p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.mini-section-tabs {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.mini-tab-btn {
    background: #e9ecef;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 150px;
}

.mini-tab-btn.active {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.mini-tab-btn:hover:not(.active) {
    background: #ced4da;
}

.mini-section-content {
    padding: 20px;
    height: 90vh;
    overflow-y: auto;
    display: none;
    background: #fff; /* Background blanc */
}

.mini-section-content.active {
    display: block;
}

/* Media folders container simplifié */
.media-folders-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    background: #fff; /* Background blanc */
}

.media-folder-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* Retirer les animations générales */
}

/* Retirer l'animation du before */
.media-folder-section::before {
    display: none;
}

/* Section sans animation hover */

.folder-header {
    background: #fff; /* Background blanc */
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Retirer les animations du header */
.folder-header::before {
    display: none;
}

.folder-header:hover::before {
    display: none;
}

.folder-header h4 {
    margin: 0;
    font-size: 18px;
    color: var(--primary-color);
    font-weight: 700;
    font-family: var(--font-secondary);
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-count {
    font-size: 13px;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(24, 127, 234, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Styles pour les actions des dossiers */
.folder-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.download-folder-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.download-folder-btn:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.media-files-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 20px;
    background: #fff; /* Background blanc */
}

.media-file-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    /* Retirer les animations du conteneur */
}

/* Conteneur sans animation hover */

.file-thumbnail {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #fff; /* Background blanc */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    min-height: 200px;
    position: relative;
    z-index: 2;
    /* Retirer les transitions générales */
}

/* Retirer l'effet after général */
.file-thumbnail::after {
    display: none;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease; /* Garder la transition pour les images */
    border-radius: 8px;
}

/* Améliorer les animations hover uniquement sur les images */
.file-thumbnail:hover img {
    transform: scale(1.15); /* Animation plus prononcée */
    filter: brightness(1.2) contrast(1.1) saturate(1.1);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-radius: 12px;
}

.video-thumbnail {
    font-size: 48px;
    color: #007bff;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.video-thumbnail:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    transform: scale(1.05);
}



.file-info {
    padding: 12px;
}

.file-name {
    display: block;
    font-size: 13px;
    color: #495057;
    font-weight: 600;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.file-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.action-btn {
    background: #e9ecef;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-btn:hover {
    background: var(--primary-color);
    color: white;
}

.download-btn:hover {
    background: #28a745;
    color: white;
}

/* Modal d'image styling amélioré */
.image-modal-overlay {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    z-index: 10000;
    animation: fadeIn 0.4s ease-out;
}

.image-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInScale 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.image-modal-body {
    padding: 0px!important;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 75vh;
    background: transparent;
}

.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 0px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    transition: all 0.3s ease;
}

.image-modal-content .modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.image-modal-content .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
}

.image-modal-content .modal-header h2 {
    font-family: var(--font-secondary);
    font-weight: 700;
    color: var(--primary-color);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    position: relative;
    z-index: 1;
}

.image-modal-content .modal-footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 255, 0.9));
    backdrop-filter: blur(10px);
    padding: 20px 25px;
    border-radius: 0 0 20px 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 1px solid rgba(24, 127, 234, 0.2);
}



/* Responsive Design Amélioré */
@media (max-width: 1200px) {
    .media-container {
        padding: 20px;
    }
    
    .media-files-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 25px;
    }
}

@media (max-width: 992px) {
    .media-files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 20px;
    }
    
    .file-thumbnail {
        min-height: 180px;
    }
    
    .media-header h2 {
        font-size: 28px;
    }
    
    .folder-header h4 {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .media-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .media-header {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .media-header h2 {
        font-size: 24px;
    }
    
    .media-tabs {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
        border-radius: 20px;
    }
    
    .media-tab-btn {
        width: 100%;
        margin: 0;
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .media-files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px;
    }
    
    .folder-header {
        padding: 15px 18px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .folder-header h4 {
        font-size: 15px;
    }
    
    .file-count {
        font-size: 12px;
        padding: 4px 10px;
    }
}

@media (max-width: 480px) {
    .media-container {
        padding: 10px;
    }
    
    .media-header {
        padding: 20px 15px;
        margin-bottom: 25px;
    }
    
    .media-header h2 {
        font-size: 20px;
    }
    
    .media-header p {
        font-size: 14px;
    }
    
    .media-files-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }
    
    .file-thumbnail {
        min-height: 200px;
    }
    
    .media-tab-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: auto;
    }
    
    .folder-header h4 {
        font-size: 14px;
    }
    
    .image-modal-content {
        max-width: 98vw;
        max-height: 98vh;
        margin: 1vh auto;
    }
    
    .image-modal-body {
        max-height: 70vh;
        padding: 15px;
    }
    
    .image-container img {
        max-height: 65vh;
    }
    
    .mini-section-tabs {
        display: inline-flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .mini-tab-btn {
        max-width: none;
    }
}
    
    .media-files-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .file-thumbnail {
        min-height: 140px;
    }
    
    .mini-section-content {
        height: 90vh;
    }
    
    .image-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    
    .image-modal-body {
        max-height: 60vh;
    }
    
    .image-container img {
        max-height: 60vh;
    }
    

    
    .media-files-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .media-file-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .file-actions {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

/* ===== STYLES POUR YOUTUBE VIDEOS ===== */
.youtube-video-container {
    position: relative;
    width: 100%;
    text-align: center;
}

.youtube-thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #000;
}

.youtube-thumbnail:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.youtube-thumb-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.youtube-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
}

.youtube-thumbnail:hover .youtube-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-title {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    text-align: center;
}

/* Modal YouTube */
.youtube-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.youtube-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.youtube-video-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.youtube-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.youtube-modal-content .modal-close-btn {
    position: absolute;
    top: -45px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
    transition: all 0.3s ease;
    z-index: 10001;
}

.youtube-modal-content .modal-close-btn:hover {
    background: white;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive pour modal YouTube */
@media (max-width: 768px) {
    .youtube-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .youtube-modal-content .modal-close-btn {
        top: -35px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

/* ====================
   NOUVEAU DESIGN PROFIL
   ==================== */

.profile-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    background-image: url('../media/img/salle de classe.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-overlay {
    border-radius: 30px;
    padding: 0px 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 80%;
    width: auto;
    
}

.profile-welcome {
    margin-bottom: 0;
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 300;
    color: white;
    margin: 0 0 10px 0;
    font-family: 'Caveat', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.user-name {
    font-size: 2.5rem;
    font-weight: 600;
    color: white;
    margin: 0;
    font-family: 'Caveat', cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}



/* Responsive */
@media (max-width: 768px) {
    .profile-overlay {
        padding: 40px 30px;
        min-width: auto;
        width: 95%;
        transform: translateY(-50px);
    }
    
    .welcome-title {
        font-size: 2.5rem;
    }
    
    .user-name {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .profile-hero {
        height: 100vh;
        padding: 20px 0;
    }
    
    .profile-overlay {
        padding: 30px 20px;
        border-radius: 20px;
        transform: translateY(-30px);
    }
    
    .welcome-title {
        font-size: 2rem;
    }
    
    .user-name {
        font-size: 1.5rem;
    }
}