:root {
    --background-color: #f4f4f9;
    --primary-color: #003366;
    --text-color: #222;
    --link-color: #0056b3;
    --card-bg: #fff;
    --card-header-bg: #007bff;
    --card-header-text: #fff;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    margin-top:30px;
    transition: background 0.3s, color 0.3s;
}

header, footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 20px;
}

main {
    padding: 20px;
}

h1, h2, h3 {
    color: var(--link-color);
}

.search-container {
    margin-bottom: 20px;
}

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

.search-form input[type="text"] {
    padding: 10px;
    margin-right: 10px;
    width: 300px;
    border: 2px solid #ccc;
    border-radius: 4px;
}

.search-form button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.search-form button:hover {
    background-color: #45a049;
}

.cours-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

section.cours {
    background-color: #c0c8c2;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    padding: 15px;
}

.logiciel-list {
    list-style-type: none;
    padding: 0;
}

.logiciel {
    background: #f0f0f0;
    margin: 10px 0;
    padding: 10px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.logiciel a {
    color: var(--link-color);
    text-decoration: none;
}

.logiciel a:hover {
    text-decoration: underline;
}

footer p {
    margin: 0;
    font-size: var(--footer-text-size);
}

#titre {
    font-size: 24px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
}

/* Styles spécifiques à la page logiciel */
.logiciel-details {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.logiciel-details h2 {
    color: #333;
}

.logiciel-details p {
    color: #666;
}

.logiciel-details ul {
    list-style-type: none;
    padding: 0;
}

.logiciel-details ul li {
    margin-bottom: 10px;
}

.logiciel-details a {
    color: #007bff;
    text-decoration: none;
}

.logiciel-details a:hover {
    text-decoration: underline;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.top-right-image {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px; /* Adjust the size as needed */
    height: auto;
}
header .auth-buttons {
    display: flex;
    gap: 10px;
}

.auth-buttons .btn {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
}

.auth-buttons .btn:hover {
    background-color: #0056b3;
}
/* Pour le grand conteneur de la page */
.container {
    padding: 50px;
    margin-top: 30px;
    
  }
  
  /* Pour l'en-tête de la carte */
  .card-header {
    background-color: #007bff;
    text-align: center;
  }
  
  .card-title {
    color: #fff;
  }
  
  /* Pour le texte du lien "Forgot Password?" */
  .btn-link.small {
    font-size: 14px;
  }
  
  
  /* Pour les boutons "Se connecter" et "Inscription" */
  .btn-primary {
    background-color: #007bff;
    color: #fff;
    padding:0.75%;
    display: block;
    margin-bottom:15px;
    margin-right: 15px;
    border-radius: 20px; /* Bord arrondi */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1); /* Ombre */
    transition: 0.3s; /* Effet hover de 0.3 secondes */
  }
  
  .btn-success {
    background-color: hsla(134, 84%, 44%, 0.648);
    color: #fff;
    font-size:14px;
    padding: 0.75%;
    margin-top:15px;
    
    border-radius: 20px; /* Bord arrondi */
    box-shadow: 0 3px 6px #fdf9f9db; /* Ombre */
    transition: 0.3s; /* Effet hover de 0.3 secondes */
    margin-left: 45px;
  }
  
  .btn-primary:hover, .btn-success:hover {
    background-color: #0056b3; /* Couleur légèrement plus foncée au survol */
    transform: scale(1.05); /* Effet d'agrandissement au survol */
  }
p{
    margin-bottom:20px;
}
.card-body{
    border-radius: 15px;
    box-shadow: 0 6px 6px rgba(0, 0, 0, 0.1); /* Ombre */
    background-color: aliceblue;
    padding: 5%;

}
#alert-info-mt-3{
    display:flex;
    margin-left: 90px;
}
ul{
    list-style-type: none;
}

.header a{
    text-decoration:none;
    color:white;
    border: 1.5px solid rgba(0, 0, 0, 0.871);
    padding: px;
    margin: 2px;
    background-color:#4CAF50;
}
.header-right a{
    text-decoration:none;
    color:white;
    border: 1.5px solid rgba(0, 0, 0, 0.871);
    background-color:hsl(180, 3%, 33%);
    
   
}
header {
    color: white;
    padding: 20px;
    position: relative; /* Pour positionner le nav */
}
form{
    margin-bottom: 35px;
}

.image-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px; /* Adjust the size as needed */
    height: auto;
}

