/* ==========================================================
   GRENOBLE POKER PONTOIS
   NAVIGATION PRINCIPALE — SANS BOOTSTRAP

   Desktop : barre horizontale de 64px
   Mobile  : barre de 60px et menu déroulant

   Organisation :
   1. Navigation générale
   2. Identité du club
   3. Liens publics
   4. Compte utilisateur
   5. Menu déroulant
   6. Notifications
   7. Bouton mobile
   8. Responsive
   ========================================================== */


/* ==========================================================
   1. NAVIGATION GÉNÉRALE
   ========================================================== */

.gp-nav {
    --gp-nav-height: 64px;

    position: relative;
    z-index: 1000;

    width: 100%;
    min-height: var(--gp-nav-height);

    background: var(--gp-black, #101419);
    color: var(--gp-white, #fff);
}

.gp-nav,
.gp-nav * {
    box-sizing: border-box;
}

.gp-nav-container {
    display: flex;
    align-items: center;
    gap: 24px;

    width: 100%;
    max-width: 1600px;
    min-height: var(--gp-nav-height);

    margin-inline: auto;
    padding-inline: 24px;
}

.gp-nav a {
    text-decoration: none;
}

.gp-nav button {
    font: inherit;
}


/* ==========================================================
   2. IDENTITÉ DU CLUB
   ========================================================== */

.gp-nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    flex-shrink: 0;

    color: #fff;
}

.gp-nav-brand:hover,
.gp-nav-brand:focus {
    color: #fff;
    text-decoration: none;
}

.gp-nav-logo {
    display: block;

    width: 42px;
    height: 42px;

    object-fit: contain;
    border-radius: 4px;
}

.gp-nav-brand-name {
    display: flex;
    flex-direction: column;
    justify-content: center;

    line-height: 1.15;
    white-space: nowrap;
}

.gp-nav-brand-main {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gp-nav-brand-sub {
    margin-top: 3px;

    color: var(--gp-red, #e30628);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}


/* ==========================================================
   3. NAVIGATION PUBLIQUE
   ========================================================== */

.gp-nav-content {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;

    flex: 1;
    min-width: 0;
}

.gp-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.gp-nav-item {
    margin: 0;
    padding: 0;
}

.gp-nav-link {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 44px;
    padding: 0 12px;

    color: #e5e7eb;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;

    transition:
        color 150ms ease,
        background-color 150ms ease;
}

.gp-nav-link:hover,
.gp-nav-link:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.gp-nav-link::after {
    content: "";

    position: absolute;
    right: 12px;
    bottom: 3px;
    left: 12px;

    height: 2px;

    background: var(--gp-red, #e30628);

    transform: scaleX(0);
    transform-origin: center;

    transition: transform 180ms ease;
}

.gp-nav-link:hover::after,
.gp-nav-link--active::after {
    transform: scaleX(1);
}

.gp-nav-link--active {
    color: #fff;
}


/* ==========================================================
   4. COMPTE UTILISATEUR
   ========================================================== */

.gp-nav-account {
    display: flex;
    align-items: center;

    flex-shrink: 0;
}

.gp-nav-user {
    position: relative;
}

.gp-nav-user-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    min-height: 44px;
    padding: 4px 10px;

    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;

    background: rgba(255, 255, 255, 0.04);
    color: #fff;

    cursor: pointer;
}

.gp-nav-user-toggle:hover,
.gp-nav-user-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.1);
}

.gp-nav-avatar,
.gp-nav-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    width: 30px;
    height: 30px;

    border-radius: 50%;
}

.gp-nav-avatar {
    object-fit: cover;
}

.gp-nav-avatar-placeholder {
    background: rgba(255, 255, 255, 0.12);
}

.gp-nav-avatar-placeholder svg {
    width: 19px;
    height: 19px;
}

.gp-nav-username {
    max-width: 140px;

    overflow: hidden;
    text-overflow: ellipsis;

    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.gp-nav-chevron {
    width: 16px;
    height: 16px;

    transition: transform 180ms ease;
}

.gp-nav-user-toggle[aria-expanded="true"] .gp-nav-chevron {
    transform: rotate(180deg);
}

.gp-nav-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;
    padding: 0 16px;

    border: 1px solid var(--gp-red, #e30628);
    border-radius: 5px;

    background: var(--gp-red, #e30628);
    color: #fff;

    font-size: 13px;
    font-weight: 700;

    transition: background-color 150ms ease;
}

.gp-nav-login:hover,
.gp-nav-login:focus-visible {
    background: var(--gp-red-hover, #c40020);
    color: #fff;
}


/* ==========================================================
   5. MENU DÉROULANT UTILISATEUR
   ========================================================== */

.gp-nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;

    z-index: 1010;

    display: none;

    width: 240px;

    margin: 0;
    padding: 8px;

    border: 1px solid #303640;
    border-radius: 8px;

    background: #1b2028;

    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);

    list-style: none;
}

.gp-nav-user-toggle[aria-expanded="true"] + .gp-nav-dropdown {
    display: block;
}

.gp-nav-dropdown li {
    margin: 0;
    padding: 0;
}

.gp-nav-dropdown-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 40px;
    padding: 8px 12px;

    border-radius: 5px;

    color: #e5e7eb;

    font-size: 13px;
    font-weight: 500;
}

.gp-nav-dropdown-link:hover,
.gp-nav-dropdown-link:focus-visible,
.gp-nav-dropdown-link--active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.gp-nav-dropdown-divider {
    height: 1px;

    margin: 8px 4px !important;
    padding: 0 !important;

    background: #343a44;
}

.gp-nav-dropdown-link--logout {
    color: #ff8a97;
}

.gp-nav-dropdown-link--logout:hover {
    color: #fff;
    background: rgba(227, 6, 40, 0.2);
}


/* ==========================================================
   6. NOTIFICATIONS ET MESSAGES
   ========================================================== */

.gp-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 19px;
    height: 19px;
    padding: 0 5px;

    border-radius: 10px;

    color: #fff;

    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.gp-nav-badge--notifications {
    background: var(--gp-red, #e30628);
}

.gp-nav-badge--messages {
    background: #337ab7;
}


/* ==========================================================
   7. BOUTON HAMBURGER
   ========================================================== */

.gp-nav-toggle {
    display: none;
    position: relative;

    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;

    flex-shrink: 0;

    width: 44px;
    height: 44px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;

    background: transparent;
    color: #fff;

    cursor: pointer;
}

.gp-nav-toggle-line {
    display: block;

    width: 20px;
    height: 2px;

    border-radius: 2px;

    background: currentColor;

    transition:
        transform 180ms ease,
        opacity 180ms ease;
}

.gp-nav-toggle[aria-expanded="true"] .gp-nav-toggle-line:first-child {
    transform: translateY(7px) rotate(45deg);
}

.gp-nav-toggle[aria-expanded="true"] .gp-nav-toggle-line:nth-child(2) {
    opacity: 0;
}

.gp-nav-toggle[aria-expanded="true"] .gp-nav-toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.gp-nav-toggle > .gp-nav-badge {
    position: absolute;
    top: -7px;
    right: -7px;
}


/* ==========================================================
   8. RESPONSIVE
   ========================================================== */

/* Tablettes et petits ordinateurs */

@media (max-width: 1100px) {

    .gp-nav-container {
        gap: 12px;
        padding-inline: 16px;
    }

    .gp-nav-content {
        gap: 10px;
    }

    .gp-nav-link {
        padding-inline: 8px;
        font-size: 12px;
    }

    .gp-nav-brand-main {
        font-size: 13px;
    }

    .gp-nav-username {
        max-width: 100px;
    }
}


/* Navigation mobile */

@media (max-width: 900px) {

    .gp-nav {
        --gp-nav-height: 60px;
    }

    .gp-nav-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;

        padding-inline: 15px;
    }

    .gp-nav-brand {
        min-width: 0;
    }

    .gp-nav-logo {
        width: 38px;
        height: 38px;
    }

    .gp-nav-toggle {
        display: inline-flex;
    }

    .gp-nav-content {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;

        display: none;

        padding: 12px 15px 18px;

        border-top: 1px solid #303640;

        background: var(--gp-black, #101419);

        box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
    }

    .gp-nav-content.gp-nav-content--open {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .gp-nav-links {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .gp-nav-link {

        display: flex;
        justify-content: flex-start;
        align-items: center;

        min-height: 40px;
        padding: 8px 12px;

        border-radius: 5px;

        font-size: 13px;
        font-weight: 600;
    }

    .gp-nav-link::after {
        right: auto;
        bottom: 8px;
        left: 12px;

        width: 28px;
    }

    .gp-nav-account {
        display: block;

        padding-top: 12px;

        border-top: 1px solid #303640;
    }

    .gp-nav-user-toggle {
        justify-content: flex-start;
        width: 100%;
    }

    .gp-nav-dropdown {
        position: static;

        width: 100%;
        margin-top: 8px;

        box-shadow: none;
    }

    .gp-nav-login {
        width: 100%;
        min-height: 44px;
    }
}


/* Petits téléphones */

@media (max-width: 420px) {

    .gp-nav-brand-main {
        font-size: 12px;
    }

    .gp-nav-brand-sub {
        font-size: 10px;
    }

    .gp-nav-logo {
        width: 34px;
        height: 34px;
    }
}


/* Accessibilité */

@media (prefers-reduced-motion: reduce) {

    .gp-nav *,
    .gp-nav *::before,
    .gp-nav *::after {
        transition-duration: 0.01ms !important;
    }
}
