:root {
    --navbar-width: 220px;
    --navbar-width-retracted: 58px;
    --navbar-transition: 260ms cubic-bezier(0.4, 0, 0.2, 1);
}



.navbar {
    width: var(--navbar-width);
    padding: 8px;
    background-color: white;
    border-right: 1px solid var(--border-color);
    box-sizing: border-box;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    flex-shrink: 0;

    transition: width var(--navbar-transition);
}

.navbar--no-transition,
.navbar--no-transition * {
    transition: none !important;
}

.navbar--retracted {
    width: var(--navbar-width-retracted);
    border-radius: 0 0 12px 0;
    max-height: fit-content;
    border-bottom:1px solid var(--border-color)
}



.navbar-header {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.navbar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    padding: 6px 4px;
}

.navbar-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.navbar-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -1px;
    background: var(--gradient-title);
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    white-space: nowrap;

    transition: opacity var(--navbar-transition);
}


.navbar-body {
    display: flex;
    flex-direction: column;
    max-height: fit-content;
}

.navbar-frame-top {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 4px 4px 8px;
}

.navbar-subtitle {
    color: var(--color-nav);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;

    transition: opacity var(--navbar-transition);
}



.btn-retract {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgb(150, 150, 150);
    background: none;
    padding: 0;

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

.btn-retract:hover {
    background-color: #f0f0f0;
    border-color: rgb(220, 220, 220);
    color: #333;
}

.btn-retract--active {
    transform: rotate(180deg);
}



.navbar-collection {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


.item-nav {
    text-decoration: none;
    color: var(--color-nav, #444);
    height: 38px;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;

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

.item-nav:visited {
    color: var(--color-nav, #444);
}

.item-nav:hover {
    background-color: #f2f2f2;
    transform: translateY(-1px);
    color: #111;
}

/* Barre d'accent gauche */
.item-nav::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: var(--gradient-title, #5247c7);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
}

.item-nav:hover::before {
    transform: scaleY(1);
    opacity: 1;
}

/* Page active */
.item-nav--active {
    background: var(--gradient-title);
    color: white;
    font-weight: 600;
}

.item-nav--active:visited {
    color: white;
}

.item-nav--active::before {
    display: none;
}

.item-nav--active:hover {
    transform: none;
    filter: brightness(1.05);
}


/* ---- Logo & label ---- */

.item-nav-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.item-nav-label {
    font-size: 14px;
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 450;
    overflow: hidden;
    text-overflow: ellipsis;

    transition: opacity var(--navbar-transition);
}




@media (max-width: 768px) {
    .navbar {
        width: 100% !important;
        min-height: unset;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .navbar--retracted {
        border-radius: 0;
    }

    .navbar-collection {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .item-nav {
        flex: 1 1 auto;
        justify-content: center;
    }

    .item-nav-label {
        display: none;
    }

    #navbar-retract {
        display: none;
    }

    #content {
        flex-direction: column;
    }
}