/* Styles généraux */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1f1f1f; /* Couleur de fond par défaut pour le dark mode */
    color: #e0e0e0; /* Couleur de texte par défaut pour le dark mode */
}
header.dark-mode {
    background-color: #002347;
    color: #e0e0e0;
}

/* ---------------------------------- */
/* Styles pour la barre de navigation */
.navbar {
    background-color: #002347;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Styles pour le logo */
.logo {
    width: 10vh;
    height: 4vh;
    background-image: url("../images/meta/logo.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    padding: 10px 20px;
    margin-left: 10px;
}

/* Styles pour les liens de navigation */
.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

/* Les liens de niveau supérieur sont cliquables */
.nav-item a {
    color: white;
    text-decoration: none;
    padding: 15px;
    display: block;
}

/* Styles pour les sous-menus */
.dropdown {
    display: none; /* Caché par défaut */
    position: absolute;
    top: 40px;
    left: 0;
    background-color: #002347;
    list-style: none;
    padding: 0;
    margin: 0;
    transition: all 0.3s ease; /* Ajout de la transition */
    width: max-content;
    z-index: 10;
}

.dropdown li a {
    display: block;
    color: white;
    background-color: #002347;
}

/* Styles pour l'icône du changement de thème */
#theme-toggle {
    padding: unset;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.5em;
    cursor: pointer;
}

#theme-toggle:hover {
    color: #bb86fc;
}

/* Styles pour les boutons d'authentification */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 10px;
}

.auth-buttons button {
    border: none;
    color: #fff;
    /* padding: 10px 20px; */
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
}

#login-button {
    background-color: #bb86fc;
    padding: 10px 20px;
}

#login-button:hover {
    background-color: #a074c8;
}

.small-item {
    display: none !important; 
}
/* ---------------------------------- */
/* Styles pour le menu de profil */
/* ---------------------------------- */
.profile-menu {
    position: relative;
    display: inline-block;
}

.profile-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.profile-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #bb86fc;
    transition: box-shadow 0.2s;
    object-fit: cover;
}

.profile-icon:hover, .profile-btn:focus .profile-icon {
    box-shadow: 0 0 0 3px #bb86fc55;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 54px;
    background: #23243a;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 12px;
    min-width: 220px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #333;
    animation: fadeInMenu 0.2s;
}

.profile-menu.open .dropdown-content {
    display: block;
}

.profile-header {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #1a1b2e;
}

.profile-dropdown-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #bb86fc;
    margin-right: 12px;
    object-fit: cover;
}

.profile-dropdown-info {
    display: flex;
    flex-direction: column;
}

.profile-dropdown-name {
    font-weight: bold;
    color: #fff;
    font-size: 1.1em;
}

.profile-dropdown-role {
    color: #bb86fc;
    font-size: 0.95em;
}

.dropdown-divider {
    height: 1px;
    background: #333;
    margin: 0;
    border: none;
}

.dropdown-content a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1em;
    transition: background 0.15s;
    border: none;
    background: none;
}

.dropdown-content a:hover {
    background: #333;
    color: #bb86fc;
}

body.light-mode .dropdown-content {
    background: #fff;
    border: 1px solid #eee;
}
body.light-mode .profile-header {
    background: #f4f4f4;
}
body.light-mode .profile-dropdown-name {
    color: #23243a;
}
body.light-mode .profile-dropdown-role {
    color: #bb86fc;
}
body.light-mode .dropdown-content a {
    color: #23243a;
}
body.light-mode .dropdown-content a:hover {
    background: #f0f0f0;
    color: #bb86fc;
}


/* Styles pour les sous-menus en mode PC */
@media (min-width: 993px) {
    .nav-item:hover .dropdown {
        display: block;
    }

    .menu-toggle {
        display: none; /* Cacher le bouton de menu sur les écrans larges */
    }
}

/* Styles pour les tablettes */
@media (max-width: 992px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #004080;
        position: absolute;
        top: 57px;
        left: 0;
        z-index: 10;
    }

    .nav-links.active {
        display: flex;
        z-index: 1000;
    }

    .menu-toggle {
        display: block;
        font-size: 1.5rem;
        margin: 10px;
    }

    .nav-item {
        width: 100%;
    }

    .nav-item a {
        padding: 15px 20px;
        width: unset;
    }

    .auth-buttons i, #theme-toggle {
        font-size: 1.2em;
    }

    .dropdown {
        display: none; /* Assurez-vous que les sous-menus sont cachés par défaut en mode mobile */
        position: static; /* Reset pour le mode mobile */
        box-shadow: none;
        width: unset;
    }

    .dropdown.active {
        display: block; /* Affiche le sous-menu lorsqu'il est actif en mode mobile */
    }

    .dropdown li a {
        padding-left: 30px;
        background-color: unset;
    }

    .dropdown .small-item {
        display: block !important; /* Affiche les éléments de sous-menu en mode mobile */
    }
}

