/* style.css (COMPLET ET CORRIGÉ POUR LE SCOPING) */

:root {
    /* Couleurs principales basées sur index.html */
    --primary-color: #00bfff; /* Bleu ciel */
    --primary-dark: #0095d1;
    --secondary-color: #f6b918; /* Jaune/Orange */
    --dark-bg: rgba(0, 0, 0, 0.85); /* Fond principal */
    --card-bg: rgba(255, 255, 255, 0.1); /* Fond des cartes/formulaires */
    --accent-color: #6a11cb;
    --accent-gradient: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    --success-color: #51cf66; /* Vert pour succès/actif */
    --error-color: #ff4d4d; /* Rouge pour erreur */
    --text-light: #ffffff;
    --text-gray: #e0e0e0;
    --border-radius: 15px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

/* Général */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--dark-bg) url('background_placeholder.jpg') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* Structure des pages de connexion/inscription/profil */
.auth-container, .index-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    flex-grow: 1;
}

.auth-card, .index-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 450px;
}

.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-text {
    font-size: 2.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-gray);
    font-size: 1rem;
    font-weight: 400;
}

/* Formulaires et Alertes (Identiques) */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: rgba(0, 0, 0, 0.5);
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background-image: var(--accent-gradient);
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    transition: opacity 0.3s;
}

.submit-btn:hover {
    opacity: 0.9;
}

.submit-btn i {
    margin-right: 8px;
}

