:root {
    --primary: #6a5acd;
    --secondary: #ff6b6b;
    --accent: #4ecdc4;
    --light: #f7f9fc;
    --dark: #2d3436;
    --success: #2ecc71;
    --warning: #f39c12;
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
}

body {
    background: var(--bg-gradient);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark);
    overflow-x: hidden;
}

/* Navigation principale */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}
.user-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espace entre les éléments */
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Pill shape */
    text-decoration: none;
    font-weight: 600;
    color: #4A5568; /* gray-700 */
    background-color: #F7FAFC; /* gray-100 */
    transition: all 0.2s ease-in-out;
    border: 1px solid #E2E8F0; /* gray-300 */
}

.nav-button:hover {
    background-color: #E2E8F0; /* gray-300 */
    color: #2D3748; /* gray-800 */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.nav-button i {
    font-size: 1.25rem;
}

.nav-button-text {
    font-size: 0.9rem;
}

/* Styles pour le sélecteur de langue (déjà existants, juste pour info) */
.language-switcher {
    display: flex;
    gap: 0.5rem;
}

/* Bouton de déconnexion spécifique */
.logout-link {
    background-color: transparent;
    border: none;
    color: #718096; /* gray-500 */
    padding: 0.5rem;
}
.logout-link:hover {
    color: #E53E3E; /* red-600 */
}

.nav-button-text-mobile {
    display: none; /* Cacher le texte sur grand écran par défaut */
}

/* Responsive Design pour la navigation */
@media (max-width: 768px) {
    .main-nav-container {
        padding: 0 1rem;
    }
    .nav-button-text {
        display: none; /* Cache le texte sur les petits écrans pour gagner de la place */
    }
    .nav-button {
        padding: 0.75rem; /* Boutons ronds sur mobile */
    }
    .user-actions {
        gap: 0.75rem;
    }
    .logout-link .fa-sign-out-alt {
        margin-right: 0; /* Pas de marge si le texte est caché */
    }
}
.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    color: var(--primary);
    font-size: 1.8rem;
}

.logo img {
    width: 15rem;
    height: 4rem;
    object-fit: contain;
}

.language-switcher {
    display: flex;
    gap: 10px;
    background: var(--light);
    padding: 8px 15px;
    border-radius: 30px;
}

.lang-btn {
    background: transparent;
    border: none;
    padding: 5px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

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

.back-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    margin-bottom: 1em;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

/* Page d'accueil */
.home-page {
    display: block;
}

.header {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.header h1 {
    color: var(--primary);
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.header p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 25px;
    color: var(--dark);
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

#search-bar {
    width: 100%;
    padding: 15px 20px 15px 50px;
    font-size: 1.1rem;
    border-radius: 30px;
    border: 2px solid #ddd;
    transition: border-color 0.3s ease;
}

#search-bar:focus {
    outline: none;
    border-color: var(--primary);
}

.search-container i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.domains-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.domain-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.domain-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.domain-header {
    padding: 25px 20px;
    text-align: center;
    color: white;
    position: relative;
}

.domain-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.domain-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.domain-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.domain-description {
    margin-bottom: 20px;
    line-height: 1.6;
    flex-grow: 1;
}

.btn-explore {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 15px;
    align-self: center;
}

.btn-explore:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

/* Page matière */
.subject-page {
    display: none;
}

.subject-header {
    padding: 30px;
    text-align: center;
    color: white;
    border-radius: 20px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.subject-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

.subject-description {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.levels-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.level-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.level-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.level-header {
    font-size: 1.3rem;
    font-weight: 600;
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.level-content {
    padding: 0;
}
a{
    text-decoration :none;
}

.level-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

.modules-list-container {
    list-style: none;
    padding: 0;
}

.module-item, .submodule-item {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: var(--light);
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-item a, .submodule-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.module-item:hover, .submodule-item:hover {
    background: var(--accent);
    color: white;
    transform: translateX(5px);
}

.module-item.expandable {
    cursor: pointer;
    justify-content: space-between;
}

.module-item.expandable .arrow-icon {
    transition: transform 0.3s ease;
}

.module-item.expandable.expanded .arrow-icon {
    transform: rotate(90deg);
}

.submodules-list {
    list-style: none;
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    margin-top: 0;
    margin-bottom: 12px;
}

.submodule-item {
    background: #e9eef2;
}

.module-item i, .submodule-item i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    color: var(--dark);
    font-size: 1rem;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.2; transform: scale(0.5); }
    50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .domains-grid, .levels-container {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .main-nav {
        flex-direction: column;
        gap: 15px;
    }
}
