/* Variables CSS pour le thème clair */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: transparent;
    --container-bg: #ffffffd3;
    --text-color: #212529;
    --card-bg: #e3efff;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --nav-bg: #f8f9fa;
    --nav-text: #212529;
    --dropdown-bg: #ffffff;
    --dropdown-text: #212529;
    --dropdown-hover: #e9ecef;
    --border-color: #e1e4e8;
    --input-border: #ddd;
    --input-bg: #ffffff;
    --header-bg: #2c3e50;
    --header-text: white;
    --menu-hover: rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
    --exercise-card-bg: #f8f9fa;
    --alert-bg: #d1ecf1;
    --alert-border: #bee5eb;
    --alert-text: #0c5460;
    --list-hover-bg: #f8f9fa;
}

/* Variables CSS pour le thème sombre */
html.dark-mode {
    --primary-color: #ffffff;
    --secondary-color: #6c757d;
    --background-color: transparent;
    --container-bg: #212529ca;
    --text-color: #f8f9fa;
    --card-bg: #343a40;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --nav-bg: #1a1d20;
    --nav-text: #ffffff;
    --dropdown-bg: #343a40;
    --dropdown-text: #f8f9fa;
    --dropdown-hover: #495057;
    --border-color: #404040;
    --input-border: #444;
    --input-bg: #333;
    --header-bg: #2c3e50;
    --header-text: #ffffff;
    --menu-hover: rgba(255, 255, 255, 0.2);
    --exercise-card-bg: #2d2d2d;
    --alert-bg: #1e3a5f;
    --alert-border: #2c5aa0;
    --alert-text: #b3d9ff;
    --list-hover-bg: #495057;
}

/* Styles de base */
html, body {
    min-height: 100vh;
    width: 100vw;
    background-color: var(--background-color) !important;
    background-image: url('../img/fond.jpg');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0;
}

html.dark-mode, html.dark-mode body {
    background-color: var(--background-color) !important;
    background-image: url('../img/fond.jpg');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
    background-image: url('../img/fond.jpg');
    background-size: 100% 100%;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.footer {
    margin-top: auto;
}

/* Navigation */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background-color: var(--nav-bg) !important;
    min-height: 56px;
}

.navbar-brand {
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar-brand:hover {
    background-color: var(--dropdown-hover);
    color: var(--text-color) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--nav-text);
}

.nav-link:hover {
    color: var(--text-color) !important;
    background-color: var(--dropdown-hover);
    border-radius: 5px;
}

/* Correction pour le mode clair */
.navbar-brand {
    color: var(--nav-text) !important;
}

.nav-link {
    color: var(--nav-text) !important;
}

/* Correction pour les nav-items en mode sombre */
html.dark-mode .nav-link {
    color: #f8f9fa !important;
}

html.dark-mode .nav-link:hover {
    color: #212529 !important;
    background-color: #f8f9fa !important;
}

/* Correction pour le navbar-brand en mode sombre */
html.dark-mode .navbar-brand {
    color: #f8f9fa !important;
    padding-left: 10px;
    padding-right: 10px;
}

html.dark-mode .navbar-brand:hover {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-radius: 5px;
}

/* Correction pour les boutons outline en mode sombre */
html.dark-mode .btn-outline-primary {
    color: #f8f9fa !important;
    border-color: #f8f9fa !important;
}

html.dark-mode .btn-outline-primary:hover {
    color: #212529 !important;
    background-color: #f8f9fa !important;
    border-color: #f8f9fa !important;
}

/* Logo Balzac */
.conteneur-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 20%;
}

.logo-balzac-wrapper {
    height: 100%;
    pointer-events: auto;
}

.logo-balzac-wrapper img {
    height: 56px;
    max-height: 100%;
    width: auto;
    display: block;
}

.conteneur-card{
    display: flex;
    justify-content: space-around;
}

.conteneur-card > .card {
    width: 40%;
}


/* Responsive pour les petits écrans */
@media (max-width: 1200px) {
    .logo-balzac-wrapper {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .navbar-nav {
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }
    
    .dropdown-menu {
        border: none;
        background-color: transparent;
        padding-left: 1rem;
    }
    
    .dropdown-item {
        color: var(--dropdown-text);
        padding: 0.5rem 1rem;
    }
    
    .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: white;
    }
}

@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Dropdown */
.dropdown-menu {
    background-color: var(--dropdown-bg);
    border-color: var(--card-shadow);
}

.dropdown-item {
    color: var(--dropdown-text);
}

.dropdown-item:hover {
    background-color: var(--dropdown-hover);
    color: var(--dropdown-text);
}

/* Theme Toggle */
#theme-toggle {
    color: var(--nav-text);
    padding: 0.5rem;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(15deg);
}

/* Cards */
.card {
    border: none !important;
    border-radius: 10px !important;
    box-shadow: var(--card-shadow) !important;
    background-color: var(--card-bg) !important;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1) !important;
}

.card-body {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

.card-title {
    color: var(--primary-color) !important;
    font-weight: bold;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

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

.btn-outline-primary {
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Main content */
#main {
    padding: 40px 0;
}

h1 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 30px;
}

h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: all 0.3s;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--header-bg);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.2);
}