.alert-error, .alert-success {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-error {
    background-color: rgba(255, 77, 77, 0.2);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.alert-success {
    background-color: rgba(81, 207, 102, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.link-section {
    text-align: center;
    margin-top: 20px;
    font-size: 0.95rem;
}

/* Profil spécifiques (Identiques) */
.profile-section {
    margin-bottom: 30px;
}

.profile-section h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-label {
    font-weight: 600;
    color: var(--text-gray);
}

.info-value {
    color: var(--text-light);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.back-link {
    text-align: center;
    margin-top: 25px;
}

.back-link a {
    color: var(--secondary-color);
}

.logout-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    background-color: var(--error-color);
    color: var(--text-light);
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition);
}

.logout-btn:hover {
    background-color: #cc0000;
}

/* --- Styles de la Barre de navigation et du Dashboard/Catalogue --- */

/* Navbar (Identiques) */
.navbar {
    background-color: #000000;
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .logo-text {
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
}

.navbar-links a {
    color: var(--text-gray);
    margin-left: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.navbar-links a:hover {
    color: var(--primary-color);
}

.user-menu {
    position: relative;
}

.user-menu-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: var(--text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid var(--secondary-color);
    transition: transform 0.2s ease;
}

.user-menu-btn:hover {
    transform: scale(1.05);
}

.dropdown-menu {
    position: absolute;
    top: 50px;
    right: 0;
    background-color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    width: 200px;
    box-shadow: var(--box-shadow);
    padding: 10px 0;
    display: none; 
    z-index: 101;
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s;
    margin: 0;
}

.dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}


/* Dashboard/Main Content Wrapper (FIXED Centering for all pages EXCEPT cours.php) */

.dashboard-container {
    align-items: flex-start; 
    padding: 0;
    flex-grow: 1; 
    /* Par défaut, permet au contenu de s'étirer si .main-content est centré */
}

.main-content {
    padding: 40px;
    max-width: 1200px; /* Largeur maximale pour le centrage */
    margin: 0 auto; /* Centrage horizontal */
    flex-grow: 1;
    width: 100%;
}

.dashboard-header h2 {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: 5px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.dashboard-header p {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-top: 40px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

/* --- Course Grid and Card (Identiques) --- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.course-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}

.course-image {
    width: 100%;
    height: 180px;
    background-color: #2c3e50; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: var(--text-gray);
}

.course-info {
    padding: 20px;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

.course-info h3 {
    font-size: 1.25rem;
    margin-bottom: 10px;
    color: var(--text-light);
}

.course-progress {
    margin-top: 15px;
}

.progress-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.progress-bar-container {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* --- Styles Spécifiques au Catalogue/Panier (Identiques) --- */
.cart-indicator {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--error-color);
    color: white;
    border-radius: 50%;
    padding: 3px 7px;
    font-size: 0.7rem;
    font-weight: 700;
}
.navbar-links a.cart-link { 
    position: relative; 
    margin-right: 25px; 
}

.course-type-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}
.type-video { background-color: rgba(37, 117, 252, 0.2); color: #2575fc; }
.type-texte { background-color: rgba(0, 191, 255, 0.2); color: #00bfff; }

.card-price {
    margin-top: auto; 
    font-size: 1.5rem;
    color: var(--secondary-color);
    font-weight: 700;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 5px;
}
.course-card-btn {
    padding: 10px 15px;
    text-align: center;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 10px;
    display: block;
}
.btn-add {
    background: var(--accent-gradient);
    color: var(--text-light);
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
}
.btn-add:hover { opacity: 0.9; }
.btn-enrolled {
    background-color: var(--success-color);
    color: black;
    cursor: not-allowed;
}
.btn-in-cart {
    background-color: var(--primary-color);
    color: var(--text-light);
    cursor: pointer;
}

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: flex-start;
}
.cart-items-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
}
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cart-item:last-child { border-bottom: none; }
.item-details { flex-grow: 1; }
.item-details h4 { margin: 0; color: var(--text-light); font-size: 1.1rem; }
.item-details p { margin: 2px 0 0; color: var(--text-gray); font-size: 0.9rem; }
.item-price { font-weight: 700; color: var(--success-color); font-size: 1.2rem; width: 100px; text-align: right; }
.remove-btn { 
    color: var(--error-color); 
    background: none; 
    border: none; 
    cursor: pointer; 
    margin-left: 20px; 
    font-size: 1.2rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.remove-btn:hover { opacity: 1; }
.cart-summary {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 30px;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.summary-total {
    border-top: 2px solid var(--primary-color);
    padding-top: 15px;
    margin-top: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
}


/* --- Styles Spécifiques pour l'Administration et les Tableaux (Identiques) --- */

.admin-form-container {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.admin-form-container h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.courses-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.courses-table th, .courses-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.courses-table th {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.courses-table tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-video {
    background-color: rgba(37, 117, 252, 0.3);
    color: #2575fc;
}

.badge-texte {
    background-color: rgba(0, 191, 255, 0.3);
    color: #00bfff;
}


/* --- Styles Spécifiques à la Page Cours (cours.php) --- */

/* ************************************************************* */
/* FIX IMPORTANT : Scoper les overrides en utilisant .course-page-mode */
/* ************************************************************* */
.course-page-mode .dashboard-container {
    padding: 0; 
    flex-grow: 1;
}

.course-page-mode .main-content {
    padding: 0;
    max-width: 100%; /* Pleine largeur */
    margin: 0; /* Supprime le centrage */
    flex-grow: 1;
    width: 100%;
}


.course-layout {
    display: grid;
    /* Sidebar: 320px | Contenu: Reste de l'espace (1fr) */
    grid-template-columns: 320px 1fr;
    gap: 0;
    /* 100vh moins la hauteur de la navbar (estimée à 70px) */
    min-height: calc(100vh - 70px); 
}

.course-sidebar {
    background: rgba(0, 0, 0, 0.7);
    padding: 25px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    /* Rendre la sidebar fixe sous la navbar */
    max-height: calc(100vh - 70px); 
    position: sticky;
    top: 70px; 
}

.course-sidebar h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Progression du cours */
.course-progress-bar {
    margin-bottom: 25px;
}
.course-progress-bar .progress-bar {
    background: var(--success-color);
}
.course-progress-bar .progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}
.course-progress-bar .progress-label span:last-child {
    color: var(--secondary-color);
    font-weight: 700;
}


/* Liste des modules */
.module-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.module-list a {
    display: block;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-size: 0.95rem;
}

.module-list a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.module-list a.active {
    background: rgba(0, 191, 255, 0.2);
    border-left-color: var(--secondary-color);
    font-weight: 600;
    color: var(--primary-color);
}

.module-list a i {
    margin-right: 8px;
    color: var(--secondary-color);
}

/* Contenu principal */
.course-main-content {
    padding: 40px;
    background: var(--dark-bg);
    overflow-y: auto;
}

.content-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.content-embed iframe,
.content-embed video {
    width: 100%;
    height: 500px;
    border-radius: 10px;
    border: none;
    margin-bottom: 20px;
}

.download-btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--primary-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px; 
}

.download-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Navigation entre modules */
.module-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.nav-btn {
    padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.prev {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.nav-btn.next {
    background: var(--accent-gradient);
    color: var(--text-light);
}

.nav-btn.finish {
    background: var(--success-color);
    color: black; 
}

.nav-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    /* Navbar ajustements */
    .navbar {
        padding: 15px 20px;
    }

    .navbar-links {
        /* Vous pouvez utiliser un menu hamburger */
    }

    /* Layout Cours (cours.php) */
    .course-layout {
        grid-template-columns: 1fr; /* Passage à une colonne unique */
    }

    .course-sidebar {
        position: relative; /* Désactiver le sticky sur mobile */
        top: 0;
        max-height: none;
        width: 100%;
    }
    
    .course-main-content {
        padding: 20px; /* Réduire le padding sur mobile */
    }

    .content-embed iframe,
    .content-embed video {
        height: 300px; /* Réduire la hauteur de la vidéo sur mobile */
    }

    .module-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-btn.prev {
        order: 1; 
    }
    .nav-btn.next, .nav-btn.finish {
        order: 2;
    }
    
    /* Layout Panier */
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    /* Styles généraux */
    .main-content {
        padding: 20px;
    }

    .auth-card, .index-card {
        padding: 30px;
    }
    
    .dashboard-header h2 {
        font-size: 1.8rem;
    }

    /* Formulaires */
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* --- Masquage/Affichage des éléments de Navigation Mobile/Desktop --- */

/* Par défaut, masquer les liens destinés uniquement au mobile */
.dropdown-menu .mobile-nav {
    display: none !important;
}

@media (max-width: 992px) {
    /* Sur mobile/tablette (moins de 992px) : */
    
    /* 1. Masquer les liens de navigation de la navbar */
    .navbar-links.desktop-nav {
        display: none;
    }

    /* 2. Afficher les liens de navigation dans le dropdown */
    .dropdown-menu .mobile-nav {
        display: block !important; /* Rendre les liens visibles */
        padding: 12px 15px; /* Ajuster le padding pour qu'ils soient cohérents */
    }
    
    /* Correction de la position du badge panier pour les liens mobiles */
    .dropdown-menu a.cart-link {
        position: relative;
    }
    .dropdown-menu a.cart-link .cart-indicator {
        position: absolute;
        right: 15px; /* Déplacer le badge à droite pour le dropdown */
        top: 50%;
        transform: translateY(-50%);
    }

    /* Optionnel: Ajuster le séparateur horizontal pour le mobile */
    .dropdown-menu hr.mobile-nav {
        display: block !important;
    }
}

/* --- NOUVEAUX Styles pour l'Administration et les Formulaires (admin_ajouter_cours/module) --- */

.admin-container {
    max-width: 900px;
    margin: 0 auto;
}

.form-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-grid-full {
    grid-column: 1 / -1;
}

/* Style uniforme pour tous les contrôles (input, select, textarea) */
.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-light);
    font-size: 1rem;
    transition: var(--transition);
    font-family: 'Montserrat', sans-serif;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    background-color: rgba(0, 0, 0, 0.5);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
}

/* Styles des tableaux de l'administration (Modules/Cours Récents) */
.modules-table, .courses-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.modules-table th, .courses-table th {
    background: rgba(0, 191, 255, 0.2);
    color: var(--primary-color);
    padding: 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
}

.modules-table td, .courses-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray);
}

.modules-table tr:hover, .courses-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}


/* Styles de la Navigation Admin */
.admin-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.admin-nav a {
    padding: 10px 20px;
    background: var(--card-bg); 
    color: var(--text-light);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-nav a.active {
    background: var(--primary-color);
    color: var(--dark-bg);
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.admin-nav a:not(.active):hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

/* --- Styles pour les liens de Navigation en bas de la page Profil --- */

/* Conteneur principal pour le lien "Retour" */
.back-link {
    margin-top: 30px; /* Ajoute un espace au-dessus du premier lien (Séparation avec le formulaire) */
    margin-bottom: 10px;
    text-align: center; /* Centre le lien horizontalement sous le conteneur du profil */
}

/* Styles de base pour le lien "Retour" */
.back-link a {
    /* Réutilisez le style des boutons pour une apparence uniforme */
    padding: 10px 15px;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-gray);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-link a:hover {
    color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.2);
}

/* Correction pour les liens 'Ajout de cours' et 'Ajout de module' */
.left-link, .center-link {
    /* 🛑 IMPORTANT : Retirer la position absolue pour qu'ils suivent le flux du document */
    position: static; 
    
    /* Annuler les décalages précédents */
    top: auto;
    left: auto;
    bottom: auto;
    transform: none; 
    
    margin-bottom: 10px; /* Espacement entre les boutons */
    text-align: center; /* Centre les conteneurs */
}

/* Applique le même style de bouton aux liens Ajout de cours/module */
.left-link a, .center-link a {
    padding: 10px 15px;
    background: var(--card-bg); 
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex; /* S'assure que le bouton ne prend pas toute la largeur */
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-gray); /* Couleur par défaut */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.left-link a:hover, .center-link a:hover {
    color: var(--primary-color) !important;
    background: rgba(255, 255, 255, 0.2);
}

/* Media Query pour les petits écrans (s'assurer qu'ils sont en bloc) */
@media (max-width: 768px) {
    /* Sur mobile, ils doivent prendre toute la largeur */
    .back-link a, .left-link a, .center-link a {
        display: block; 
        width: 90%; /* Pour laisser un peu de marge sur les côtés */
        margin: 10px auto; /* Pour centrer le bloc */
    }
}

/* --- Styles pour la Fenêtre Modale (Popup) --- */

.modal {
    display: none; /* Masqué par défaut */
    position: fixed; 
    z-index: 1000; /* Assurez-vous qu'il est au-dessus de tout */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0, 0, 0, 0.7); /* Fond semi-transparent */
    justify-content: center; /* Centrage horizontal */
    align-items: center; /* Centrage vertical */
    padding: 20px;
}

.modal-content {
    /* Utilise la classe admin-card pour l'apparence */
    background: var(--dark-bg); 
    border: 1px solid var(--primary-color);
    margin: auto;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 95%; 
    max-width: 700px; /* Limite la taille sur grand écran */
    position: relative;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content .close-btn {
    color: var(--text-gray);
    position: absolute;
    top: 10px;
    right: 25px;
    font-size: 30px;
    font-weight: bold;
    transition: var(--transition);
}

.modal-content .close-btn:hover,
.modal-content .close-btn:focus {
    color: var(--error-color);
    text-decoration: none;
    cursor: pointer;
}

/* Style pour le bouton Modifier dans le modal */
.modal-content .update-btn {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
}

.modal-content .update-btn:hover {
    background-color: #f0b00a; /* Variation de la couleur secondaire */
}

/* --- Styles pour les boutons d'action dans les tableaux --- */

/* Boutons d'action dans le tableau de cours */
.action-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 3px;
    transition: var(--transition);
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid; /* Ajout d'une bordure pour les différencier */
    background: transparent; /* Bouton transparent */
    cursor: pointer;
}

.edit-btn {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.edit-btn:hover {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
}

.delete-btn {
    color: var(--error-color);
    border-color: var(--error-color);
}

.delete-btn:hover {
    background-color: var(--error-color);
    color: var(--dark-bg);
}

/* Dans style.css */

.navbar .logo .logo-img {
    height: 40px; /* Ajustez cette hauteur selon la taille désirée */
    width: auto; /* Maintient le ratio de l'image */
    display: block;
}

/* Si vous aviez des styles spécifiques pour le texte, vous pouvez les supprimer */
.navbar .logo .logo-text {
    /* Supprimez ou commentez les styles du texte ici */
    /* font-size: 1.5rem; */ 
    /* color: var(--text-light); */
}

/* Style de base de la classe 'submit-btn' */
.submit-btn {
    display: block; /* S'assure qu'il prend la largeur disponible dans son conteneur */
    width: 100%; 
    padding: 12px 25px; /* Ajusté par le style en ligne à 10px 15px pour la navbar */
    margin-top: 20px;
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-light); /* Texte blanc */
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    background-image: var(--accent-gradient); /* Le dégradé violet/bleu */
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
}

/* Style pour l'icône à côté du texte */
.submit-btn i.fas {
    margin-right: 8px;
}

/* ============================================================
   STYLES SUPPLÉMENTAIRES POUR LE SYSTÈME DE PAIEMENT WAVE
   À ajouter à la fin de votre fichier style.css existant
   ============================================================ */

/* --- STYLES POUR LE PANIER AVEC PAIEMENTS INDIVIDUELS --- */

.cart-items-list {
    max-width: 900px;
    margin: 30px auto;
}

.cart-item-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
}

.cart-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 191, 255, 0.3);
}