/* For screens less than 480px wide (small mobile devices) */
@media (max-width: 480px) {
    .auth-buttons{
        gap: 5px;
    }

    .auth-buttons button{
        font-size: 0.8em;
    }
    
    .menu-toggle {
        margin: 5px;
    }

    .logo {
        width: 8vh;
        height: 4vh;
    }

    .nav-links {
        top: 50px;
    }

    .auth-buttons i, #theme-toggle {
        font-size: 1em;
    }

    .auth-buttons button{
        padding: 10px 15px;
    }
}

/* ---------------------------------- */
/* Styles pour le footer */
footer {
    background-color: #002347;
    color: #e0e0e0;
    text-align: center;
    padding: 10px;
    position: relative;
    bottom: 0;
    width: calc(100% - 20px);
}

.small-footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
}

.social-media a {
    color: #bb86fc; /* Couleur de lien pour les réseaux sociaux en dark mode */
    margin: 0 10px;
    text-decoration: none;
}

@media (max-height: 810px) {
    .small-footer {
        position: unset;
        left: unset;
        bottom: unset;
        width: unset;
    }
}

/* ---------------------------------- */
/* Styles pour la page */
.section {
    padding: 20px;
    background-color: #333; /* Couleur de fond pour le dark mode */
    margin: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section h1, .section h2, .section h3, form h2 {
    border-bottom: 2px solid #bb86fc; /* Couleur d'accentuation pour le dark mode */
    padding-bottom: 10px;
    color: #bb86fc;
}

h1 {
    font-size: 2em;
    margin-bottom: 20px;
}

.container {
    width: 80%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------------------------------- */
/* Styles pour le changement de thème */
body.light-mode {
    background-color: #f4f4f4;
    color: #000;
}

header.light-mode {
    background-color: #004080;
    color: #fff;
}

/* Styles pour le mode clair */
body.light-mode nav ul li ul {
    background-color: #fff;
}

body.dark-mode nav ul li ul li a:hover {
    background-color: #f0f0f0;
    color: #004080;
}

body.light-mode nav ul li ul li a:hover {
    background-color: #f0f0f0;
    color: #004080;
}

body.light-mode .dropdown-content {
    background-color: #f4f4f4;
}

body.light-mode .dropdown-content a {
    color: #333;
}

body.light-mode .dropdown-content a:hover {
    background-color: #f0f0f0;
}

.section.light-mode {
    background-color: #fff !important;
    color: #333;
    border: none;
}

.section.light-mode a {
    color: #004080;
}

/* Styles pour le chronomètres */
.timer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-family: 'Arial', sans-serif;
}

.timer-container {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.time-unit {
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #333;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 80px;
}

.time-value {
    font-size: 2rem;
    font-weight: bold;
}

.time-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-top: 5px;
    letter-spacing: 1px;
}

.timer .time-unit:nth-child(odd) {
    background-color: #444;
}

.timer .time-unit:nth-child(even) {
    background-color: #555;
}

@media (max-width: 1024px) {
    /* .container h1, main:first-of-type h1 {
        width: 70% !important;
    } */
    .timer {
        text-align: center;
    }

    h2 {
        margin-bottom: 15px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: unset;
        width: unset;
        padding: 5px;
    }

    body.light-mode nav ul li ul li a {
        color: #004080;
    }
}

@media (max-width: 768px) {
    /* .container h1, main:first-of-type h1 {
        width: 95% !important;
        font-size: 1.5em;
    } */
    .timer-container {
        gap: 10px;
    }
    .time-unit {
        padding: 5px;
        min-width: 60px;
    }
}

@media (max-width: 480px) {
    .section{
        padding: 10px;
    }
    .timer-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        justify-items: center;
    }

    /* Placer heures, minutes, secondes sur la même ligne */
    .timer-container .time-unit:nth-child(n+3) {
        grid-column: span 2;
        display: flex;
        justify-content: space-around;
        width: 80%;
        flex-direction: row;

    }
}