@import url("./general.css");

/* ========================================= */
/* BARRE DE NAVIGATION                       */
/* ========================================= */

.navbar {
    /* Permet de positionner le menu par rapport à cette barre */
    position: relative;

    /* Espace autour du menu */
    padding: 20px;
}


/* ========================================= */
/* BOUTON BURGER                             */
/* ========================================= */

.burger {
    /* Supprime la bordure par défaut du bouton */
    border: none;

    /* Rend le fond transparent */
    background: transparent;

    /* Affiche une petite main au survol */
    cursor: pointer;

    /* Permet d'organiser les trois barres */
    display: flex;

    /* Place les barres les unes sous les autres */
    flex-direction: column;

    /* Espace entre les barres */
    gap: 5px;

    /* Largeur du bouton */
    width: 40px;

    /* Hauteur du bouton */
    height: 40px;

    /* Centre horizontalement les barres */
    align-items: center;

    /* Centre verticalement les barres */
    justify-content: center;
}


/* ========================================= */
/* LES 3 BARRES DU BURGER                    */
/* ========================================= */

.burger span {
    /* Transforme chaque span en barre */
    display: block;

    /* Largeur de la barre */
    width: 30px;

    /* Épaisseur de la barre */
    height: 3px;

    /* Couleur */
    background-color: rgb(240, 240, 240);

    /* Arrondit les extrémités */
    border-radius: 5px;

    /* Permet une animation */
    transition: 0.3s;
}


/* ========================================= */
/* LE MENU                                   */
/* ========================================= */

.menu {
    /* Supprime les petites puces de la liste */
    list-style: none;

    /* Supprime les marges par défaut */
    margin: 0;

    /* Supprime les espacements par défaut */
    padding: 0;

    /* Le menu est caché au départ */
    display: none;

    /* Positionne le menu sous le bouton */
    position: absolute;

    /* Distance entre le haut du menu et la navbar */
    top: 70px;

    /* Position horizontale */
    left: 20px;

    /* Couleur du fond */
    background-color: rgb(44, 44, 44);

    /* Petite bordure */
    border: 1px solid #323232;

    /* Ombre autour du menu */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);

    /* Place le menu au-dessus des autres éléments */
    z-index: 1000;
    max-height: calc(100vh - 100px);
    min-width: 240px;
    overflow-y: auto;
    border-radius: 4px;
}


/* MENU OUVERT   */    

.menu.active {
    /* Affiche le menu */
    display: block;
}


/* TEXTES DES LIENS              */

.menu a {
    /* Le lien prend toute la largeur disponible */
    display: block;

    /* Espace intérieur du lien */
    padding: 15px 25px;

    /* Supprime le soulignement */
    text-decoration: none;

    /* Couleur du texte */
    color: rgb(255, 252, 252);

    /* Taille du texte */
    font-size: 16px;
}


/* LIEN AU SURVOL           */

@media (hover: hover) and (pointer: fine) {
    .menu a:hover {
        /* Change la couleur du fond */
        background-color: #090909;
    }
}