.item-header {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.item-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 600;
}

.item-price {
    font-size: 1.4rem;
    color: var(--primary-color);
    font-weight: 700;
}

.remove-btn {
    background: rgba(255, 77, 77, 0.2);
    border: 1px solid rgba(255, 77, 77, 0.4);
    color: #ff4d4d;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.remove-btn:hover {
    background: rgba(255, 77, 77, 0.3);
    transform: scale(1.05);
}

/* Section de paiement Wave */
.payment-section {
    margin-top: 20px;
}

.wave-payment-box {
    background: linear-gradient(135deg, rgba(0, 166, 81, 0.1), rgba(0, 140, 68, 0.05));
    border: 2px solid rgba(0, 166, 81, 0.3);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.3s ease;
}

.wave-payment-box:hover {
    border-color: rgba(0, 166, 81, 0.5);
    background: linear-gradient(135deg, rgba(0, 166, 81, 0.15), rgba(0, 140, 68, 0.08));
}

.wave-payment-box h4 {
    color: #00a651;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.merchant-info {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-gray);
    border-left: 3px solid #00a651;
}

.wave-payment-form {
    margin: 20px 0;
}

.wave-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.wave-input:focus {
    outline: none;
    border-color: #00a651;
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(0, 166, 81, 0.1);
}

