/* ============================================
   CSS MODULES DE COURS - STRUCTURE OPTIMISÉE
   Compatible Desktop & Mobile
   ============================================ */

/* ============================================
   1. VARIABLES ET ANIMATIONS
   ============================================ */

:root {
    /* Couleurs Lycée */
    --lycee-primary: #11998e;
    --lycee-secondary: #38ef7d;
    --lycee-hover: #4ecdc4;
    
    /* Couleurs Collège */
    --college-primary: #f093fb;
    --college-secondary: #f5576c;
    
    /* Espacements Desktop */
    --spacing-desktop: 20px;
    --padding-header-desktop: 20px;
    --padding-body-desktop: 25px 20px;
    --font-size-header-desktop: 20px;
    --font-size-link-desktop: 18px;
    
    /* Espacements Mobile */
    --spacing-mobile: 12px;
    --padding-header-mobile: 15px;
    --padding-body-mobile: 15px;
    --font-size-header-mobile: 17px;
    --font-size-link-mobile: 14px;
}

@keyframes shine {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

@keyframes shine-cours {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(25px, 25px); }
}

/* ============================================
   2. STYLES DE BASE - MODULE STANDARD
   ============================================ */

.module-cours {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.module-cours:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25);
}

/* En-tête du module */
.module-cours .module-header {
    background: linear-gradient(135deg, var(--lycee-primary) 0%, var(--lycee-secondary) 100%);
    color: white;
    padding: var(--padding-header-desktop);
    font-size: var(--font-size-header-desktop);
    font-weight: 700;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* THÈMES COLOR SWITCHER - 100% */

/* Thème Bleu */
body[data-theme="blue"] .module-cours .module-header {
    background: linear-gradient(135deg, #4a5dc7 0%, #3a4db7 100%);
}

/* Thème Vert */
body[data-theme="green"] .module-cours .module-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Thème Orange */
body[data-theme="orange"] .module-cours .module-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Thème Rouge */
body[data-theme="red"] .module-cours .module-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Thème Noir */
body[data-theme="black"] .module-cours .module-header {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

/* Thème Violet */
body[data-theme="purple"] .module-cours .module-header {
    background: linear-gradient(135deg, #9b42bf 0%, #7e22a0 100%);
}

.module-cours .module-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    animation: shine 3s ease-in-out infinite;
}

/* Variante Collège */
.module-cours.module-college .module-header {
    background: linear-gradient(135deg, var(--college-primary) 0%, var(--college-secondary) 100%);
}

/* Corps du module */
.module-cours .module-body {
    padding: var(--padding-body-desktop);
}

.module-cours .module-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.module-cours .module-body li {
    margin-bottom: 12px;
}

.module-cours .module-body li:last-child {
    margin-bottom: 0;
}

/* Liens du module */
.module-cours .module-body a {
    display: block;
    color: #333;
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 10px;
    font-size: var(--font-size-link-desktop);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: rgba(102, 126, 234, 0.05);
}

.module-cours .module-body a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: linear-gradient(135deg, var(--lycee-primary) 0%, var(--lycee-secondary) 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

/* Thèmes pour la barre latérale des liens */
body[data-theme="blue"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #4a5dc7 0%, #3a4db7 100%);
}

body[data-theme="green"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

body[data-theme="orange"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

body[data-theme="red"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

body[data-theme="black"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

body[data-theme="purple"] .module-cours .module-body a::before {
    background: linear-gradient(135deg, #9b42bf 0%, #7e22a0 100%);
}

.module-cours.module-college .module-body a::before {
    background: linear-gradient(135deg, var(--college-primary) 0%, var(--college-secondary) 100%);
}

.module-cours .module-body a:hover {
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.1) 0%, rgba(56, 239, 125, 0.1) 100%);
    padding-left: 25px;
    color: var(--lycee-primary);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.2);
}

.module-cours.module-college .module-body a:hover {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    color: var(--college-secondary);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.2);
}

.module-cours .module-body a:hover::before {
    transform: scaleY(1);
}

.module-cours .module-body a::after {
    content: '→';
    position: absolute;
    right: 15px;
    opacity: 0;
    transition: all 0.3s ease;
}

.module-cours .module-body a:hover::after {
    opacity: 1;
    right: 10px;
}

/* ============================================
   3. STYLES JOOMLA - MODULE SIMPLE (OVERRIDES)
   ============================================ */

/* Reset et container principal */
.cours-simple,
.cours-simple .mod-menu,
.cours-simple .menu,
.cours-simple .moduletable {
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    max-width: 320px !important;
    width: 100% !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
    border: none !important;
}

.cours-simple:hover {
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25) !important;
}

/* Reset complet des éléments enfants */
.cours-simple *,
.cours-simple .card,
.cours-simple .card-body {
    box-sizing: border-box !important;
	
}

.cours-simple .card,
.card-body {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* En-têtes */
.cours-simple h3,
.cours-simple .card-header,
.cours-simple .module-title,
.cours-simple .page-header {
    background: linear-gradient(135deg, var(--lycee-hover) 0%, #44a08d 100%) !important;
    color: white !important;
    padding: var(--padding-header-desktop) !important;
    font-size: var(--font-size-header-desktop) !important;
    font-weight: 700 !important;
    text-align: center !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 12px 12px 0 0 !important;
    position: relative !important;
    overflow: hidden !important;
    transition: background 0.3s ease !important;
}

/* THÈMES COLOR SWITCHER pour .cours-simple - 100% */

/* Thème Bleu */
body[data-theme="blue"] .cours-simple h3,
body[data-theme="blue"] .cours-simple .card-header,
body[data-theme="blue"] .cours-simple .module-title {
    background: linear-gradient(135deg, #4a5dc7 0%, #3a4db7 100%) !important;
}

/* Thème Vert */
body[data-theme="green"] .cours-simple h3,
body[data-theme="green"] .cours-simple .card-header,
body[data-theme="green"] .cours-simple .module-title {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

/* Thème Orange */
body[data-theme="orange"] .cours-simple h3,
body[data-theme="orange"] .cours-simple .card-header,
body[data-theme="orange"] .cours-simple .module-title {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

/* Thème Rouge */
body[data-theme="red"] .cours-simple h3,
body[data-theme="red"] .cours-simple .card-header,
body[data-theme="red"] .cours-simple .module-title {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

/* Thème Noir */
body[data-theme="black"] .cours-simple h3,
body[data-theme="black"] .cours-simple .card-header,
body[data-theme="black"] .cours-simple .module-title {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
}

/* Thème Violet */
body[data-theme="purple"] .cours-simple h3,
body[data-theme="purple"] .cours-simple .card-header,
body[data-theme="purple"] .cours-simple .module-title {
    background: linear-gradient(135deg, #9b42bf 0%, #7e22a0 100%) !important;
}

.cours-simple h3::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    left: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%) !important;
    animation: shine-cours 3s ease-in-out infinite !important;
}

/* Variante Collège */
.cours-simple.college h3,
.cours-simple.college .card-header,
.cours-simple.college .module-title {
    background: linear-gradient(135deg, var(--college-primary) 0%, var(--college-secondary) 100%) !important;
}

/* Corps du module */
.cours-simple .mod-menu__sub,
.cours-simple .menu,
.cours-simple .nav,
.cours-simple ul {
    padding: 15px !important;
    background: white !important;
    list-style: none !important;
        margin: 0 !important;
    border: none !important;
}

/* Items de liste */
.cours-simple li,
.cours-simple .nav-item,
.cours-simple .item {
    margin-bottom: 8px !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    display: block !important;
    width: 100% !important;
	font-size: 17px;
}

.cours-simple li:last-child {
    margin-bottom: 0 !important;
}

/* Liens */
.cours-simple a,
.cours-simple .nav-link,
.cours-simple .mod-menu__sub a {
    display: block !important;
    color: #333 !important;
    text-decoration: none !important;
    padding: 12px 15px !important;
    border-radius: 6px !important;
   /*font-size: var(--font-size-link-desktop) !important;*/
    font-weight: 500 !important;
    transition: all 0.3s ease !important;
    background: #f8f9fa !important;
    position: relative !important;
    overflow: hidden !important;
    border: none !important;
    margin: 0 !important;
}

/* Barre latérale colorée */
.cours-simple a::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    height: 100% !important;
    width: 3px !important;
    background: linear-gradient(135deg, var(--lycee-hover) 0%, #44a08d 100%) !important;
    transform: scaleY(0) !important;
    transition: transform 0.3s ease !important;
}

/* Thèmes pour barre latérale cours-simple */
body[data-theme="blue"] .cours-simple a::before {
    background: linear-gradient(135deg, #4a5dc7 0%, #3a4db7 100%) !important;
}

body[data-theme="green"] .cours-simple a::before {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

body[data-theme="orange"] .cours-simple a::before {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

body[data-theme="red"] .cours-simple a::before {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
}

body[data-theme="black"] .cours-simple a::before {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%) !important;
}

body[data-theme="purple"] .cours-simple a::before {
    background: linear-gradient(135deg, #9b42bf 0%, #7e22a0 100%) !important;
}

.cours-simple.college a::before {
    background: linear-gradient(135deg, var(--college-primary) 0%, var(--college-secondary) 100%) !important;
}

/* État hover */
.cours-simple a:hover,
.cours-simple a:focus,
.cours-simple .nav-link:hover {
    background: rgba(78, 205, 196, 0.08) !important;
    padding-left: 20px !important;
    color: #44a08d !important;
    text-decoration: none !important;
    transform: none !important;
}

.cours-simple.college a:hover,
.cours-simple.college a:focus {
    background: rgba(240, 147, 251, 0.08) !important;
    color: var(--college-secondary) !important;
}

.cours-simple a:hover::before,
.cours-simple a:focus::before {
    transform: scaleY(1) !important;
}

/* État actif */
.cours-simple .active > a,
.cours-simple .current > a,
.cours-simple a.active {
    background: rgba(78, 205, 196, 0.6) !important;
    color: #44a08d !important;
    font-weight: 600 !important;
	font-size: 18px;
}

.cours-simple.college .active > a,
.cours-simple.college .current > a,
.cours-simple.college a.active {
    background: rgba(240, 147, 251, 0.12) !important;
    color: var(--college-secondary) !important;
}

/* Reset décorations */
.cours-simple ul::before,
.cours-simple ul::after,
.cours-simple li::before,
.cours-simple li::after {
    display: none !important;
    content: none !important;
}

/* Sous-menus */
.cours-simple .nav-child,
.cours-simple .sub-menu,
.cours-simple ul ul {
    padding: 0 0 0 15px !important;
    margin-top: 5px !important;
    background: transparent !important;
}

.cours-simple .nav-child a,
.cours-simple .sub-menu a {
    font-size: 14px !important;
    padding: 10px 12px !important;
}

/* Icônes */
.cours-simple .icon,
.cours-simple .fas,
.cours-simple .fa {
    margin-right: 8px !important;
    color: inherit !important;
}

/* Reset Bootstrap/Joomla */
.cours-simple .list-unstyled {
    padding: 15px !important;
}

.cours-simple .nav-pills .nav-link,
.cours-simple .nav-tabs .nav-link {
    border: none !important;
}

.cours-simple .dropdown-menu {
    position: static !important;
    float: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* ============================================
   4. RESPONSIVE - MOBILE FIRST (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    
    /* ========== MODULE STANDARD ========== */
    
    .module-cours {
        border-radius: 15px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    }
    
    .module-cours:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
    }
    
    .module-cours .module-header {
        font-size: var(--font-size-header-mobile);
        padding: var(--padding-header-mobile);
    }

    .module-cours .module-body {
        padding: var(--padding-body-mobile);
    }
    
    .module-cours .module-body li {
        margin-bottom: 8px;
    }

    .module-cours .module-body a {
        font-size: var(--font-size-link-mobile);
        padding: 10px 12px;
        border-radius: 8px;
    }
    
    .module-cours .module-body a:hover {
        padding-left: 20px;
    }
    
    .module-cours .module-body a::after {
        right: 12px;
        font-size: 14px;
    }
    
    .module-cours .module-body a:hover::after {
        right: 8px;
    }
    
    /* ========== MODULE JOOMLA SIMPLE ========== */
    
    .cours-simple,
    .cours-simple .mod-menu,
    .cours-simple .moduletable {
        max-width: 100% !important;
        border-radius: 10px !important;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
    }
    
    .cours-simple:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18) !important;
    }

    .cours-simple h3,
    .cours-simple .card-header,
    .cours-simple .module-title {
        padding: var(--padding-header-mobile) !important;
        font-size: var(--font-size-header-mobile) !important;
        border-radius: 10px 10px 0 0 !important;
    }

    .cours-simple .mod-menu__sub,
    .cours-simple .menu,
    .cours-simple ul {
        padding: var(--spacing-mobile) !important;
    }
    
    .cours-simple li {
        margin-bottom: 6px !important;
    }

    .cours-simple a,
    .cours-simple .nav-link {
        padding: 10px 12px !important;
        font-size: var(--font-size-link-mobile) !important;
        border-radius: 5px !important;
    }
    
    .cours-simple a:hover {
        padding-left: 18px !important;
    }
    
    .cours-simple a::before {
        width: 2px !important;
    }
    
    .cours-simple .nav-child a,
    .cours-simple .sub-menu a {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
    
    /* Optimisation tactile */
    .cours-simple a,
    .module-cours .module-body a {
        min-height: 44px; /* Taille minimale recommandée pour tactile */
        display: flex;
        align-items: center;
    }
}

/* ============================================
   5. RESPONSIVE - TABLETTES (768px - 1024px)
   ============================================ */

@media (min-width: 769px) and (max-width: 1024px) {
    
    .module-cours,
    .cours-simple {
        max-width: 280px;
    }
    
    .module-cours .module-header,
    .cours-simple h3,
    .cours-simple .module-title {
        font-size: 18px !important;
        padding: 18px !important;
    }
    
    .module-cours .module-body a,
    .cours-simple a {
        font-size: 17px !important;
    }
}

/* ============================================
   6. RESPONSIVE - TRÈS PETITS ÉCRANS (max-width: 480px)
   ============================================ */

@media (max-width: 480px) {
    
    .module-cours,
    .cours-simple {
        border-radius: 8px !important;
    }
    
    .module-cours .module-header,
    .cours-simple h3 {
        font-size: 16px !important;
        padding: 12px !important;
    }
    
    .module-cours .module-body,
    .cours-simple .menu {
        padding: 10px !important;
    }
    
    .module-cours .module-body a,
    .cours-simple a {
        font-size: 13px !important;
        padding: 8px 10px !important;
    }
    
    .cours-simple li {
        margin-bottom: 5px !important;
    }
}

/* ============================================
   7. MODE SOMBRE (optionnel)
   ============================================ */

@media (prefers-color-scheme: dark) {
    
    .module-cours,
    .cours-simple {
        background: rgba(30, 30, 30, 0.95) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    }
    
    .module-cours .module-body a,
    .cours-simple a {
        color: #e0e0e0 !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }
    
    .module-cours .module-body a:hover,
    .cours-simple a:hover {
        color: #fff !important;
    }
}