/* Alerts */
.alert {
    border-left: 4px solid #0d6efd !important;
    background-color: var(--alert-bg) !important;
    border-color: var(--alert-border) !important;
    color: var(--alert-text) !important;
}

.alert-info {
    background-color: var(--alert-bg) !important;
    border-color: var(--alert-border) !important;
    color: var(--alert-text) !important;
}

/* Listes */
.list-group-item {
    transition: all 0.3s ease;
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

.list-group-item:hover {
    background-color: var(--list-hover-bg) !important;
}

/* Animations */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}

/* Styles spécifiques pour les exercices */
.exercise-card {
    background-color: var(--exercise-card-bg) !important;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.exercise-content {
    line-height: 1.6;
    color: var(--text-color) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        margin-bottom: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .conteneur {
        flex-direction: column;
        align-items: center;
    }

    .item {
        width: 100%;
        max-width: 300px;
    }

    .moyenne, .grande, .grand, .tgrande, .petite {
        width: 100%;
    }
}

/* Styles pour la page des élèves */
#conteneurheader {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

#element, #element2, #element3 {
    flex: 1;
    min-width: 200px;
    max-width: 300px;
}

#center {
    text-align: center;
    margin: 0.5rem 0;
}

.annee {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.classe {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s;
}

.classe h2 {
    text-align: center;
    color: var(--header-text);
    background-color: var(--header-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.lien {
    display: inline-block;
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
    margin: 0.5rem;
    min-width: 200px;
    max-width: 300px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--input-border);
}

.lien:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background-color: var(--header-bg);
    color: var(--header-text);
    text-decoration: none;
}

/* Styles pour les activités mentales */
.accueil {
    position: relative;
    padding: 2rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.contenu {
    position: relative;
    z-index: 1;
}

.conteneur {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.item {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    min-width: 150px;
    display: inline-block;
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background-color: var(--header-bg);
    opacity: 0.9;
    text-decoration: none;
}

.item-dl {
    background-color: #4CAF50;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.item-dl:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background-color: #45a049;
}

.conteneur-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.conteneur img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.moyenne {
    width: 45%;
}

.grande {
    width: 60%;
}

.grand {
    width: 70%;
}

.tgrande {
    width: 80%;
}

.petite {
    width: 30%;
}

.content ol {
    padding-left: 1.5rem;
    margin: 1.5rem 0;
}

.content ol li {
    margin-bottom: 1.5rem;
}

.content h2 {
    margin: 2rem 0 1rem;
    color: var(--text-color);
    font-size: 1.8rem;
}

.content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Media queries pour la page des élèves */
@media (max-width: 768px) {
    #conteneurheader {
        flex-direction: column;
        align-items: center;
    }

    #element, #element2, #element3 {
        width: 100%;
        max-width: none;
    }

    .classe {
        width: 100%;
        max-width: none;
    }

    .lien {
        width: 90%;
        max-width: none;
    }
}

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

.feature-card {
    animation: fadeIn 0.5s ease-out forwards;
}

.feature-card:nth-child(2) {
    animation-delay: 0.2s;
}

.feature-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* Forcer l'application des variables CSS sur Bootstrap */
html.dark-mode .card,
html.dark-mode .card-body,
html.dark-mode .alert,
html.dark-mode .list-group-item,
html.dark-mode .exercise-card {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

html.dark-mode .alert-info {
    background-color: var(--alert-bg) !important;
    color: var(--alert-text) !important;
}

html.dark-mode .list-group-item:hover {
    background-color: var(--list-hover-bg) !important;
}

html.dark-mode .exercise-card {
    background-color: var(--exercise-card-bg) !important;
}

/* Correction pour les éléments de contenu */
html.dark-mode p,
html.dark-mode h1,
html.dark-mode h2,
html.dark-mode h3,
html.dark-mode h4,
html.dark-mode h5,
html.dark-mode h6 {
    color: var(--text-color) !important;
}

/* Correction pour les liens */
html.dark-mode a {
    color: var(--primary-color) !important;
}

html.dark-mode a:hover {
    color: var(--hover-color) !important;
}

/* Correction pour les classes Bootstrap */
html.dark-mode .text-muted {
    color: #adb5bd !important;
}

html.dark-mode .text-secondary {
    color: #adb5bd !important;
}

html.dark-mode .form-text {
    color: #adb5bd !important;
}

html.dark-mode .lead {
    color: #e9ecef !important;
}

html.dark-mode .display-4 {
    color: var(--text-color) !important;
}

/* Forcer le fond du body */
html.dark-mode {
    background-color: var(--background-color) !important;
}

/* Correction pour les conteneurs */
.container {
    background-color: var(--container-bg) !important;
}

/* Exception pour le footer - pas de background */
.footer .container {
    background-color: transparent !important;
}


html.dark-mode .container {
    background-color: var(--container-bg) !important;
}

/* Exception pour le footer en mode sombre - pas de background */
html.dark-mode .footer .container {
    background-color: transparent !important;
}

/* Correction pour les dropdown en mode sombre */
html.dark-mode .dropdown-menu {
    background-color: #343a40 !important;
    border-color: #495057 !important;
}

html.dark-mode .dropdown-item {
    color: #f8f9fa !important;
}

html.dark-mode .dropdown-item:hover {
    background-color: #495057 !important;
    color: #ffffff !important;
} 