.wave-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00a651, #008c44);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 166, 81, 0.3);
}

.wave-btn:hover {
    background: linear-gradient(135deg, #008c44, #007a3d);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 81, 0.5);
}

.wave-btn:active {
    transform: translateY(0);
}

.payment-instructions {
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 6px;
    border-left: 3px solid #00a651;
}

.payment-instructions p {
    margin: 0 0 10px 0;
    color: var(--text-light);
    font-weight: 600;
}

.payment-instructions ol {
    margin: 10px 0 0 20px;
    padding: 0;
    color: var(--text-gray);
    line-height: 1.8;
}

.payment-instructions li {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

/* --- STYLES POUR L'ADMINISTRATION DES LIENS WAVE --- */

.admin-wave-container {
    max-width: 1200px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row:has(.form-group:only-child) {
    grid-template-columns: 1fr;
}

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

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00a651;
}

/* Tableau des liens Wave */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.data-table thead {
    background: rgba(0, 191, 255, 0.2);
}

.data-table th {
    padding: 12px;
    text-align: left;
    color: var(--primary-color);
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    text-transform: uppercase;
    font-size: 0.85rem;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.link-preview {
    color: #00a651;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.link-preview:hover {
    color: #008c44;
    text-decoration: underline;
}

/* Badges de statut */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(0, 166, 81, 0.2);
    color: #00a651;
    border: 1px solid rgba(0, 166, 81, 0.4);
}

.badge-inactive {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.badge-danger {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.4);
}

/* Boutons d'action dans les tableaux */
.btn-icon {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-danger {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.4);
}

.btn-danger:hover {
    background: rgba(255, 77, 77, 0.3);
    transform: scale(1.05);
}

/* --- STYLES POUR LA VÉRIFICATION DES PAIEMENTS --- */

.pending-row {
    background: rgba(255, 193, 7, 0.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { background: rgba(255, 193, 7, 0.05); }
    50% { background: rgba(255, 193, 7, 0.1); }
}

.phone-number {
    font-family: 'Courier New', monospace;
    background: rgba(0, 166, 81, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #00a651;
    border: 1px solid rgba(0, 166, 81, 0.2);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ref-input {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-light);
    font-size: 0.85rem;
    width: 100%;
    font-family: 'Montserrat', sans-serif;
}

.ref-input:focus {
    outline: none;
    border-color: #00a651;
}

.btn-validate,
.btn-reject {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 0.9rem;
}

.btn-validate {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.btn-validate:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-reject {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.4);
}

.btn-reject:hover {
    background: rgba(255, 77, 77, 0.3);
}

/* Style pour les codes/références */
code {
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--primary-color);
    border: 1px solid rgba(0, 191, 255, 0.2);
}

/* Alertes personnalisées */
.alert-info {
    background: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #2196f3;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    color: #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Content card améliorée */
.content-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Responsive pour les paiements Wave */
@media (max-width: 768px) {
    .item-header {
        grid-template-columns: 80px 1fr;
        gap: 15px;
    }
    
    .item-price {
        grid-column: 1 / -1;
        text-align: left;
        margin-top: 10px;
    }
    
    .remove-btn {
        grid-column: 1 / -1;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px;
    }
    
    .action-buttons {
        min-width: 150px;
    }
    
    .cart-items-list {
        padding: 10px;
    }
    
    .cart-item-card {
        padding: 15px;
    }
}

/* Animations pour les transitions */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item-card {
    animation: slideInUp 0.3s ease-out;
}

/* Style pour les tables responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--border-radius);
}

/* Amélioration des formulaires Wave */
.wave-payment-form .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-light);
    font-weight: 600;
}

.wave-payment-form .form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* Icônes dans les boutons */
.wave-btn i,
.btn-validate i,
.btn-reject i {
    font-size: 1.1em;
}

/* États de chargement (optionnel pour futures améliorations) */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Amélioration de la lisibilité sur fond sombre */
.wave-payment-box p,
.payment-instructions p,
.merchant-info {
    line-height: 1.6;
}

/* Style pour les listes d'instructions */
.payment-instructions ol {
    counter-reset: instruction-counter;
    list-style: none;
    padding-left: 0;
}

.payment-instructions ol li {
    counter-increment: instruction-counter;
    padding-left: 35px;
    position: relative;
}

.payment-instructions ol li::before {
    content: counter(instruction-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #00a651;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Hover effects améliorés */
.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    transform: translateX(2px);
}

/* Style pour les messages de succès dans les formulaires */
.form-success-message {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid var(--success-color);
    color: var(--success-color);
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Style pour centrer les boutons submit dans l'admin */
.form-section .submit-btn {
    max-width: 300px;
    margin: 20px auto 0;
}

/* Amélioration du focus pour l'accessibilité */
.wave-input:focus,
.ref-input:focus,
.form-control:focus {
    box-shadow: 0 0 0 3px rgba(0, 191, 255, 0.1);
}

/* Style pour les liens de retour */
.back-to-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-to-link:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(-3px);
}

/* ================================================================
   GESTION DES VARIANTES DE TEXTE DU BOUTON SELON LA TAILLE D'ÉCRAN
   À ajouter après les corrections précédentes
   ================================================================ */

/* Par défaut: texte complet visible */
.navbar .user-menu .btn-text-full {
    display: inline;
}

.navbar .user-menu .btn-text-short {
    display: none;
}

/* Sur tablette (768px et moins): texte complet */
@media (max-width: 768px) {
    .navbar .user-menu .btn-text-full {
        display: inline;
    }
    
    .navbar .user-menu .btn-text-short {
        display: none;
    }
}

/* Sur mobile (480px et moins): texte court "Connexion" */
@media (max-width: 480px) {
    .navbar .user-menu .btn-text-full {
        display: none;
    }
    
    .navbar .user-menu .btn-text-short {
        display: inline !important;
    }
}

/* Sur très petit mobile (360px et moins): seulement l'icône */
@media (max-width: 360px) {
    .navbar .user-menu .btn-text-full,
    .navbar .user-menu .btn-text-short {
        display: none !important;
    }
    
    .navbar .user-menu .submit-btn i {
        margin-right: 0 !important;
    }
    
    .navbar .user-menu .submit-btn {
        padding: 8px !important;
        width: 38px;
        height: 38px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
    }
}