.class-menu-panel,
.specialization-menu-panel,
.rules-menu-panel {
    position: absolute;
    z-index: 1001;
    top: 70px;
    box-sizing: border-box;
    width: 240px;
    max-height: calc(100vh - 100px);
    margin: 0;
    padding: 6px 0;
    border-radius: 4px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid #323232;
    background: rgb(44, 44, 44);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.class-menu-panel,
.rules-menu-panel {
    left: 240px;
}

.specialization-menu-panel {
    left: 480px;
}


.class-menu-panel[hidden],
.specialization-menu-panel[hidden],
.rules-menu-panel[hidden] {
    display: none;
}

.class-menu-panel a,
.specialization-menu-panel a,
.rules-menu-panel a {
    display: block;
    padding: 12px 18px;
    color: #fffdfd;
    font-size: 15px;
    text-decoration: none;
}

.class-menu-panel a:focus,
.specialization-menu-panel a:focus,
.rules-menu-panel a:focus {
    background: #090909;
}

@media (hover: hover) and (pointer: fine) {
    .class-menu-panel a:hover,
    .specialization-menu-panel a:hover,
    .rules-menu-panel a:hover {
        background: #090909;
    }
}

.class-menu-panel li + li,
.specialization-menu-panel li + li,
.rules-menu-panel li + li {
    border-top: 1px solid #eee;
}


/* ========================================= */
/* Barre avec navigation                     */
/* ========================================= */

.navbar {
    display: grid;
    grid-template-columns: minmax(40px, 1fr) minmax(220px, min(42vw, 460px)) minmax(40px, 1fr);
    align-items: center;
    gap: 20px;
}

.navigation,
.user-navigation {
    position: relative;
}

.navigation {
    justify-self: start;
}

.menu {
    left: 0;
}

.site-search {
    position: relative;
    width: 100%;
}

.site-search input {
    box-sizing: border-box;
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #b1afaf;
    border-radius: 4px;
    background: rgb(44, 44, 44);
    color: #f9f9f9;
    font: inherit;
}

.site-search input:focus {
    border-color: #295f55;
    outline: 2px solid #295f55;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.search-results,
.user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    z-index: 1000;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    border: 1px solid #323232;
    border-radius: 4px;
    background: rgb(44, 44, 44);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.search-results {
    right: 0;
    left: 0;
}

.search-results.active,
.user-menu.active {
    display: block;
}

.search-results a,
.user-menu a {
    display: block;
    padding: 11px 16px;
    color: #f9f9f9;
    text-decoration: none;
}

.search-results a:hover,
.search-results a:focus,
.user-menu a:hover,
.user-menu a:focus {
    background: #090909;
}

.search-empty {
    padding: 11px 16px;
    color: #f9f9f9;
}


/* ========================================= */
/*     USER MENU                             */
/* ========================================= */

.user-navigation {
    justify-self: end;
}

.user-menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 8px;
    place-items: center;
    border: 1px solid #b1afaf;
    border-radius: 4px;
    background: rgb(44, 44, 44);
    cursor: pointer;
}

.user-menu-toggle:hover,
.user-menu-toggle:focus-visible {
    background: #090909;
}

.user-menu-toggle img {
    display: block;
    width: 24px;
    height: 24px;
}

.user-menu {
    right: 0;
    min-width: 180px;
    max-width: 280px;
}

.user-menu-action {
    display: block;
    width: 100%;
    padding: 11px 16px;
    border: 0;
    background: transparent;
    color: #f9f9f9;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.user-menu-action:hover,
.user-menu-action:focus-visible {
    background: #090909;
}

.user-menu-action:disabled,
.auth-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}

.user-menu-account,
.user-menu-notice {
    display: block;
    padding: 10px 16px;
    color: #f4c441;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.user-menu-account {
    border-bottom: 1px solid #61f0c3;
    color: #b1afaf;
    font-weight: 700;
}

@media (max-width: 560px) {
    .navbar {
        grid-template-columns: 40px minmax(0, 1fr) 40px;
        gap: 10px;
        padding: 12px;
    }

    .site-search input {
        height: 40px;
        padding: 0 10px;
        font-size: 14px;
    }

    .class-menu-panel {
        left: 200px;
        width: 190px;
    }

    .specialization-menu-panel {
        left: 390px;
        width: 190px;
    }
}

.auth-dialog {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(420px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100% - 32px);
    margin: auto;
    overflow-y: auto;
    padding: 28px;
    border: 1px solid #323232;
    border-radius: 6px;
    background: rgb(44, 44, 44);
    color: #f9f9f9;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.auth-dialog::backdrop {
    background: rgba(18, 25, 23, 0.56);
}

.auth-dialog h2 {
    margin: 0 32px 22px 0;
    font-size: 24px;
}

.auth-close-form {
    position: absolute;
    top: 12px;
    right: 12px;
}

.auth-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #f9f9f9;
    font-size: 26px;
    cursor: pointer;
}

.auth-close:hover,
.auth-close:focus-visible {
    background: #090909;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 16px;
    border-bottom: 1px solid #323232;
}

.auth-tab {
    padding: 11px 8px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: #f9f9f9;
    font: inherit;
    cursor: pointer;
}

.auth-tab.active {
    border-bottom-color: #78cebc;
    color: #61f0c3;
    font-weight: 700;
}

.auth-message {
    min-height: 20px;
    margin: 0 0 12px;
    color: #9b2c24;
    font-size: 14px;
}

.auth-message:empty {
    display: none;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form[hidden] {
    display: none;
}

.auth-field {
    display: grid;
    gap: 7px;
    color: #f9f9f9;
    font-size: 14px;
    font-weight: 600;
}

.auth-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #b1afaf;
    border-radius: 4px;
    background: rgb(44, 44, 44);
    color: #f9f9f9;
    font: inherit;
    font-weight: 400;
}

.auth-field input:focus {
    border-color: #295f55;
    outline: 2px solid #295f55;
    outline-offset: 2px;
}

.auth-submit {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 4px;
    background: #295f55;
    color: #f9f9f9;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.auth-submit:hover,
.auth-submit:focus-visible {
    background: #1d4c43;
}