:root {
    --sidebar-bg: rgba(255, 255, 255, 0.412);
    --sidebar-border: #71717167;
    --sidebar-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #ff8fb1;
    --hover-bg: rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --sidebar-bg: rgba(28, 28, 30, 0.475);
        --sidebar-border: #acacac;
        --text-main: #f5f5f7;
        --text-secondary: #a1a1a6;
        --accent-color: #ff8fb1;
        --hover-bg: rgba(255, 255, 255, 0.1);
    }
}



/* Profil Utilisateur */
.sidebar__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    flex-shrink: 0;
}

.sidebar__profile:hover {
    background: var(--hover-bg);
}

.sidebar__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--sidebar-border);
}

.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    padding: 0 0 12px 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    border-right: 1.5px solid var(--sidebar-border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 1.5px 0 var(--sidebar-border);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    overflow: hidden;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: box-shadow 0.3s, border-radius 0.3s;
}


/* Navigation */
.sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.sidebar__nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 127, 0.45);
    border-radius: 999px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 17px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.4s;
    padding-left: 20px;
    opacity: 0.95;
}

.sidebar__icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    object-fit: contain;
    opacity: 0.95;
}

.sidebar__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 2px 8px;
    min-height: 18px;
    border-radius: 999px;
    background: #ff8fb1;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1;
    text-transform: lowercase;
    box-shadow: 0 2px 8px #ff8fb187;
}

@media (prefers-color-scheme: dark) {
    .sidebar__icon {
        filter: brightness(0) invert(1);
    }
}

.sidebar__link:hover {
    background: var(--hover-bg);

}

.sidebar__link.active {
    background: transparent;
    color: #ff8fb1;
    font-weight: 600;
}

.sidebar__link.active .sidebar__icon {
    opacity: 1;
    filter: brightness(0) saturate(100%) invert(75%) sepia(20%) saturate(900%) hue-rotate(295deg) brightness(95%) contrast(110%);
}



/* Menu Déroulant (Dropdown) */
.sidebar__profile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--sidebar-bg);
    border-radius: 14px;
    margin-top: 8px;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 10;
}

.sidebar__profile-menu.open {
    display: block;
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar__profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.2;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar__profile-link .sidebar__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    display: block;
    object-fit: contain;
    object-position: center;
    opacity: 0.92;
}

#sidebarAdminLink .sidebar__icon {
    transform: translateY(-0.5px);
}

.sidebar__profile-link:hover {
    opacity: 0.8;
}

/* Footer */
.sidebar__footer {
    margin-top: auto;
    padding-top: 20px;
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* Adaptabilité Mobile */
/* Adaptabilité Mobile - Style "Dock" Moderne */
@media (max-width: 900px) {
    .sidebar {
        width: calc(100% - 16px);
        max-width: 720px;
        height: 74px;
        top: auto;
	    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		-webkit-backdrop-filter: blur(9px);
		backdrop-filter: blur(9px);
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        padding: 0 10px;
        border-radius: 50px;
        overflow: hidden;
    }

    .sidebar__profile, .sidebar__footer {
        display: none;
    }

    .sidebar__nav {
        flex-direction: row;
        width: 100%;
        min-height: 100%;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        align-items: center;
        padding: 0 6px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        white-space: nowrap;
        flex-wrap: nowrap;
    }

    /* CACHER LA BARRE DE DÉFILEMENT (Scrollbar) */
    .sidebar__nav::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    .sidebar__nav {
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }

    .sidebar__link {
        flex: 0 0 auto;
        min-width: 80px;
        flex-direction: column;
        gap: 4px;
        padding: 7px 10px;
        font-size: 11px;
        background: transparent !important;
        border: none !important;
        border-radius: 12px;
        justify-content: center;
        line-height: 1.05;
    }

    .sidebar__icon {
        width: 20px;
        height: 20px;
        flex: 0 0 20px;
    }

    .sidebar__badge {
        margin-left: 0;
        margin-top: 2px;
        padding: 2px 6px;
        min-height: 16px;
        font-size: 9px;
    }
}