nav {
    position: absolute;
    top: 20px;
    left: 20px;
}

nav ul {
    list-style: none; /* Pour enlever les puces de liste */
    padding: 0;
    margin: 0;
}

nav ul li {
    display: inline; /* Pour afficher les éléments en ligne */
    margin-right: 10px; /* Pour ajouter un espace entre les éléments */
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.header-logout a{
    text-decoration:none;
    color:white;
    border: 1.5px solid rgba(0, 0, 0, 0.871);
    padding: 5px;
    margin: 2px;
    background-color: hsl(0, 98%, 49%);
}

.header-logout {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    position: relative; /* Pour positionner le nav */
}

ul.admin-teacher-box {
    padding: 0;
    margin: 20px 0;
    list-style-type: none;
    display: flex;
   
    width:70%;


}



.header {
    margin: 10px;
    margin-bottom: 30px;
    
}

.button {
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
   
   
   
}

.button:hover {

    background-color: #0056b3;
}

.cours-title a {
    color: var(--link-color);
    text-decoration: none;
}
.cours-title a:hover {
    text-decoration: underline;
}

/* Styles spécifiques à la page cours */
.cours-details {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.cours-details h2 {
    color: #333;
}

.cours-details p {
    color: #666;
}

.cours-details ul {
    list-style-type: none;
    padding: 0;
}

.cours-details ul li {
    margin-bottom: 10px;
}

.cours-details a {
    color: #222 !important;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.cours-details a:hover {
    color: #555 !important;
    text-decoration: underline;
}

/* Design moderne et classique pour la page de détail d'un cours */
.cours-details {
    max-width: 700px;
    margin: 40px auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding: 0;
    overflow: hidden;
}

.cours-details .card {
    border: none;
    background: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
}

.cours-details .card-header {
    background: linear-gradient(90deg, #007bff 60%, #0056b3 100%);
    padding: 32px 24px 16px 24px;
    text-align: center;
}

.cours-details .card-header h1 {
    color: #fff;
    font-size: 2.2em;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.cours-details .card-title {
    color: #fff;
    font-size: 1.5em;
    margin-bottom: 0;
}

.cours-details .card-body {
    padding: 32px 24px;
    background: #f8fafc;
}

.cours-details h4 {
    color: #007bff;
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.cours-details p {
    color: #333;
    font-size: 1.1em;
    margin-bottom: 18px;
}

.cours-details ul {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
}

.cours-details ul li {
    margin-bottom: 8px;
    font-size: 1em;
}

.cours-details a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.cours-details a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.darkmode-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  background: var(--card-header-bg, #23272e);
  color: var(--card-header-text, #e0e0e0);
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.darkmode-toggle:hover {
  background: var(--link-color, #6ea8fe);
  color: #fff;
}

@media (max-width: 800px) {
    .cours-details {
        max-width: 98%;
        margin: 20px 1%;
        padding: 0;
    }
    .cours-details .card-header,
    .cours-details .card-body {
        padding: 18px 8px;
    }
}

@media (max-width: 700px) {
    nav {
        position: static; /* Pour rendre le nav positionné de manière normale sur les petits écrans */
        text-align: center;
        margin-top: 20px;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin-right: 0; /* Enlever la marge droite pour les éléments en colonne */
        margin-bottom: 10px;}
        ul.admin-teacher-box {
            flex-direction: column;
        }
    
        .header {
            width: 100%;
            margin: 5px 0;
            margin-bottom: 30px;
        }

    }

/* Dark mode variables */
body.dark-mode {
    --background-color: #10111491;
    --primary-color: #181c22;
    --text-color: #0a0000;
    --link-color: #060bac;
    --card-bg: #2b3037;
    --card-header-bg: #23272e;
    --card-header-text: #e0e0e0;
}

.cours-details.dark-mode, .logiciel-details.dark-mode, .container.dark-mode, .card.dark-mode {
    background: var(--card-bg);
    color: var(--text-color);
}

.card-header.dark-mode, .cours-details .card-header.dark-mode {
    background: var(--card-header-bg);
    color: var(--card-header-text);
}

.cours-details.dark-mode a, .logiciel-details.dark-mode a, a.dark-mode {
    color: var(--link-color) !important;
}

.cours-details.dark-mode a:hover, .logiciel-details.dark-mode a:hover, a.dark-mode:hover {
    color: #fff !important;
}

header.dark-mode, footer.dark-mode {
    background: var(--card-header-bg);
    color: var(--card-header-text);
}

